Skip to content

Slimmified CI #2917

Closed
umgefahren wants to merge 6 commits intolibp2p:masterfrom
umgefahren:new-ci
Closed

Slimmified CI #2917
umgefahren wants to merge 6 commits intolibp2p:masterfrom
umgefahren:new-ci

Conversation

@umgefahren
Copy link
Copy Markdown
Contributor

@umgefahren umgefahren commented Sep 19, 2022

Description

I removed some steps from the CI to improve the peformance. This is possible, because GitHub Actions runners now come with Rust support.

Links to any relevant issues

Origin: #2900

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@umgefahren umgefahren changed the title slimmer ci Slimmified CI Sep 19, 2022
Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I am in favor of this.

I don't know why we are referencing actions by hash instead of version. @mxinden Do you know?

- name: Run cargo clippy
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: custom-clippy # cargo alias to allow reuse of config locally
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are running an alias here, please retain that (with the comment!).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why are you running an alias here? I don't quite understand the assignment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alias is a workaround for clippy still not having a config file.

It is defined here: https://github.com/libp2p/rust-libp2p/blob/master/.cargo/config.toml#L3

This allows us to allow certain lints across the codebase without having to duplicate this in a bunch of places :)

@mxinden
Copy link
Copy Markdown
Member

mxinden commented Sep 21, 2022

I don't know why we are referencing actions by hash instead of version. @mxinden Do you know?

Reasoning is here:

I pinned the third-party action versions to the exact commit SHAs. We follow the same strategy in protocol go repositories to ensure the code we use doesn't change.

#2424

I don't have a strong opinion here. Maybe @galargh does?

@galargh
Copy link
Copy Markdown
Member

galargh commented Sep 21, 2022

Yes, exactly! Pinning actions by hash is a mitigation for a potential supply chain attack. We try to do that for all actions that are neither from PL orgs nor https://github.com/actions.

@thomaseizinger
Copy link
Copy Markdown
Contributor

Okay, thanks for clarifying! Let's go back to commit hashes then please @umgefahren!

Plus, #2917 (comment) needs to be addressed before we can merge this!

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

I think the original idea of the PR - to get rid of actions-rs/toolchain is good. To stay focused on that, can we revert the other changes to what they were? I think the old commit hashes been set exactly to the hash of the releases before and now we are pointing to some commit on master.

- name: Run cargo clippy
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: custom-clippy # cargo alias to allow reuse of config locally
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alias is a workaround for clippy still not having a config file.

It is defined here: https://github.com/libp2p/rust-libp2p/blob/master/.cargo/config.toml#L3

This allows us to allow certain lints across the codebase without having to duplicate this in a bunch of places :)

- uses: actions/checkout@v3

- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0
- uses: Swatinem/rust-cache@76686c56f2b581d1bb5bda44b51f7e24bd9b8b8e
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, this hash is not yet part of a released version. I'd prefer if we just not touch this line at all and revert back to exactly what we had :)

access_token: ${{ github.token }}

- name: Install Protoc
uses: arduino/setup-protoc@v1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is my understanding that v1 would actually correspond to arduino/setup-protoc@64c0c85.

steps:

- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's revert this too please.

@umgefahren
Copy link
Copy Markdown
Contributor Author

I will take another go at this later. Closing for now.

@umgefahren umgefahren closed this Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants