Repository navigation
Publish a metrics payload even when no design produced metrics - #4646
vvbandeira merged 4 commits into
Conversation
uploadMetadata.py used to skip the publish when no design had a metadata.json, so builds that generated no metrics never reached the QoR dashboard. It now publishes the pipeline payload with an empty designs list through the normal path, and a failed publish still exits 1. Three optional arguments describe the build on the pipeline payload: --buildTime (build_time, defaulting to now in genMetrics.py's format and emitted on every pipeline payload), --expectedDesigns (design_count) and --noMetricsReason (no_metrics_reason, only on an empty payload). v1 fallback messages are unchanged, since the backend reads their unknown root keys as metrics. Part of The-OpenROAD-Project-private/lembas#209. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
palantir reads build_time as UTC, but the default came from local time, so a build published from a machine outside UTC was dated off by its offset. A beta test from a UTC-3 machine showed the build three hours in the past. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request updates uploadMetadata.py to allow publishing empty pipeline reports when no design records are collected, introducing new command-line arguments for --buildTime, --expectedDesigns, and --noMetricsReason. It also adds a comprehensive test suite to verify these changes. The review feedback suggests improving input validation by enforcing the correct format for --buildTime and ensuring --expectedDesigns is non-negative, as well as adding a warning if --noMetricsReason is provided alongside valid design records.
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. |
|
Please address or resolve the gemini comments |
Reject a --buildTime that does not match YYYY-MM-DD HH:MM and a negative or non-integer --expectedDesigns at argument parsing, before anything is published. A blank --buildTime still defaults to now in UTC. Warn when --noMetricsReason is given but design records were collected, since the reason is then dropped. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
vvbandeira
left a comment
There was a problem hiding this comment.
Reviewed at ec5b59c. Approving; the comments below are non-blocking.
The empty payload matches what the backend accepts (build_time is always set), and the backend never uses an empty build as a baseline, so it cannot read as a passing run. Tests cover the empty case on v2/v3/v4 and a design_count larger than the designs collected.
- uploadMetadata.py:283: on the v1 fallback, --expectedDesigns is dropped silently, so an oversized build reports completeness as unknown. Leaving it off is right until the backend lists design_count as v1 metadata; a [WARN] line would make the drop visible.
- uploadMetadata.py:101-106: the backend expects a short code (e.g. no_reports_found) and drops reasons over 100 characters without an error. Suggest saying so in the help, and rejecting or warning on longer values.
- test_uploadMetadata.py: no test has a report directory without metadata.json next to one with it, or only skipped platforms. That is how a real partial or failed flow reaches the new empty publish.
- uploadMetadata.py:340-342: the v1 rationale is only true for design_count; the backend already treats build_time and no_metrics_reason as metadata on v1.
- uploadMetadata.py:44: --expectedDesigns 0 is accepted, but the backend ignores a count of 0.
- uploadMetadata.py:25-36: _build_time accepts "2026-1-5 1:3" and passes it through unpadded. Returning strptime(...).strftime(BUILD_TIME_FORMAT) would normalize it.
- uploadMetadata.py:452: a build with no records was a [WARN] and is now [INFO]. Keeping [WARN] for "no records collected" keeps it visible in log sweeps.
- uploadMetadata.py:289-293: nit, the ignored-reason warning could print at the call site instead of inside build_pipeline_payload.
Heads-up: #4574 conflicts in two places with this PR, so the second one to merge will need a rebase.
Normalize --buildTime to zero-padded fields, leave a zero --expectedDesigns off the payload since it carries no completeness claim, and drop a --noMetricsReason longer than 100 characters with a warning instead of sending a value that would be discarded. Warnings about an ignored reason now print at the call site, a build with no records logs at WARN again, and the v1 fallback warns when it drops --expectedDesigns. Correct the v1 fallback docstring: only design_count would be read as a metric there. Add tests for report directories without metadata.json, builds with only skipped platforms, and the v1 fallback warning. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
|
Thanks for the review. I've addressed the eight points in a337ac6:
|
222f133
into
The-OpenROAD-Project:master
Summary
flow/util/uploadMetadata.pyused to skip the publish when no design produced ametadata.json. It only printed a warning, so those builds never reached the QoR dashboard. With this change it publishes the pipeline payload with"designs": [], so the dashboard can list the build and label it as having no metrics.Contract
design_recordsis empty, the pipeline payload (v2/v3/v4) goes out with"designs": []through the normalpublish_pipeline_reportpath. A failed publish still exits 1. INFO lines say that an empty (no-metrics) report is being published and that it was published.--buildTime: sets root keybuild_timeon every pipeline payload, empty or not. It defaults todatetime.now().strftime("%Y-%m-%d %H:%M"), the same formatgenMetrics.pyuses forrun__flow__generate_date.--expectedDesigns N: sets root keydesign_count: N. palantir already reads this key.--noMetricsReason REASON: sets root keyno_metrics_reason, only whendesignsis empty and the value is non-blank (whitespace is trimmed).resolve_schema_versionis unchanged. An invalid provenance file still drops v4 to v3, with or without designs.MetadataKeysas a metric, so new keys there would show up as bogus metrics. An empty build never takes the v1 path anyway, since its payload is far below the size cap.