Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added warning on CHANGELOG.md & rust-toolchain.toml #413

Merged
merged 7 commits into from
Jul 22, 2024

Conversation

phklive
Copy link
Contributor

@phklive phklive commented Jul 17, 2024

In this PR I propose to add a warning in the CI if the CHANGELOG.md file has not been modified.

@phklive phklive marked this pull request as ready for review July 17, 2024 13:22
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left a couple of comments inline.

CHANGELOG.md Outdated Show resolved Hide resolved
.github/workflows/lint.yml Outdated Show resolved Hide resolved
Comment on lines +44 to +53
name: check rust version consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
profile: minimal
override: true
- name: check rust versions
run: ./scripts/check-rust-version.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

While we are at it, let's also change rust-toolchain to rust-toolchain.toml and update the check-rust-version.sh script accordingly.

Copy link
Contributor

@Mirko-von-Leipzig Mirko-von-Leipzig Jul 18, 2024

Choose a reason for hiding this comment

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

I don't understand why we're restricting the current toolchain to the MSRV of the workspace. I've read through #267, #272 and the related miden-vm PRs and issues, and discord.

From what I can tell its issues due to using the nightly compiler -- which afaik we're not using? Having the lock file committed should be more than enough when using stable compiler.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the primary motivation is that everyone is using the same toolchain as we've had issues when things suddenly break if a different version is used. As an example, in facebook/winterfell#277 code that worked fine prior to 1.78 started failing with 1.78 onwards (this was due to the bug in the code, but still).

Another example is something like 0xPolygonMiden/miden-vm#917, where nothing broke but there was a significant performance degradation when moving from 1.69 to 1.70 (which fixed itself after 1.74).

else
echo $'::warning file=CHANGELOG.md::CHANGELOG.md has not been modified.\n This warning can be ignored if is has been explicitely decided not to log changes.\n Except in this situation, make sure to add log changes.'
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

A downside to this is that this marks the overall CI run as a failure; somewhat destroying the glance value. If we think it will be rare to have a no-op changelog PR then this is probably fine.

Did you look into existing github actions we could use? e.g. this one allows you to skip the check by adding a no changelog label to the PR. I haven't actually audited the action itself though.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit hesitant to use actions that are not very popular - but skipping changelog check by adding no changelog label seems cool. Is this something that can be fairly easily emulated locally?

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough; I believe we should be able to simply copy the actions code. Its very short, label is added as an env variable and then simply used in an if then within the script.

env:
    NO_CHANGELOG_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'no changelog') }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this PR I inspired myself with the action code and merged it with our existing one, enabling us to get the no changelog label feature: 0xPolygonMiden/miden-vm#1406

And not having to depend on not widely used actions as @bobbinth mentioned

Copy link
Contributor

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

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

Some questions, but the addition itself seems fine (modulo @bobbinth's comments).

I would also consider using dtolnay's toolchain action but that can be a separate issue.

^^ already been discussed :)

@bobbinth
Copy link
Contributor

bobbinth commented Jul 18, 2024

I would also consider using dtolnay's toolchain action but that can be a separate issue.

We've had this before, I believe, but decided to switch to the methodology used by rust-analyzer.

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! Let's do the following and then merge:

@phklive phklive changed the title Added warning on CHANGELOG.md modification Added warning on CHANGELOG.md & rust-toolchain.toml Jul 22, 2024
@phklive
Copy link
Contributor Author

phklive commented Jul 22, 2024

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@bobbinth what is the toolchain that we want to use for our repos?

https://github.com/0xPolygonMiden/compiler/blob/44e2d383f4871c8b2ed5c86e7a4b3393cac34a5a/rust-toolchain.toml#L3

Let's use the one from the miden-vm repo.

@bobbinth bobbinth merged commit ed1edf0 into next Jul 22, 2024
8 checks passed
@bobbinth bobbinth deleted the phklive-changelog-warning branch July 22, 2024 17:57
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.

3 participants