Skip to content

Fill in deprecation versions at release - #1984

Merged
spacebear21 merged 1 commit into
payjoin:masterfrom
DanGould:deprecation-since-placeholder
Oct 16, 2026
Merged

spacebear21 merged 1 commit into
payjoin:masterfrom
DanGould:deprecation-since-placeholder

Conversation

@DanGould

Copy link
Copy Markdown
Member

A deprecation's since version gets written before anyone knows which release will ship it (#1971 discussion). This has PRs write 0.0.0-unreleased instead. bump.sh fills in the crate's version in the release PR, and check-invariants.sh fails if a crate being released still has one.

rust-bitcoin does this with since = "TBD" (CONTRIBUTING.md). rustc reads TBD as a deprecation in a future version and only warns under the allow-by-default deprecated_in_future lint, so callers would hear nothing until the release. Other words like Unreleased do warn, but clippy's deprecated_semver lint rejects them. A pre-release version passes clippy and warns as usual, and #[allow(deprecated)] covers it both before and after the bump.

UniFFI doesn't carry deprecation attributes into the bindings (mozilla/uniffi-rs#1219), so payjoin-ffi writes deprecations in doc comments. bump.sh replaces since <crate> 0.0.0-unreleased there with that crate's version, which lets the bindings name the payjoin release that deprecated something. Each bump only edits its own crate's src, so a payjoin bump leaves the bindings' notes for the payjoin-ffi bump.

I tested it by putting placeholders in a scratch checkout, in payjoin/src (the attribute and the prose form) and in payjoin-ffi/src (both since payjoin and since payjoin-ffi). Then I ran bump.sh --no-lock for each crate. Every placeholder got the right version, payjoin didn't match payjoin-ffi, and check-invariants.sh flagged the placeholders before the bump. There's no test harness for these scripts, so none is included.

Reviewer: @spacebear21

Local AI review done (Codex), no findings.

Disclosure: co-authored by Claude Code

A deprecation's `since` version is written before anyone knows which
release will ship it, so it can end up wrong. Write the placeholder
0.0.0-unreleased instead and let bump.sh replace it with the crate's
version, next to where it renames the changelog's Unreleased section.
check-invariants fails if a crate being released still has one.

rust-bitcoin uses "TBD" for this, but rustc reads that as a future
deprecation and does not warn callers until it is replaced. Strings
like "Unreleased" do warn, but clippy's deprecated_semver lint rejects
them. A pre-release version passes clippy and warns as usual.

UniFFI has no deprecation attribute, so payjoin-ffi states deprecations
in doc comments. bump.sh fills `since <crate> 0.0.0-unreleased` there
with that crate's version, so the bindings can name the payjoin
release that deprecated an item.
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 38940097324

Coverage remained the same at 87.475%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 17860
Covered Lines: 15623
Line Coverage: 87.47%
Coverage Strength: 319.46 hits per line

💛 - Coveralls

@spacebear21 spacebear21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK

There is an existing deprecated flag on SenderBuilder::new that lists 1.0.1 as the since version. That version doesn't exist though, should we update that to 1.1.0 in this PR?

@spacebear21
spacebear21 merged commit f1dc636 into payjoin:master Oct 16, 2026
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants