-
Notifications
You must be signed in to change notification settings - Fork 961
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
.github/workflows: Enforce semver compliance with cargo semver-checks
#2647
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)
I suggest you enable GH actions in your fork and iterate there, it is much quicker because you can force-push to master and don't have to wait for the CI approval.
Good idea @thomaseizinger , thanks for the recommendation. |
6a036e8
to
0487eb1
Compare
Currently this step fails with |
Add a CI job to check if we have correctly set the crate version based on Semantic Versioning rules. This job was copied from: libp2p/rust-libp2p#2647 And uses this tool: https://github.com/rust-lang/rust-semverver
Add a CI job to check if we have correctly set the crate version based on Semantic Versioning rules. This job was copied from: libp2p/rust-libp2p#2647 And uses this tool: https://github.com/rust-lang/rust-semverver
I suspect the |
Well, the fact that they are breaking will not change with the chosen version number :) What should change is whether the tool reports it as a problem. With version |
Good point, well then I am unsure why it says the changes are breaking. In the event there are no breaking changes, outputs to a file which contains the current version i.e. |
I am not sure why the new CI step is failing, any ideas?
|
Sorry I took so long to reply to this, was on vacation. My only hypothesis right now is that 245b056#diff-4ef9da87778def7bb67a144d06f9cc429d901994dd8b054812c14c1dac2b0df6R76-R78 introduced a new field and based on the current RFC adding new fields to a variant in an Suffice to say, it may require quite a bit of backwork for this PR to be merged.I think despite the strong concept ACK, we may want to explore the opportunity cost of enforcing semver's current perspectives on breaking changes a bit more before beginning that work / moving ahead with adding these steps. |
Thanks for digging into this once more @maschad.
Correct, 245b056#diff-4ef9da87778def7bb67a144d06f9cc429d901994dd8b054812c14c1dac2b0df6R76-R78 has been a breaking change, but it was released pre
Am I missing something? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rust-semver now recommends nightly-2022-06-20
. That might solve the compilation errors on rust-semver itself.
Random guess: Could these issues arise from our workspace and re-exporting crates? |
Or potentially due to #2720, as that imports another |
I think your theory is better :D |
Awesome, thank you!
Thank you for making and improving it :) |
Our
@thomaseizinger @obi1kenobi any ideas why this is failing? |
Confirmed bug, thanks for reporting. Will open an issue in As usual, we'll add those packages to our regression suite (here's the entry for the previous bug you reported) so this problem doesn't happen again after it's fixed. |
Unfortunately, I found that this is because of a combination of renaming re-exports causing confusion between multiple enums with the same name. For example, a
The false-positives happen because the lint tries to match up all the variants across different enums, which obviously isn't going to do the right thing.
That said, it's still important to fix and this should be sufficient motivation to come up with a permanent solution to the re-exports problem :) Thanks for bearing with me on this. |
@mxinden How should we proceed in the meantime? We can either:
I'd like to use our mergify automation again for merging PRs but that one doesn't work as long as our CI is red. |
If you're open to tweaking the code a bit, I think it should be possible to work around the The issue tripping up Renaming If the above isn't something you'd like to do, then the next best thing would be excluding those two crates from the I'm also trying to work out a proper fix for |
Thanks! That is helpful! I am definitely open to tweaking the code. Do you think type aliases would work? |
Unfortunately I don't think they would, since I don't believe they are reflected in the rustdoc JSON data. Happy to review PRs or write one together with you if that'd be helpful. |
I've opened a PR here with your suggestion, let's see if it works: #3213 |
Your proposed fix works but my planned deprecation of other symbols that I wanted to do in one go doesn't :(
|
I've split the renaming into a separate PR, so we can merge the fix in isolation: #3214 I am not sure if it is the same underlying issue but supporting type aliases is more important. They allow us to deprecate APIs which we use quite extensively. I am not a fan of renaming imports myself so if you have to pick which one to implement first, I'd vote for type aliases :) |
Thanks for the suggestion, definitely very valuable feedback! I opened obi1kenobi/cargo-semver-checks#215 for that. I'm hopeful that reworking the import-handling code might help resolve both issues at once 🤞 |
I'm putting the finishing touches on obi1kenobi/cargo-semver-checks#330 as a fix for the re-export and typedef false-positives, and if all goes well it should be part of cargo-semver-checks 0.17 🤞 Thanks for your patience! |
Awesome work! Looking forward to seeing this in a release! |
https://github.com/obi1kenobi/cargo-semver-checks/releases/tag/v0.17.0 is out now 🚀 If you notice any re-export bugs after upgrading (or any other bugs, really), please ping me and I'll fix them ASAP. |
Description
Complying with Semver makes it easier for users to consume rust-libp2p.
Links to any relevant issues
#2635
Change checklist