Skip to content

CI: accept --runID in uploadMetadata, emit run_id on Pub/Sub#4169

Open
openroad-ci wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:ci-run-id
Open

CI: accept --runID in uploadMetadata, emit run_id on Pub/Sub#4169
openroad-ci wants to merge 1 commit intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:ci-run-id

Conversation

@openroad-ci
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a --runID CLI argument to flow/util/uploadMetadata.py
  • Includes run_id as a top-level field in every Pub/Sub message published by the script

Motivation

Each invocation of orfsUploadMetadata (in the jenkins-ci shared library) publishes one Pub/Sub message per (platform, design, variant) tuple. There is currently no shared identifier tying those messages together as a single CI run — existing fields (build_id, pipeline_id, commit_sha) are either sequential integers or not globally unique.

The companion jenkins-ci change generates a UUID per invocation and passes it here via --runID. Downstream consumers (e.g. the Palantir MessageConsumerWorker) can then group records by run_id.

Rollout

This PR is backwards-compatible:

  • Old Groovy + new Python → args.runID is None, payload gets "run_id": null. Works.
  • New Groovy + new Python → works as intended.

This PR should merge before the matching jenkins-ci PR to avoid a broken window where the updated Groovy passes --runID to a Python script that doesn't yet know about it.

Adds a per-run UUID (provided by the Jenkins shared library) to every
Pub/Sub message so downstream consumers can group all (platform, design,
variant) records belonging to a single CI invocation.

Signed-off-by: Miguel Pedro <miguel.pedro@precisioninno.com>
Copy link
Copy Markdown

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

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 a new --runID command-line argument to the metadata upload utility and includes it in the Pub/Sub payload. Feedback suggests moving the argument definition to the general arguments section for better organization and ensuring the run_id is also added to the Firestore payload to maintain data consistency across backends.

parser.add_argument(
"--pubsubCred", type=str, help="Service account credentials file for Pub/Sub"
)
parser.add_argument("--runID", type=str, help="Unique identifier for this CI run")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The --runID argument is added within the Pub/Sub specific arguments block. However, the motivation describes it as a general identifier for the CI run (similar to buildID or pipelineID). Consider moving it to the general arguments section (near line 29). Furthermore, while this PR updates the Pub/Sub payload, it appears to miss adding run_id to the Firestore upload_data payload (around line 63). To ensure data consistency across both backends while Firestore is still supported, please include run_id in the Firestore document as well.

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.

2 participants