Skip to content

ci: publish build provenance in the metrics payload (schema v4) - #4413

Merged
sombraSoft merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:build-provenance
Aug 11, 2026
Merged

sombraSoft merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:build-provenance

Conversation

@migueldalberto

Copy link
Copy Markdown
Contributor

Why

The metrics payload identified a build by its ORFS superproject commit alone. Nightly pipelines repoint tools/OpenROAD away from the pinned submodule, so that commit does not describe what was built — and the metrics backend was attributing those submodule-HEAD results to a commit that pins something else.

What

--provenanceFile: a JSON file carrying the jenkins-ci shared-library version and the submodule commits captured in the build workspace.

{
  "jenkins_library": { "ref": "or-v2.3.8", "sha": "…" },
  "submodules": [
    { "path": "tools/OpenROAD", "sha": "…", "pinned_sha": "…",
      "describe": "v2.0-20581-gaabdb99ea", "overridden": true }
  ]
}

It has to be produced in the build workspace and passed in, not computed here. This script runs from the reporting workspace, which is a fresh submodule-pinned checkout — reading the SHAs locally would report the pinned commit for a build that used something else, i.e. exactly backwards for every nightly.

Version selection

job name provenance version
yes yes 4
yes no / malformed 3
no either 2

A run that could not capture its submodules stays on v3 rather than emitting a v4 message the backend will reject — the backend requires every v4 key, since an empty submodule list is indistinguishable from "capture failed" and would make a nightly look commit-representative.

A missing or unreadable provenance file warns and degrades to v3. Losing the whole metrics report over missing provenance is the worse outcome.

v1 fallback

Provenance is mirrored onto every message of the oversized-payload per-design fallback. They all resolve to the same build and the backend upserts components by path, so N copies converge on one set of rows. Omitting it would make an oversized nightly look like a build with no overrides.

Incidental fix

A relative --provenanceFile is now resolved against the caller's directory. The module-level os.chdir to flow/ would otherwise silently reinterpret any relative path passed on the command line — found while testing, since it made a correct invocation from the workspace root fail open to v3.

Coordination

Backward-compatible on its own — without --provenanceFile the payload is byte-for-byte what it is today. jenkins-ci gates the flag by grepping this file for it, so either merge order is safe. Consumer must be deployed on v4 before v4 messages are produced, or they park as unsupported-schema.

@migueldalberto migueldalberto self-assigned this Aug 11, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for build provenance (schema v4) in the metadata upload script. It adds a --provenanceFile argument, loads and validates the provenance JSON, and updates the payload construction and publishing functions to include this data. A review comment points out a potential crash (AttributeError) if the loaded JSON file is valid JSON but does not represent a dictionary, as data.get() would be called on a non-dictionary object and the error is not caught. Adding a type check for data is recommended to ensure a safe fallback to v3.

Comment thread flow/util/uploadMetadata.py Resolved
The payload identified a build by its ORFS superproject commit alone. Nightly
pipelines repoint tools/OpenROAD away from the pinned submodule, so that commit
does not describe what was built.

Add --provenanceFile, carrying the jenkins-ci shared-library version and the
submodule commits captured in the build workspace. It has to be produced there
and passed in: the reporting workspace is a fresh submodule-pinned checkout, so
reading the SHAs here would report the pinned commit for a build that used
something else. Passed as a file rather than argv so the JSON never has to
survive shell quoting.

Emit v4 when both a job name and provenance are present, v3 when provenance is
missing or malformed, v2 when there is no job name. The backend requires every
v4 key, so a run that could not capture its submodules must stay on v3 rather
than emit a message that will be rejected.

Mirror provenance onto the oversized-payload v1 fallback as well — all its
messages resolve to the same build and the backend upserts components by path,
so omitting it would make an oversized nightly look like a build with no
overrides.

Also resolve a relative --provenanceFile against the caller's directory: the
chdir to flow/ at import time would otherwise silently reinterpret it.

Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
@openroad-ci

openroad-ci commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch. Advisory — results are log-only and do not affect build status. The authoritative QoR gate remains the local rules-file check.

Commit 11c10ea · Jenkins build #2 · Baseline: build

61 design(s) checked — 0 with regression(s), 0 without a comparable baseline.
Design Variant Verdict local vs inline passed / failed / missing
asap7/aes base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-block base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-mbff base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/cva6 base ✅ pass ✅ MATCH 12 / 0 / 0
asap7/ethmac base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ethmac_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd-ccs base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-alu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-cpu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i-mock-sram base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/uart base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes-hybrid base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/uart-blocks base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/aes base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/i2c-gpio-expander base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/spi base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/aes base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane133 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane136 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/black_parrot base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_be_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_fe_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_multi_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/dynamic_node base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/mempool_group base ✅ pass ✅ MATCH 12 / 0 / 0
nangate45/swerv base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/tinyRocket base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/chameleon base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/microwatt base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0

@sombraSoft
sombraSoft merged commit f9ec54a into The-OpenROAD-Project:master Aug 11, 2026
9 checks passed
@sombraSoft
sombraSoft deleted the build-provenance branch August 11, 2026 21:14
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.

3 participants