Skip to content

Conversation

@rsoaresd
Copy link
Contributor

@rsoaresd rsoaresd commented Sep 2, 2025

Description

Currently, we only have our custom govulncheck-action enabled on wa, host-operator, member-operator, and registration-service. We need to enable it in the other repos (toolchain-e2e, toolchain-common, ...)

Why are we using our custom toolchain-cicd/govulncheck-action?

Unfortunately, govulncheck does not have a feature for ignoring the vulns. There is a feature request, but we do not know when it will be addressed. To avoid govulncheck failing in PRs, we implemented a workaround on toolchain-cicd to ignore vulnerabilities that do not have a fix available or require a higher Go version than we have.

Related PRs

codeready-toolchain/toolchain-common#490
codeready-toolchain/api#483
kubesaw/ksctl#122

Issue ticket number and link

SANDBOX-1401

Summary by CodeRabbit

  • Chores
    • Updated the vulnerability scanning workflow to a new action with a config-driven setup for more consistent runs.
    • Added a vulnerability scan configuration that temporarily silences select known advisories until a future date to reduce CI noise.

@openshift-ci openshift-ci bot requested review from fbm3307 and mfrancisc September 2, 2025 09:56
@openshift-ci openshift-ci bot added the approved label Sep 2, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 2, 2025

Walkthrough

Replaces the govulncheck GitHub Action with codeready-toolchain/toolchain-cicd/govulncheck-action@master, switches to file-based configuration using go.mod and .govulncheck.yaml, disables caching, and adds a new .govulncheck.yaml that lists three ignored vulnerabilities with silence-until dates and reference links.

Changes

Cohort / File(s) Summary
CI workflow update
.github/workflows/govulncheck.yml
Switches action from golang/govulncheck-action@v1 to codeready-toolchain/toolchain-cicd/govulncheck-action@master; replaces input-based config with file-based (go-version-file: go.mod, config: .govulncheck.yaml); removes explicit package path; disables cache.
Govulncheck configuration
.govulncheck.yaml
Adds configuration with ignored-vulnerabilities: GO-2025-3563, GO-2025-3750, GO-2025-3751; each includes silence-until 2025-10-02 and reference URLs; includes comments on affected/fixed versions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop through checks in nightly light,
New warren, same vigilant bite.
A yaml leaf to hush the breeze,
Three whispers quiet in the trees.
Pipelines thump—no cache to keep—
Onward I bound; the code can sleep. 🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 0

🧹 Nitpick comments (7)
.govulncheck.yaml (3)

17-17: Fix duplicated word in comment.

"Fixed in: Fixed in:" → "Fixed in:".

Apply:

-  # Fixed in: Fixed in: net/http@go1.23.10
+  # Fixed in: net/http@go1.23.10

18-20: Keep field order consistent across entries.

Use the same key order as earlier items (id, silence-until, info).

-  - id: GO-2025-3751
-    info: https://pkg.go.dev/vuln/GO-2025-3751
-    silence-until: 2025-10-02
+  - id: GO-2025-3751
+    silence-until: 2025-10-02
+    info: https://pkg.go.dev/vuln/GO-2025-3751

1-20: Add missing newline at end of file.

Fixes YAML lint error.

   - id: GO-2025-3751
     silence-until: 2025-10-02
     info: https://pkg.go.dev/vuln/GO-2025-3751
+ 
.github/workflows/govulncheck.yml (4)

22-26: Add minimal token permissions (defense-in-depth).

Limit GITHUB_TOKEN scope for this job.

   govulncheck:
     name: govulncheck
     runs-on: ubuntu-24.04
+    permissions:
+      contents: read

22-26: Consider scheduled runs to catch new vulns outside PRs.

Add a weekly schedule on master.

 on:
   pull_request:
     branches:
       - master
+  schedule:
+    - cron: '0 3 * * 1'

26-26: Add missing newline at end of file.

Fixes YAML lint error.

-        config: .govulncheck.yaml
+        config: .govulncheck.yaml
+

24-26: Remove redundant setup-go and enable caching

  • govulncheck-action automatically installs Go based on go-version-file, so you can remove the preceding actions/setup-go step to avoid duplicate installs. (github.com)
  • The cache input defaults to true; consider setting cache: true to speed up subsequent CI runs without sacrificing reproducibility. (go.googlesource.com)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ad10d98 and 2a8f901.

📒 Files selected for processing (2)
  • .github/workflows/govulncheck.yml (1 hunks)
  • .govulncheck.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.govulncheck.yaml

[error] 20-20: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/govulncheck.yml

[error] 26-26: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build & push operator bundles for e2e tests
  • GitHub Check: Build & push Developer Sandbox UI image for UI e2e tests
🔇 Additional comments (2)
.govulncheck.yaml (1)

6-20: Confirm external action schema and Go version

  • No local govulncheck-action directory in this repo; verify that the external codeready-toolchain/toolchain-cicd govulncheck-action supports an ignored-vulnerabilities list with fields id, silence-until (YYYY-MM-DD) and info.
  • go.mod uses Go 1.22.0, which is below the fixed versions for GO-2025-3563 (1.23.8), GO-2025-3750 and GO-2025-3751 (1.23.10), so these silences are justified.
.github/workflows/govulncheck.yml (1)

22-22: Pin action to a tag or commit SHA (avoid @master).

Reduces supply-chain risk and unexpected breakages.

-      uses: codeready-toolchain/toolchain-cicd/govulncheck-action@master
+      # Pin to a released tag or commit SHA
+      uses: codeready-toolchain/toolchain-cicd/govulncheck-action@<tag-or-sha>
⛔ Skipped due to learnings
Learnt from: rsoaresd
PR: codeready-toolchain/toolchain-e2e#1181
File: .github/workflows/publish-sandbox-ui-for-ui-e2e-tests.yml:70-71
Timestamp: 2025-08-05T11:01:26.390Z
Learning: For codeready-toolchain organization repositories, the team prefers to use master branch references for their internal toolchain-cicd actions rather than pinning to specific commit SHAs, prioritizing ease of maintenance and automatic updates over the additional security of version pinning.

@openshift-ci
Copy link

openshift-ci bot commented Sep 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fbm3307, rsoaresd, xcoulon

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:
  • OWNERS [fbm3307,rsoaresd,xcoulon]

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

@rsoaresd
Copy link
Contributor Author

rsoaresd commented Sep 2, 2025

/retest

flaky test

    host.go:2005: failed to find Space
        
    space.go:135: 
        	Error Trace:	/go/src/github.com/codeready-toolchain/toolchain-e2e/testsupport/space/space.go:135
        	            				/go/src/github.com/codeready-toolchain/toolchain-e2e/testsupport/space/space.go:121
        	            				/go/src/github.com/codeready-toolchain/toolchain-e2e/test/e2e/parallel/nstemplatetier_test.go:284
        	            				/go/src/github.com/codeready-toolchain/toolchain-e2e/test/e2e/parallel/nstemplatetier_test.go:129
        	Error:      	Received unexpected error:
        	            	context deadline exceeded
        	Test:       	TestUpdateNSTemplateTier
    clean.go:87: skipping object cleanup, test=TestUpdateNSTemplateTier failedTimestamp=Sep  2 11:26:44.045

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 3, 2025

@rsoaresd rsoaresd merged commit 0b83c24 into codeready-toolchain:master Sep 3, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants