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
Check for changes to the public API #2713
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 8863062354Details
💛 - Coveralls |
42dad8b
to
d9656b9
Compare
contrib/check-for-api-changes.sh
Outdated
popd > /dev/null | ||
} | ||
|
||
# Check if there are changes (dirty git index) to the `api/` directory. |
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.
In eb1f403:
trailing whitespace
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.
It is still pending this @tcharding.
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.
My bad, thanks. Fixed now.
Note that even though we agreed to just push forward on this, it may take a bit to get in because (a) we still need two ACKs, unless it sits open for 2 weeks without any comments, and (b) it will need to be rebased every time we merge something that changes the API. |
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.
ACK d9656b9
After two months of being kind of stressed (as stressed as a bloke who works at home in tracksuit pants can be anyways) I found myself this last couple of days in a strange place of calm, just accepting that likely nothing is going to merge any time soon. Finally making some headway in I kind of think we should do your idea of branching off and doing the |
api/README.md
Outdated
API text files | ||
============== |
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.
I prefer that documentation is consistent.
All .md
files in the repo uses the GH flavor, e.g.
Lines 1 to 5 in a9cdcb4
# Contributing to rust-bitcoin | |
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: | |
The following is a set of guidelines for contributing to Rust Bitcoin |
API text files | |
============== | |
# API text files |
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.
Ah yeah, sure thing. Thanks!
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.
I tend to use ====
in my own stuff so I went to check that I hadn't introduced any other files and there are tons in this repo
gg '===='
base58/README.md:2: =======================
bitcoin/tests/data/README.md:2: ================
bitcoin/tests/data/serde/README.md:2: ==========================
fuzz/README.md:103:=====================================================================
internals/README.md:2: ======================
io/README.md:2: =======================
units/README.md:2: =============
We should probably make them all uniform.
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.
gg
is an alias to git grep -IPn --color=always
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.
Yes my
All .md files
was based on a sample from the root dir .md
s. I should have been more specific :/
We should definitely normalize all of them.
I can work in a future PR to normalize markdown, I am quite used from an old gig that I was in charge of technical documentation in scientific software.
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.
Sweet, nice one.
api/README.md
Outdated
Requires `cargo-public-api`, install with: | ||
|
||
`cargo +stable install cargo-public-api --locked`. |
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.
Also this can be a bash
fenced block no?
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.
Done, thanks.
We have the `$cargo_ver` variable already, use it in the error message instead of the duplicate call to `$(cargo --version)`.
d9656b9
to
1aaf666
Compare
We would like to check for API changes during development and in CI so that such changes can be discussed separately from the code. Add tooling and documentation for creating API listings for the public crates within the workspace (i.e., not `internals`). Add API text files from an initial run of the script.
Add a job that runs the new script to check for changes to the public APIs of `hashes` and `bitcoin`.
1aaf666
to
f228f54
Compare
Force push is the two suggested fixes. |
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.
ACK f228f54
Add a `just` command to run the API checking script. Makes it more discoverable.
f228f54
to
7e5ff49
Compare
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.
ACK 7e5ff49
This PR is #1880 re-opened.
Add a script that checks the public API of
hashes
andbitcoin
. Document how to use it during development. Call it in CI. Do not add it to githooks because the githooks because its expected to be run per PR not per commit.Includes a
just
command to run the script:just check-api
Implied workflow change
This PR imposes workflow changes.
Explicitly: all PRs that change the public API of
bitcoin
,base58
,hashes
,io
, orunits
must contain changes to the api text files.Suggestion: We add the patch updating api text files as a separate patch at the end of each PR so we can haggle over it separately from the actual code changes.
Fix: #1875