Skip to content

ci: semver checks fail a pull request that breaks the stable Rust API without marking its title with ! (#873) - #910

Merged
DrunkOnJava merged 6 commits into
mainfrom
ci/semver-checks
Oct 23, 2026
Merged

DrunkOnJava merged 6 commits into
mainfrom
ci/semver-checks

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

A semver checks job (tools/ci/semver-gate.sh) compares each pull request's stable Rust API with its base in two ways: cargo-semver-checks 0.51.0, and a cargo-public-api 0.52.0 listing of every public item with its full signature, base against head. It fails on a breaking change unless the PR title carries the Conventional Commits ! or the body a BREAKING CHANGE: footer. CI passed now needs it. This is the crate half of S2 in #873.

Motivation

#873, criterion S2: "each stable surface has a check that fails on an unannounced breaking change". The crate had none.

Design

  • Baseline: the PR's base, not the last release. Main already holds breaking changes announced when they landed (refactor(api)!: move the research readers to rvt::research behind the unstable-research feature (#873) #890 moved 67 modules under rvt::research, refactor(elements)!: one SimpleDecoder replaces the 67 decoder types 15 copies of simple_decoder! generated #894 replaced 67 decoder types). Against 0.6.1, every PR would fail on those whatever it changed. Against its base, a PR is judged on its own change.
  • Features: --default-features. That leaves out unstable-research, so the research tree is not part of the check, and dhat-heap, a profiling switch for the examples. #[doc(hidden)] pub mod cli is ignored by the tool.
  • Release type from the version. Both sides carry the same version, so the release type is set rather than inferred: patch before 1.0 and minor from 1.0, so that after 1.0 a minor-only lint (an added #[must_use]) does not need !.
  • The listing diff covers what cargo-semver-checks misses. That tool documents that it does not catch, for example, a parameter's changed type. Any line of the base's listing that is missing from the head's is an item removed or changed. Added lines are fine. cargo-public-api reads nightly rustdoc JSON, so its nightly is pinned near the tool's release (nightly-2026-05-20).
  • The title is read through the API at run time. A re-run replays the original event payload, so a title taken from github.event would not change after a retitle. The job asks gh api repos/.../pulls/N. Fork PRs work with the read-only token (pull-requests: read).
  • No verdict, no pass. Only cargo-semver-checks' exit 100 (violations found) reaches the title check; 101 (could not complete) or any other failure, and a failed listing, fail the job whatever the title says.
  • On pushes to main the job is skipped (CI passed accepts skipped).

Changes

  • tools/ci/semver-gate.sh: both checks and the announcement rule.
  • .github/workflows/ci.yml: the semver job, which installs both tools and the pinned nightly, and semver in ci-ok's needs.
  • CONTRIBUTING.md: the ! rule under "Commit messages".
  • docs/release-1.0-criteria.md: S2's evidence says what is checked now, and what is not: six of the twelve JSON-emitting CLIs have no schema, and the Python API, outputs and wasm API have no check. S2 stays failed.

Testing

Open PRs that break the API already carry ! (#898, #903).

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • No limitation resolved or introduced
  • Commit messages describe what and why
  • No emojis
  • No private paths, personal email addresses, or internal jargon in committed files
  • Reverse-engineering finding: N/A

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74ced28029

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

End-to-end evidence from the throwaway draft #911. It is this branch plus one commit that narrows streams::year_for_partition to pub(crate).

An earlier run showed that the step needs set +e: Actions runs bash with -e, so the first version exited on the tool's status before judging it (fff820a).

#911 is closed unmerged and its branch deleted.

… a public API listing diff, and follows the release type after 1.0

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 933ab10da8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/ci/semver-gate.sh Resolved
Comment thread tools/ci/semver-gate.sh Resolved
Comment thread tools/ci/semver-gate.sh Resolved
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Second demo, #918: redact::redact_path_str takes impl AsRef<str> instead of &str. That is a signature change existing callers still compile against, and cargo-semver-checks does not lint it. Job: https://github.com/DrunkOnJava/rvt-rs/actions/runs/39965479130/job/120454292529

  • cargo-semver-checks: "229 checks: 229 pass, 31 skip", "Summary: no semver update required".
  • The public API listing (cargo-public-api 0.52.0 on nightly-2026-05-20): 15,425 items at the base and at the head, with one base line missing from the head: pub fn rvt::redact::redact_path_str(&str) -> alloc::string::String.
  • The job fails: "The stable API has a breaking change (above) that the pull request does not announce."

This PR's own run passes both checks: https://github.com/DrunkOnJava/rvt-rs/actions/runs/39965470176/job/120454072843. #918 is closed unmerged.

@DrunkOnJava
DrunkOnJava merged commit 6af75c9 into main Oct 23, 2026
28 checks passed
@DrunkOnJava
DrunkOnJava deleted the ci/semver-checks branch October 23, 2026 14:39
DrunkOnJava added a commit that referenced this pull request Oct 24, 2026
…onours SOURCE_DATE_EPOCH (#873) (#926)

## Summary

`RELEASE.md` promises the output formats are written deterministically,
and nothing checked it. A new CLI test runs every shipped writer twice
on the same file and requires the same bytes. The one thing that
differed, the export time an IFC records, is now set by
`SOURCE_DATE_EPOCH`.

## Motivation

S2 of the 1.0 criteria (#873) needs a check on each stable surface. The
crate, the Python stubs, the wasm bindings and the CLIs' JSON got theirs
in #910, #913 and #915; the output formats had validity checks
(IfcOpenShell, the glTF container, the schedule columns) but none for
the determinism `RELEASE.md` names. The IfcOpenShell witness writes
`"deterministic": true` as a constant, not a measurement.

## Changes

- `src/bin/rvt_ifc.rs`: reads `SOURCE_DATE_EPOCH` (Unix seconds, the
reproducible-builds convention) and passes it to
`write_step_with_options`; unset or empty keeps the wall-clock time,
anything else that is not a number is refused before the file is opened.
The help mentions it, and the module doc and `about` no longer say the
export is document-level only.
- `tests/reproducible_outputs.rs` (class `cli`): `rvt-ifc`, `rvt-gltf`,
`rvt-sheet`, `rvt-schedule` and `rvt-schedule --schedule rooms`, twice
each, same bytes, on the tier-1 project and on `Revit_IFC5_Einhoven.rvt`
when `RVT_PROJECT_CORPUS_DIR` has it (tier 2). A second test checks the
epoch reaches the `FILE_NAME` header and `IfcOwnerHistory`, and that a
malformed value fails naming the variable.
- `docs/user-guide.md` (Export IFC), `RELEASE.md` (Output formats row),
`docs/release-1.0-criteria.md` (S2 passed, with what each check is),
`CHANGELOG.md`.

## Testing

CI runs the new target; no build on this machine. The measured result is
the test itself: the same bytes from two runs of each writer, on a
synthetic and a real file.

- [ ] `tools/check-local.sh` passes: left to CI
- [x] Verified end to end: the test runs the built CLIs on the committed
tier-1 file and on Einhoven (magnetar-io/revit-test-datasets, MIT) in
tier 2
- [x] IFC exporter: the IFC body is unchanged; only the header and
owner-history time can differ, and only when `SOURCE_DATE_EPOCH` is set.
Witness observations hash entity counts, relations and storeys, so they
do not move
- N/A: performance

## Audit-honesty checklist

- [x] Docs reflect the state after this PR
- [x] No limitation resolved beyond the check itself
- [x] No new limitation
- [x] Commit message says what and why
- [x] No emojis
- [x] No private paths
- N/A: not a format finding

## Legal and contribution hygiene

- [x] Apache-2.0
- [x] No Autodesk proprietary content
- [x] No new fixtures

## Breaking changes

None. Without `SOURCE_DATE_EPOCH`, `rvt-ifc` writes what it wrote
before.

## Screenshots or output samples

With `SOURCE_DATE_EPOCH=1700000000` the header reads
`FILE_NAME('…','2023-11-14T22:13:20',…)` and the owner history ends
`,1700000000);`.

## Related issues

Refs #873 (S2)
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant