cargo-public-api icon indicating copy to clipboard operation
cargo-public-api copied to clipboard

Deny all the things!

Open matthiasbeyer opened this issue 3 years ago • 3 comments
trafficstars

In #72 the foundation for denying API diffs was implemented.

This PR is the next step to allow only certain changes to APIs via CLI parameter.

Tell me what you think, whether this looks good to you. If it does, I can of course add tests!

matthiasbeyer avatar Jul 26 '22 08:07 matthiasbeyer

Thank you for making a follow-up PR!

You have real bad luck with CI because you yet again hit a failure not caused by your changes.

If you rebase on main branch after fetch it should pass.

As for the PR itself, some high level comments:

  • The terminology we should use is added, changed, removed (not deleted). I might have wrongly use "deleted" myself in places, but it should be "removed".
  • I'm thinking the CLI should look like this: --deny=added --deny=removed --deny=changed. Maybe even allow combinations such like this: --deny=changed,removed, but feel free to wait with that.
  • Before a CR I would like tests to be in place and pass in CI, because that indicates significant maturity of the code, and I prefer to review mature code :)

Enselic avatar Jul 27 '22 20:07 Enselic

Rebased, fixed your suggestions and also added tests. I'm not 100% sure about whether the tests are correct though, so you should probably have a look at them first :laughing:

matthiasbeyer avatar Jul 28 '22 05:07 matthiasbeyer

Just a tip in case you didn't know: You can run ./scripts/run-ci-locally.sh to see if CI will pass. 99% of the time the script is accurate. I would say 100% for code like in this PR. So you don't have to push code here to see if CI will pass :)

Enselic avatar Jul 28 '22 17:07 Enselic

Here's another heads-up: I just merged https://github.com/Enselic/cargo-public-api/pull/90.

It does not cause any merge conflict with this PR (I did a test-merge), but I recommend you rebase on main again to not accidentally start introducing conflicts in your own code.

Enselic avatar Aug 03 '22 18:08 Enselic

Rebase was a cake :cake: and I took the liberty to squash away my fixups while I was at it.

Do you have any pointers what I need to fix to get the CI green? I am not seeing it right now :see_no_evil:

matthiasbeyer avatar Aug 04 '22 06:08 matthiasbeyer

(The PR title is used in the autogenerated release-notes, so I changed it to be more descriptive)

Enselic avatar Aug 12 '22 12:08 Enselic

I just saw that CI passes! Nice job! Maybe we should land this PR as-is (after review), and then I could look into doing my suggested improvements on top of that (but you are also more than welcomed to take a shot if you are interested)

Let me know your preference

Enselic avatar Aug 13 '22 06:08 Enselic

I am a big fan of "get it right the first time", so I am happy to continue iterating on this!

matthiasbeyer avatar Aug 13 '22 06:08 matthiasbeyer

WHOOOP!

CI green! Can I ask you to spend a little portion of your Sunday for a review? If everything is fine, I will do a full history cleanup and then we can do a final round before we merge this - or, of course, if you find anything that can be improved, reiterate (I'm of course more than happy to)!

matthiasbeyer avatar Aug 14 '22 09:08 matthiasbeyer

Your latest suggestions were added in this rebase+squash. I am ready to merge here! :tada:

matthiasbeyer avatar Aug 15 '22 06:08 matthiasbeyer

CI fails because rustdoc JSON format changed in nightly as I mentioned 😅

I'll take care of updating rustdoc JSON and then rebase this and get it merged today 👍

Enselic avatar Aug 15 '22 07:08 Enselic

Just ping me for the rebase! :wink:

matthiasbeyer avatar Aug 15 '22 07:08 matthiasbeyer

Is it ok if I do it? I'll keep your commits and just add a commit to update readme and --help text

Enselic avatar Aug 15 '22 07:08 Enselic

Okay, if that suits your workflow better, feel free! :tada: :+1: :smile:

matthiasbeyer avatar Aug 15 '22 07:08 matthiasbeyer

👍

Enselic avatar Aug 15 '22 07:08 Enselic

:tada:

matthiasbeyer avatar Aug 15 '22 13:08 matthiasbeyer

Released as v0.14.0 (:tada:)

Enselic avatar Aug 15 '22 13:08 Enselic