Send who requested the build in the metrics payload - #4574
migueldalberto wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for capturing build requester information by introducing --buildUserEmail and --changeAuthorEmail command-line arguments to uploadMetadata.py. It includes a helper function resolve_requester to parse and clean these fields, which are then added to the pipeline and per-design payloads. The review feedback suggests two valuable improvements: simplifying the resolve_requester function using a dictionary comprehension for cleaner code, and hoisting the resolve_requester call outside the loop in publish_v1_per_design to prevent redundant executions and improve performance.
| } | ||
| if provenance: | ||
| payload.update(provenance) | ||
| payload.update(resolve_requester(args)) |
There was a problem hiding this comment.
Calling resolve_requester(args) inside the for d in design_records: loop is redundant and inefficient because its return value does not depend on the individual design record d.
To avoid recreating the dictionary and performing string stripping on every iteration, you should resolve the requester once outside the loop and reuse it.
For example:
def publish_v1_per_design(publisher, topic_path, design_records, args, provenance=None):
...
futures = []
requester = resolve_requester(args)
for d in design_records:
...
if provenance:
payload.update(provenance)
payload.update(requester)
payload.update(d["metrics"])Adds --buildUserEmail and --changeAuthorEmail to uploadMetadata.py, sent as the top-level build_user_email and change_author_email keys on every schema version, v1 per-design fallback included. Blank values are left out. The dashboard stores them on the build and attributes the build to the user who started it, so a "my branches" view can include builds a user started by hand. They describe the build rather than the payload's shape, so they do not bump payload_schema_version. The backend must already register them as metadata before this lands: a v1 message carries metrics at its root, and an older backend would ingest the keys as metrics. Signed-off-by: Miguel Dalberto Pedro <miguel.pedro@precisioninno.com>
fcd9748 to
23a2a2c
Compare
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 9 with regression(s), 0 without a comparable baseline. ❌ asap7/aes-mbff base — 2 failing metric(s)
❌ asap7/ibex base — 4 failing metric(s)
❌ asap7/mock-cpu base — 6 failing metric(s)
❌ gt2n/gcd base — 7 failing metric(s)
❌ gt2n/jpeg base — 4 failing metric(s)
❌ ihp-sg13g2/gcd base — 10 failing metric(s)
❌ ihp-sg13g2/jpeg base — 5 failing metric(s)
❌ sky130hd/ibex base — 7 failing metric(s)
❌ sky130hs/ibex base — 2 failing metric(s)
|
Why
The QoR dashboard wants a "my branches / my builds" view (lembas#129). The only identity it has today is the commit's git author, fetched best-effort from GitHub. That misses builds a user started by hand on someone else's commit, and commits enrichment never reaches.
What
Two optional flags on
flow/util/uploadMetadata.py:--buildUserEmailbuild_user_emailBUILD_USER_EMAIL— user who started the build by hand--changeAuthorEmailchange_author_emailCHANGE_AUTHOR_EMAIL— PR author on PR buildspayload_schema_versionis unchanged.jenkins-ci passes them from
orfsUploadMetadata, probing for--buildUserEmailsupport like it does for--provenanceFile, so older ORFS branches keep uploading.