Skip to content

fix(ci): handle proc-macro crates during semver check - #2410

Open
hoolioh wants to merge 3 commits into
mainfrom
julio/fix-proc-macro-crates
Open

fix(ci): handle proc-macro crates during semver check#2410
hoolioh wants to merge 3 commits into
mainfrom
julio/fix-proc-macro-crates

Conversation

@hoolioh

@hoolioh hoolioh commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

  1. libdd-ipc-macros introduced a new crate type and cargo-semver-check tool is unable to handle these type of crates properly. This PR extracts that information from the crate's metadata and select the proper to tool to inspect the changes, in this case cargo-public-api.
  2. Fixes a race problem when labels are applied to PRs where a job that is supposed to be skipped can be run in the interim betweewn pr creating and label setting.

@hoolioh
hoolioh requested review from a team as code owners August 25, 2026 11:48

@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: 696f06e2cc

ℹ️ 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 Outdated
Comment thread scripts/semver-level.sh
Comment on lines +207 to +208
elif ! $has_lib && ! $has_proc_macro; then
log_verbose "Skipping cargo-public-api: $crate has no library or proc-macro target"

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 Treat removal of a library target as a major change

If an existing published crate removes or converts its library target so the current metadata contains only a binary or another unrecognized target kind, this condition skips both comparison tools. The function then falls through from none to patch, even though the crate's entire former public library API was removed; the release workflow consumes that result for cargo release version and can produce an undersized version bump. Target selection needs to account for the baseline target kinds rather than only the current checkout.

Useful? React with 👍 / 👎.

Comment on lines +36 to +37
if gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}" \
--jq '.labels[].name' | grep -qx 'skip-pr-title-semver-check'; 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 Distinguish API errors from an absent skip label

When gh api fails because of a transient GitHub error, rate limiting, or an authentication problem, this pipeline has a nonzero status but is inside an if, so set -e does not terminate the step and execution enters the else branch. The workflow then reports skip=false even for a labeled PR and runs the checks that the label is meant to bypass, potentially leaving automated release PRs red. Capture and validate the API response separately so only a successful request without the label selects this branch.

Useful? React with 👍 / 👎.

Comment thread scripts/semver-level.sh Outdated
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Aug 25, 2026

Copy link
Copy Markdown

Tests

All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 76.68% (+0.09%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e21eaf6 | Docs | View more details | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Aug 25, 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.a 89.52 MB 89.52 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.26 MB 8.26 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.70 MB 100.70 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.06 MB 11.06 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 26.64 MB 26.64 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 94.96 KB 94.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 180.73 MB 180.73 MB -0% (-8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 772.85 MB 772.85 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.73 MB 8.73 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 94.96 KB 94.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 25.65 MB 25.65 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 51.09 MB 51.09 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.22 MB 23.22 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 96.45 KB 96.45 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 185.62 MB 185.66 MB +.02% (+40.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 759.09 MB 759.09 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.74 MB 6.74 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 96.45 KB 96.45 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 27.59 MB 27.59 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 48.62 MB 48.62 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 79.78 MB 79.78 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.16 MB 9.16 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 95.42 MB 95.42 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.17 MB 11.17 MB 0% (0 B) 👌

@pr-commenter

pr-commenter Bot commented Aug 25, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-08-25 15:18:13

Comparing candidate commit e21eaf6 in PR branch julio/fix-proc-macro-crates with baseline commit 69df7ed in branch main.

Found 0 performance improvements and 3 performance regressions! Performance is the same for 149 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:otlp/e2e_json/1x1000

  • 🟥 execution_time [+329.011µs; +331.105µs] or [+7.939%; +7.990%]

scenario:otlp/encode_json/1x1000

  • 🟥 execution_time [+351.500µs; +352.000µs] or [+19.548%; +19.576%]

scenario:profile_add_sample_frames_x1000

  • 🟥 execution_time [+201.109µs; +202.009µs] or [+5.026%; +5.049%]

Candidate

Omitted due to size.

Baseline

Omitted due to size.

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.

1 participant