Skip to content

fix(ROSAENG-67571): migrate OSL severity labels to HCC-aligned values - #975

Merged
openshift-merge-bot[bot] merged 3 commits into
masterfrom
agent/ROSAENG-67571-67571-migrate-severity-labels
Sep 24, 2026
Merged

openshift-merge-bot[bot] merged 3 commits into
masterfrom
agent/ROSAENG-67571-67571-migrate-severity-labels

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Migrate all deprecated OCM Service Log severity labels in osdctl to the new HCC-aligned values, ahead of the Phase 2 enforcement cutoff (28 September 2026).

Changes

  • cmd/cluster/support/post.go: Updated InternalServiceLogSeverity constant from "Warning" to "Moderate" — this is used when posting internal service logs for limited support evidence
  • cmd/servicelog/post.go: Updated two hardcoded JSON templates (internal-only and pre-canned override templates) from "severity": "Info" to "severity": "Low"
  • Test files: Updated all test data in cmd/servicelog/common_test.go, cmd/servicelog/post_test.go, and cmd/hcp/transitiontoeus/transitiontoeus_test.go to use the new severity values

Severity label mapping

Old (deprecated) New (HCC-aligned)
Major Important
Warning Moderate
Info Low

No references to Major, Warning, or Info remain in osdctl service log code paths after this change.

The OCM SDK dependency is already at v0.1.507 (>= v0.1.505), which includes the typed severity constants (SeverityImportant, SeverityModerate, SeverityLow).

Testing

  • Ran go test for all affected packages (cmd/cluster/support, cmd/servicelog, cmd/hcp/transitiontoeus) — all tests pass
  • Ran go vet on affected packages — no issues
  • Verified no deprecated severity labels remain via grep across the codebase

Related to https://redhat.atlassian.net/browse/ROSAENG-67571

Post-script verification

  • Branch is not main/master (agent/ROSAENG-67571-67571-migrate-severity-labels)
  • Secret scan passed (gitleaks — eee6ca84887165d0604d2d1e9d01ef42eb98c00f..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

Replace deprecated OCM Service Log severity labels with new
HCC-aligned values ahead of the Phase 2 enforcement cutoff
(28 September 2026):

- Warning -> Moderate (cmd/cluster/support/post.go)
- Info -> Low (cmd/servicelog/post.go hardcoded templates)

Update all test data in servicelog, cluster/support, and
hcp/transitiontoeus packages to use the new severity values.

After this change, no references to deprecated severity labels
(Major, Warning, Info) remain in osdctl service log code paths.

Related to ROSAENG-67571
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 5445c5c5-1b9e-4b9c-9584-0bf375ec75d5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@openshift-ci
openshift-ci Bot requested review from clcollins and typeid September 24, 2026 11:05
@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 24, 2026
@openshift-ci

openshift-ci Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Hi @fullsend-ai-coder[bot]. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@RaphaelBut

Copy link
Copy Markdown
Contributor

/fs-fix Use the ocm sdk constants instead of string literals
The OCM SDK dependency is already at v0.1.507 (>= v0.1.505), which includes the typed severity constants (SeverityImportant, SeverityModerate, SeverityLow).

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 11:11 AM UTC · Completed 11:29 AM UTC

Commit: ef8a107 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.29

Replace hardcoded severity string literals ("Moderate", "Low") with
typed constants from the OCM SDK servicelogs/v1 package
(slv1.SeverityModerate, slv1.SeverityLow). The SDK dependency is
already at v0.1.507 which includes these constants.

- cmd/cluster/support/post.go: InternalServiceLogSeverity now uses
  slv1.SeverityModerate constant
- cmd/servicelog/post.go: internal-only and pre-canned templates set
  severity via slv1.SeverityLow after JSON parsing
- Test files: Go struct severity fields use string(slv1.SeverityLow)
  while JSON test fixtures remain as string literals (API responses)

Addresses #975
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Replaced all hardcoded severity string literals with OCM SDK typed constants (slv1.SeverityModerate, slv1.SeverityLow) across source and test files, per human instruction

Fixed (5):

  1. Use OCM SDK constants instead of string literals for severity values (cmd/cluster/support/post.go): Changed InternalServiceLogSeverity constant from string literal "Moderate" to slv1.SeverityModerate, using the typed constant from the OCM SDK servicelogs/v1 package
  2. Use OCM SDK constants instead of string literals for severity values (cmd/servicelog/post.go): Removed hardcoded severity from JSON templates and set severity programmatically via string(slv1.SeverityLow) after template parsing, for both internal-only and pre-canned override templates
  3. Use OCM SDK constants instead of string literals for severity values in tests (cmd/servicelog/post_test.go): Updated expected severity in Go struct literals to use string(slv1.SeverityLow) instead of string literal
  4. Use OCM SDK constants instead of string literals for severity values in tests (cmd/servicelog/common_test.go): Updated clusterMessage severity fields to use string(slv1.SeverityLow) instead of string literal
  5. Use OCM SDK constants instead of string literals for severity values in tests (cmd/hcp/transitiontoeus/transitiontoeus_test.go): Updated sentMessage severity fields to use string(slv1.SeverityLow) instead of string literal; JSON response fixtures kept as string literals since they simulate API responses

Tests: passed

CI inspections (2):

  1. tide (unrelated, pending): Prow tide status check is pending, unrelated to code changes
  2. CodeRabbit (passing, success): CodeRabbit review check passed
Decision points
  • How to handle severity in JSON template strings (alternatives: Use fmt.Sprintf to interpolate the constant into the JSON template, Remove severity from JSON template and set it programmatically after parsing; rationale: Setting severity programmatically after parseTemplate is cleaner than string interpolation in JSON, avoids format string complexity, and makes the constant usage explicit)
  • Whether to replace severity strings in JSON test fixtures (alternatives: Replace all severity strings with SDK constants, Only replace Go struct fields, keep JSON fixtures as string literals; rationale: JSON test fixtures simulate API responses and are naturally string-based; Go struct fields are the appropriate place for typed constants)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@RaphaelBut

Copy link
Copy Markdown
Contributor

@coderabbitai review

@RaphaelBut

Copy link
Copy Markdown
Contributor

/fs-review

@RaphaelBut

Copy link
Copy Markdown
Contributor

/test all

@RaphaelBut

Copy link
Copy Markdown
Contributor

/retest

2 similar comments
@RaphaelBut

Copy link
Copy Markdown
Contributor

/retest

@RaphaelBut

Copy link
Copy Markdown
Contributor

/retest

@RaphaelBut

RaphaelBut commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

/fs-fix There is wrong formatting here failing ci, please fix

 	EvidenceFlag                                         = "evidence"
-	InternalServiceLogSeverity  slv1.Severity             = slv1.SeverityModerate
+	InternalServiceLogSeverity    slv1.Severity          = slv1.SeverityModerate
 	InternalServiceLogServiceName                        = "SREManualAction"

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 1:44 PM UTC · Completed 2:02 PM UTC

Commit: dcf25e0 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.35

Apply gofmt formatting to InternalServiceLogSeverity constant
declaration to fix tab alignment with the typed constant annotation.

Addresses #975
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 2 (human-triggered)

Fixed gofmt alignment issue in cmd/cluster/support/post.go that was causing ci/prow/format CI failure. The InternalServiceLogSeverity typed constant had incorrect tab spacing around the type annotation.

Fixed (1):

  1. Wrong formatting in InternalServiceLogSeverity constant declaration failing ci/prow/format (cmd/cluster/support/post.go): Applied gofmt to fix tab alignment of the InternalServiceLogSeverity typed constant declaration in the const block

Tests: failed

CI inspections (5):

  1. ci/prow/format (pr-related, failure): gofmt check failed due to incorrect tab alignment in the typed constant declaration for InternalServiceLogSeverity in cmd/cluster/support/post.go Applied gofmt formatting to fix the alignment
  2. ci/prow/build (passing, success): Build passed
  3. ci/prow/lint (passing, success): Lint passed
  4. ci/prow/test (passing, success): Tests passed
  5. ci/prow/verify-docs (passing, success): Docs verification passed
Decision points
  • Used gofmt to determine correct formatting (alternatives: Manual whitespace adjustment, Run gofmt -w on the file; rationale: gofmt is the authoritative Go formatter and matches what ci/prow/format checks)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@RaphaelBut

Copy link
Copy Markdown
Contributor

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 24, 2026
@openshift-ci

openshift-ci Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@fullsend-ai-coder[bot]: 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.

@dustman9000

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 24, 2026
@openshift-ci

openshift-ci Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dustman9000, fullsend-ai-coder[bot]

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 openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 24, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit e8d0c46 into master Sep 24, 2026
58 checks passed
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. ready-for-review Triggers review agent dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants