Skip to content

fix(ci): always run cargo-public-api in semver-level.sh - #2072

Merged
iunanua merged 5 commits into
mainfrom
igor/versioning/semver-level-opt
Jul 6, 2026
Merged

fix(ci): always run cargo-public-api in semver-level.sh#2072
iunanua merged 5 commits into
mainfrom
igor/versioning/semver-level-opt

Conversation

@iunanua

@iunanua iunanua commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Modify semver-level.sh to check the output of cargo-public-api
Upgrade cargo-public-api to 0.52.0
Upgrade cargo-semver-checks to 0.48.0

Motivation

cargo-semver-checks misses parameter-type changes on non-generic functions (no function_parameter_type_changed lint), returning minor when the change is actually breaking. Run cargo-public-api unconditionally and take the higher of the two signals via max_level so removed/changed signatures are caught even when cargo-semver-checks already flagged the crate at minor.

cargo-semver-checks misses parameter-type changes on non-generic functions
(no function_parameter_type_changed lint), returning minor when the change
is actually breaking. Run cargo-public-api unconditionally and take the
higher of the two signals via max_level so removed/changed signatures are
caught even when cargo-semver-checks already flagged the crate at minor.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.42%. Comparing base (a1da9fc) to head (1c632e1).
⚠️ Report is 75 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2072      +/-   ##
==========================================
- Coverage   73.44%   73.42%   -0.02%     
==========================================
  Files         465      465              
  Lines       77949    77949              
==========================================
- Hits        57248    57233      -15     
- Misses      20701    20716      +15     
Components Coverage Δ
libdd-crashtracker 65.49% <ø> (+0.01%) ⬆️
libdd-crashtracker-ffi 37.68% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 87.14% <ø> (ø)
libdd-data-pipeline-ffi 77.03% <ø> (ø)
libdd-common 79.89% <ø> (ø)
libdd-common-ffi 74.41% <ø> (ø)
libdd-telemetry 73.37% <ø> (ø)
libdd-telemetry-ffi 31.36% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 76.17% <ø> (-0.05%) ⬇️
libdd-profiling 81.70% <ø> (+0.01%) ⬆️
libdd-profiling-ffi 64.79% <ø> (ø)
libdd-sampling 97.41% <ø> (ø)
datadog-sidecar 34.59% <ø> (-0.03%) ⬇️
datdog-sidecar-ffi 8.61% <ø> (ø)
spawn-worker 48.86% <ø> (ø)
libdd-tinybytes 93.80% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 87.30% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 89.21% <ø> (ø)
libdd-tracer-flare 86.88% <ø> (ø)
libdd-log 74.83% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 74.43% (-0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0ed1b5e | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.88 MB 7.88 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 85.88 MB 85.88 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 97.09 MB 97.09 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.61 MB 10.61 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 25.45 MB 25.45 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 88.04 KB 88.04 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 184.55 MB 184.55 MB -0% (-8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 945.16 MB 945.16 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.32 MB 8.32 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 88.04 KB 88.04 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 24.61 MB 24.61 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 49.02 MB 49.02 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 22.05 MB 22.05 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 89.42 KB 89.42 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 188.58 MB 188.58 MB +0% (+8.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 934.16 MB 934.16 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.43 MB 6.43 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 89.42 KB 89.42 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 26.42 MB 26.42 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 46.64 MB 46.64 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 76.57 MB 76.57 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.78 MB 8.78 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 92.08 MB 92.08 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.69 MB 10.69 MB 0% (0 B) 👌

@iunanua
iunanua marked this pull request as ready for review July 2, 2026 13:50
@iunanua
iunanua requested a review from a team as a code owner July 2, 2026 13:50

@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: 5e27ecfbb0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/semver-level.sh
Comment on lines +164 to +166
if grep -q "Removed items from the public API$" <<< "$PUBLIC_API_OUTPUT" \
&& ! grep -A 2 "^Removed items from the public API$" <<< "$PUBLIC_API_OUTPUT" | grep -q "^(none)$"; then
public_api_level="major"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid promoting parameter-name-only diffs to major

When cargo-semver-checks already returns minor (for example, an added public item), this new path now runs cargo-public-api and promotes any removed textual item to major. I checked .github/workflows/pr-title-semver-check.yml and .github/workflows/release-proposal-dispatch.yml; both install cargo-public-api@0.50.2, and the cargo-public-api v0.52.0 changelog says it stopped including function parameter names by default to avoid rename diffs, which means the pinned version can report a public function parameter rename as Removed+Added even though Rust callers are not broken. A PR that adds an API and renames a parameter will now be forced to major instead of the semver-checks minor result.

Useful? React with 👍 / 👎.

Comment thread scripts/semver-level.sh Outdated
Comment on lines +171 to +172
elif grep -q "Added items to the public API$" <<< "$PUBLIC_API_OUTPUT" \
&& ! grep -A 2 "^Added items to the public API$" <<< "$PUBLIC_API_OUTPUT" | grep -q "^(none)"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle cargo-public-api's Changed section

When cargo-semver-checks returns minor and the extra cargo-public-api run reports a signature diff under Changed items in the public API, this parser leaves public_api_level as none because it only inspects Removed and Added sections. I checked cargo-public-api's CLI/source and it treats changed as its own diff category (--deny=changed), so the non-generic parameter-type changes this patch is meant to catch can still be released as minor instead of major unless they happen to render as removals.

Useful? React with 👍 / 👎.

@iunanua
iunanua requested a review from a team as a code owner July 2, 2026 15:02
Comment thread scripts/semver-level.sh
@iunanua
iunanua merged commit f131ab8 into main Jul 6, 2026
59 checks passed
@iunanua
iunanua deleted the igor/versioning/semver-level-opt branch July 6, 2026 13:35
taegyunkim pushed a commit that referenced this pull request Jul 8, 2026
# What does this PR do?

Modify `semver-level.sh` to check the output of `cargo-public-api`
Upgrade `cargo-public-api` to `0.52.0`
Upgrade `cargo-semver-checks` to `0.48.0`

# Motivation

`cargo-semver-checks` misses parameter-type changes on non-generic
functions (no function_parameter_type_changed lint), returning minor
when the change is actually breaking. Run `cargo-public-api`
unconditionally and take the higher of the two signals via max_level so
removed/changed signatures are caught even when `cargo-semver-checks`
already flagged the crate at minor.

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Taegyun Kim <taegyun.kim@datadoghq.com>
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