Skip to content

Conversation

@sosiouxme
Copy link
Member

@sosiouxme sosiouxme commented Jan 22, 2026

When a symptom matches a job, we want to write label files back to the
prow job bucket artifacts so they are visible when we look at the job.
This implements that functionality in a centralized, reusable way.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added REST API endpoints for managing job run labels with full CRUD operations (create, read, update, delete).
    • Enhanced data retrieval to provide matched text content alongside match indicators.
    • Implemented infrastructure to persist labeled symptom data to cloud storage for job runs.
  • Refactor

    • Reorganized label and symptom data structures for improved organization and clarity.

✏️ Tip: You can customize this high-level summary in your review settings.

@openshift-ci-robot
Copy link

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 22, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 22, 2026

@sosiouxme: This pull request references TRT-2465 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

When a symptom matches a job, we want to write label files back to the
prow job bucket artifacts so they are visible when we look at the job.
This implements that functionality in a centralized, reusable way.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from deads2k and neisw January 22, 2026 22:54
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 22, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

Walkthrough

The changes restructure Label and Symptom models by introducing nested content structs (LabelContent, SymptomContent) to encapsulate core fields, update seed data to match the new structure, modify a method signature to return matched text alongside a boolean flag, and introduce new functionality for persisting job run labels to cloud storage and managing labels via a REST API client.

Changes

Cohort / File(s) Summary
Model restructuring
pkg/db/models/jobrunscan/label.go, pkg/db/models/jobrunscan/symptom.go, cmd/sippy/seed_data.go
Introduces LabelContent and SymptomContent types; Label and Symptom now embed their respective content structs alongside Metadata and other fields. Seed data updated to populate nested content structs instead of top-level fields.
API method update
pkg/api/jobartifacts/apitypes.go
Changes MatchedContent.HasMatches() bool to Matched() (string, bool) to return the first matched text and a success boolean.
Bucket persistence
pkg/componentreadiness/jobrunannotator/prow_bucket.go
Adds JobRunBucketLabel and JobRunBucketLabelContainer types with WriteJSONToBucket() method to serialize and persist labeled symptom data to GCS using SHA-256 hashed filenames. Introduces BucketLabelsPrefix constant.
Labels REST client
pkg/sippyclient/jobrunscan/labels.go
Introduces LabelsClient with List, Get, Create, Update, and Delete methods for managing job run labels via /api/jobs/labels endpoints; includes ID validation using api.ValidIdentifierRegex.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Go Error Handling ⚠️ Warning Error returned from bucketWriter.Close() at line 45 in prow_bucket.go is ignored without justification or comment, violating Go error handling guidelines. Add explanatory comment above line 45 or refactor using defer pattern to ensure ignored error has clear justification.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective: enabling writing label files to the bucket via new functionality in prow_bucket.go.
Sql Injection Prevention ✅ Passed All database queries use GORM's parameterized query syntax with placeholders rather than string concatenation, and input validation is performed on identifiers.
Excessive Css In React Should Use Styles ✅ Passed This PR contains only Go backend code with no React components, JSX, or CSS styling, making this React-focused check not applicable.
Single Responsibility And Clear Naming ✅ Passed The pull request demonstrates strong adherence to single responsibility and clear naming principles across all components with cohesive entity design and specific action-oriented methods.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 22, 2026

@sosiouxme: This pull request references TRT-2465 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

When a symptom matches a job, we want to write label files back to the
prow job bucket artifacts so they are visible when we look at the job.
This implements that functionality in a centralized, reusable way.

Summary by CodeRabbit

  • New Features

  • Added ability to persist job run labels to storage with structured paths and versioned schemas.

  • Introduced a new API client for managing job run labels with full CRUD operations.

  • Refactor

  • Reorganized internal data structures for improved label and symptom management.

  • Bug Fixes

  • Enhanced match detection to return match content alongside status indicator.

✏️ Tip: You can customize this high-level summary in your review settings.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@pkg/componentreadiness/jobrunannotator/prow_bucket.go`:
- Around line 35-41: The current WriteJsonToBucket implementation in
JobRunBucketLabel uses only path.Base(x.FileMatch) when computing the hash for
labelFile, which can lead to collisions for identical filenames in different
directories; change the hashing input to the full file path (x.FileMatch) or
another unique per-path string and regenerate labelFile accordingly so the
object key (x.JobRunPath + BucketLabelsPrefix + labelFile) is unique per
original path; update any uses of baseName in labelFile construction to use the
new hashed value while keeping the readable components (x.Label.ID and base
filename) if desired.

In `@pkg/sippyclient/jobrunscan/labels.go`:
- Around line 60-75: In LabelsClient.Update, guard against a path vs payload ID
mismatch by validating that the incoming id argument equals label.ID before
calling sc.client.Put; if they differ, return a clear error (e.g., "mismatched
label ID: path id %s vs payload id %s") instead of proceeding, so the PUT to
path "/api/jobs/labels/%s" always matches the payload ID used in the request.

@sosiouxme sosiouxme force-pushed the 20260116-TRT-2465-label-files-in-bucket branch from 8bd56a5 to f5ac60b Compare January 22, 2026 23:19
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 22, 2026

@sosiouxme: This pull request references TRT-2465 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

When a symptom matches a job, we want to write label files back to the
prow job bucket artifacts so they are visible when we look at the job.
This implements that functionality in a centralized, reusable way.

Summary by CodeRabbit

  • New Features

  • Persist job-run labels to storage using a versioned, structured format.

  • New API client to manage job-run labels (List/Get/Create/Update/Delete).

  • Refactor

  • Reorganized label and symptom data shapes for clearer separation of content and metadata.

  • Bug Fixes

  • Match detection now returns the matched text along with a success indicator.

✏️ Tip: You can customize this high-level summary in your review settings.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@sosiouxme sosiouxme force-pushed the 20260116-TRT-2465-label-files-in-bucket branch from f5ac60b to 200405b Compare January 23, 2026 19:02
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 23, 2026

@sosiouxme: This pull request references TRT-2465 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

When a symptom matches a job, we want to write label files back to the
prow job bucket artifacts so they are visible when we look at the job.
This implements that functionality in a centralized, reusable way.

Summary by CodeRabbit

  • New Features

  • Persist job-run labels to storage using a versioned, structured format.

  • New API client to manage job-run labels (List/Get/Create/Update/Delete).

  • Refactor

  • Reorganized label and symptom data shapes to separate content from metadata.

  • Bug Fixes

  • Match detection now returns the matched text plus a success flag.

  • Chores

  • Added package configuration to pin selected transitive dependency resolutions.

✏️ Tip: You can customize this high-level summary in your review settings.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@sippy-ng/package.json`:
- Around line 115-119: The package.json "overrides" entries (nth-check, postcss,
webpack-dev-server) were added but package-lock.json wasn't regenerated; run npm
install to update package-lock.json so the overrides are applied, verify the
lockfile now shows nth-check ^2.1.1, postcss ^8.4.31, and webpack-dev-server
^4.15.2, and commit the updated lockfile; additionally add an "engines" field in
package.json requiring npm >= 8.3.0 to ensure the overrides feature is
supported.

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e

smg247 and others added 3 commits January 23, 2026 14:43
When a symptom matches a job, we want to write label files back to the
prow job bucket artifacts so they are visible when we look at the job.
This implements that functionality in a centralized, reusable way.

prow_bucket.go is the code for writing to the bucket.
Each label is written as a json file; I refactored the label/symptom
types a bit in order to separate out the parts to include there.
In order to get the full label definition that the cloud function wants
to write into the job bucket, it needs a client to read it.
@sosiouxme sosiouxme force-pushed the 20260116-TRT-2465-label-files-in-bucket branch from 200405b to 0951214 Compare January 23, 2026 21:23
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 23, 2026

@sosiouxme: This pull request references TRT-2465 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

When a symptom matches a job, we want to write label files back to the
prow job bucket artifacts so they are visible when we look at the job.
This implements that functionality in a centralized, reusable way.

Summary by CodeRabbit

Release Notes

  • New Features

  • Added REST API endpoints for managing job run labels with full CRUD operations (create, read, update, delete).

  • Enhanced data retrieval to provide matched text content alongside match indicators.

  • Implemented infrastructure to persist labeled symptom data to cloud storage for job runs.

  • Refactor

  • Reorganized label and symptom data structures for improved organization and clarity.

✏️ Tip: You can customize this high-level summary in your review settings.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 24, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petr-muller, sosiouxme

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 24, 2026

@sosiouxme: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 4017313 into openshift:main Jan 24, 2026
8 checks passed
@sosiouxme sosiouxme deleted the 20260116-TRT-2465-label-files-in-bucket branch January 24, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants