Skip to content

ci: support for jobName flag and v3 messages#4288

Open
migueldalberto wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:ci-jobname-support
Open

ci: support for jobName flag and v3 messages#4288
migueldalberto wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:ci-jobname-support

Conversation

@migueldalberto

Copy link
Copy Markdown
Contributor

Adds a --jobName argument to flow/util/uploadMetadata.py so the QoR metadata published to Pub/Sub can carry the canonical Jenkins pipeline name. When the argument is supplied, the message is emitted as schema v3 (the existing v2 structure plus a top-level job_name); when it is omitted, the script behaves exactly as before and emits v2.

This lets the palantir backend resolve the pipeline directly from job_name instead of classifying the raw BUILD_TAG with a hardcoded pattern table, so new pipelines appear on the dashboard without a backend code change.

What changed

  • New --jobName argument (defaults to None).
  • build_pipeline_payload sets payload_schema_version to 3 and adds job_name when --jobName is set; otherwise stays on 2. The backend requires a non-blank job_name for v3, so a blank value safely falls back to v2 and the legacy classifier.
  • publish_pipeline_report sets the Pub/Sub `payload_schema_version`` message attribute to match the body (3 or 2).
  • The >8 MB per-design fallback path is unchanged — it still emits v1 messages, which the backend continues to resolve via BUILD_TAG classification.

Signed-off-by: Miguel Pedro <miguel.pedro@precisioninno.com>
@migueldalberto migueldalberto self-assigned this Jun 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 a new --jobName command-line argument to uploadMetadata.py, enabling the emission of schema v3 payloads to Pub/Sub when a job name is provided. The review feedback suggests sanitizing the --jobName argument by stripping leading and trailing whitespaces. This ensures that empty or whitespace-only values do not incorrectly trigger schema v3, both when building the payload and when publishing the pipeline report.

Comment on lines +240 to +241
payload = {
"payload_schema_version": 3 if args.jobName else 2,

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.

medium

To prevent whitespace-only strings from triggering schema v3 with an invalid/empty job name, and to ensure robust handling of the --jobName argument, we should strip leading and trailing whitespaces and treat empty/whitespace-only values as None.

Suggested change
payload = {
"payload_schema_version": 3 if args.jobName else 2,
job_name = args.jobName.strip() if args.jobName else None
payload = {
"payload_schema_version": 3 if job_name else 2,

Comment on lines +251 to +252
if args.jobName:
payload["job_name"] = args.jobName

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.

medium

Use the sanitized job_name variable here to ensure consistency with the schema version check.

Suggested change
if args.jobName:
payload["job_name"] = args.jobName
if job_name:
payload["job_name"] = job_name

"""Publish a pre-encoded v2 pipeline message."""
"""Publish a pre-encoded pipeline message (v3 when --jobName is set, else v2)."""
size_kb = len(message_data) / 1024
schema_version = "3" if args.jobName else "2"

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.

medium

Sanitize args.jobName by stripping whitespace to ensure that schema_version is correctly determined as "2" if the job name is empty or whitespace-only.

    job_name = args.jobName.strip() if args.jobName else None
    schema_version = "3" if job_name else "2"

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.

1 participant