Skip to content

Remove the check api tool#2912

Closed
tcharding wants to merge 1 commit intorust-bitcoin:masterfrom
tcharding:06-25-rm-api-files
Closed

Remove the check api tool#2912
tcharding wants to merge 1 commit intorust-bitcoin:masterfrom
tcharding:06-25-rm-api-files

Conversation

@tcharding
Copy link
Copy Markdown
Member

Both Andrew and myself think this was an improvement but Kix won't stop whinging about it.

Just remove the whole thing.

@github-actions github-actions bot added the doc label Jun 24, 2024
Both Andrew and myself think this was an improvement but Kix won't stop
whinging about it.

Just remove the whole thing.
@tcharding
Copy link
Copy Markdown
Member Author

tcharding commented Jun 24, 2024

lol 36,000 lines of red in the diff - irrespective of any other considerations that is a win.

@Kixunil
Copy link
Copy Markdown
Collaborator

Kixunil commented Jun 25, 2024

Feel free to postpone this until an alternative is ready. Though it might make me reluctant to make PRs while the check is in.

@apoelstra
Copy link
Copy Markdown
Member

Sure, but I still don't know what an alternative would look like. I do not want anything that is github-only. We could have a bot which edits PRs for people, but that will cause problems when they try to add commits and find that the upstream version of their PR has extra bot stuff on it. So then we're back to making them run a local tool.

We could vendor cargo-check-api into this repo itself?

@Kixunil
Copy link
Copy Markdown
Collaborator

Kixunil commented Jun 25, 2024

So then we're back to making them run a local tool.

git pull --rebase or git push -f and let the bot handle the changes.

We could vendor cargo-check-api into this repo itself?

If you publicly claim you've reviewed the code and found no backdoors or other stuff you can just publish a git hash. :)

@tcharding
Copy link
Copy Markdown
Member Author

tcharding commented Jun 26, 2024

Lets back up, what we have today is (please correct me if I'm wrong):

  • A tool that @apoelstra and myself find useful when developing and reviewing patches
  • A workflow that creates annoying but acceptable friction for Andrew and myself
  • A workflow that is unacceptable to @Kixunil
  • A workflow that is a bit annoying to drive-by-devs

Would the following keep all the benefits and remove all the negatives:

  • Remove the check-api CI job and text files
  • Add a script that does something along the lines of "create a new tmp branch, add a patch at the front with current api, add a patch at the end with api changes (or after each patch)"

This would allow:

  • Creating an on-push-bot that runs the script so there is a public branch that can be linked to if discussion needs to happen on the api file changes.
  • Andrew and myself to run the script locally either during dev or review when it seems it would help.

And finally, when we 1.0.0 a crate add some way of using the tool to check we don't accidentally merge API breaking changes.

@apoelstra
Copy link
Copy Markdown
Member

@tcharding ok, yeah, that looks like a good summary. And yes, if there were a local tool that would just show the API diff for individual commits (and maybe whole PRs) that would be great.

@tcharding
Copy link
Copy Markdown
Member Author

Leave it with me.

@tcharding tcharding marked this pull request as draft July 3, 2024 22:55
@tcharding
Copy link
Copy Markdown
Member Author

#2946 does the removal, leaving this in draft to remind me to write the tool to use locally.

apoelstra added a commit that referenced this pull request Jul 5, 2024
eeae225 ci: add cargo-semver-checks (Jose Storopoli)
d9567b0 ci: remove check-api (Jose Storopoli)

Pull request description:

  - Removes `check-api` (`cargo-public-api`)
  - Adds `cargo-semver-checks`

  ## Note to Reviewers

  There is a new script `contrib/check-semver.sh` that checks for semver breaks against `master`.
  If it detects a breaking change it will create the `.semver-break` file.
  If this file exists then we will add an `API break` label and a big comment to the PR saying:

  > 🚨 API BREAKING CHANGE DETECTED

  It reproduces the current behavior of `cargo-public-api`:

  - `bitcoin`:
    - `all-features`
    - `no-default-features`
  - `base58ck`:
    - `all-features`
    - `no-default-features`
  - `bitcoin_hashes`:
    - `no-default-features`
    - `features alloc`
  - `bitcoin-units`:
    - `no-default-features`
    - `features alloc`
  - `bitcoin-io`:
    - `no-default-features`
    - `features alloc`

  Closes #1875.
  Supersedes #2912.

  ## Context

  Our current test to check API breaks using `cargo public-api` is not "automated" per se.
  It needs contributors to keep tabs on text files with function signatures and other things and forces reviewers to be the _de facto_ API break detector tool.

  The idea is to use the well-acclaimed and maintained `cargo semver-checks` that will do this automatically in CI.

ACKs for top commit:
  Kixunil:
    ACK eeae225
  tcharding:
    ACK eeae225

Tree-SHA512: a77d64b4ca6500b80e6f98f9735d17193f8eaa9998e38602f46418f4b9f3b391ffe9b06bfe8e0285fc4350e8214ebd203034693bac858bac31b7d722903933ae
@tcharding
Copy link
Copy Markdown
Member Author

Script written, see #2986

@tcharding tcharding closed this Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants