Skip to content

Sync gotests workflow across all needed repos#131

Merged
joselsegura merged 1 commit into
RedHatInsights:masterfrom
joselsegura:sync-gotest
May 5, 2026
Merged

Sync gotests workflow across all needed repos#131
joselsegura merged 1 commit into
RedHatInsights:masterfrom
joselsegura:sync-gotest

Conversation

@joselsegura
Copy link
Copy Markdown
Contributor

@joselsegura joselsegura commented May 5, 2026

Description

Adding an example of gotests.yaml usage and syncing it to the Go-based repos fleet

Fixes #CCXDEV-15356

Type of change

  • New feature (non-breaking change which adds functionality)
  • Configuration update

Testing steps

To be tested on each repository

@joselsegura joselsegura requested a review from a team as a code owner May 5, 2026 10:20
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 9ad85637-519b-4ce9-95c1-3fbe4d89bae1

📥 Commits

Reviewing files that changed from the base of the PR and between 9eaef29 and 3ab5ed0.

📒 Files selected for processing (2)
  • .github/sync.yml
  • workflows_examples/gotests.yaml
✅ Files skipped from review due to trivial changes (1)
  • workflows_examples/gotests.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/sync.yml

Summary by CodeRabbit

  • Chores
    • Added a CI workflow to run Go test jobs on pull requests.
    • Updated workflow synchronization so the new Go test workflow is propagated across repositories.

Walkthrough

Added a new "Go tests" GitHub Actions workflow file and registered it in .github/sync.yml so the workflow is synced into multiple RedHatInsights repositories as .github/workflows/gotests.yaml.

Changes

Go Tests Workflow Introduction

Layer / File(s) Summary
Workflow Template
workflows_examples/gotests.yaml
New GitHub Actions workflow named "Go tests" that triggers on pull_request and runs job gotests by reusing RedHatInsights/processing-tools/.github/workflows/gotests.yaml@v0.4.1.
Sync Registration
.github/sync.yml
Adds mapping workflows_examples/gotests.yamldest: .github/workflows/gotests.yaml across these RedHatInsights repositories: ccx-notification-service, ccx-notification-writer, content-service, insights-operator-gathering-conditions-service, insights-operator-utils, insights-results-aggregator-cleaner, insights-results-aggregator-exporter, insights-results-aggregator-mock, insights-results-smart-proxy, parquet-factory.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Sync gotests workflow across all needed repos' accurately and concisely describes the main change: adding and syncing the gotests workflow across repositories via configuration updates.
Description check ✅ Passed The description is directly related to the changeset, explaining the addition of a gotests.yaml example and its sync configuration across Go-based repositories, with clear issue reference and testing notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@workflows_examples/gotests.yaml`:
- Line 8: Replace the mutable tag reference in the reusable workflow usage by
pinning to the commit SHA: update the uses line that currently points to
"RedHatInsights/processing-tools/.github/workflows/gotests.yaml@v0.4.1" to use
the specific commit SHA for that release, e.g.
"RedHatInsights/processing-tools/.github/workflows/gotests.yaml@<COMMIT_SHA>",
and optionally add the original "@v0.4.1" tag as a trailing comment for
readability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 10e69b39-41d4-4112-ba62-f035f67843e9

📥 Commits

Reviewing files that changed from the base of the PR and between 40e74b5 and 9eaef29.

📒 Files selected for processing (2)
  • .github/sync.yml
  • workflows_examples/gotests.yaml


jobs:
gotests:
uses: RedHatInsights/processing-tools/.github/workflows/gotests.yaml@v0.4.1
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

GitHub Actions reusable workflow pinning commit SHA vs tag security best practices 2025 2026

💡 Result:

For GitHub Actions reusable workflows, the security best practice is to pin to a full-length commit SHA rather than a tag. This ensures immutability, preventing supply chain attacks where tags are rewritten or force-pushed to malicious commits, as seen in incidents like tj-actions/changed-files (2025) and aquasecurity/trivy-action (2026) [1][2][3]. Official GitHub documentation explicitly states: "Using the commit SHA is the safest option for stability and security" for referencing reusable workflows with syntax {owner}/{repo}/.github/workflows/{filename}@{ref} [3]. The secure use reference confirms pinning actions and workflows to full-length commit SHAs mitigates risks of backdoors or tag movement, even from verified creators [1]. Administrators can enforce SHA pinning via organization or repository policies, failing non-compliant workflows [4][1]. SHA pinning provides the highest security because SHAs reference specific, unchangeable Git commits, unlike tags which can be altered by repository owners [5][6]. Add comments like # v4.1.1 for version tracking [7][8][9]. Use tools like Dependabot or Renovate to automate updates while maintaining pins [8]. Avoid latest or unpinned refs entirely [10]. As of 2025-2026 updates, GitHub supports SHA pinning enforcement and blocking policies, with 2026 roadmap adding dependency locking [4][11]. This applies identically to reusable workflows as to actions [1][3].

Citations:


🏁 Script executed:

# Check if we can find any references to this workflow in the repository
fd -t f -e yaml -e yml | head -20

Repository: RedHatInsights/processing-tools

Length of output: 309


🌐 Web query:

RedHatInsights/processing-tools v0.4.1 tag GitHub release commit

💡 Result:

Could not determine the commit for the RedHatInsights/processing-tools v0.4.1 tag from the available sources. What I found: - The GitHub releases page for RedHatInsights/processing-tools was found, but the search results snippets did not include an entry for tag v0.4.1 or any tag-to-commit mapping details needed to answer the question [1]. - Other RedHatInsights repos reference the processing-tools pre-commit hook version bump to v0.4.0 (not v0.4.1), and include a bot-pushed commit hash for that v0.4.0 update; however, this is not the v0.4.1 tag you asked for [2]. If you want, paste the URL of the specific v0.4.1 release/tag page (or the output of git ls-remote --tags https://github.com/RedHatInsights/processing-tools.git v0.4.1), and I can map it to the exact commit hash.

Citations:


🏁 Script executed:

# Check the actual content of the file to see the full context
cat -n workflows_examples/gotests.yaml

Repository: RedHatInsights/processing-tools

Length of output: 273


Pin reusable workflow by commit SHA, not tag.

Line 8 references a mutable tag (@v0.4.1). Tags can be retargeted, so this weakens CI supply-chain integrity. Prefer pinning to an immutable commit SHA (you can keep the tag in a comment for readability).

Suggested change
 jobs:
   gotests:
-    uses: RedHatInsights/processing-tools/.github/workflows/gotests.yaml@v0.4.1
+    uses: RedHatInsights/processing-tools/.github/workflows/gotests.yaml@<full_commit_sha>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@workflows_examples/gotests.yaml` at line 8, Replace the mutable tag reference
in the reusable workflow usage by pinning to the commit SHA: update the uses
line that currently points to
"RedHatInsights/processing-tools/.github/workflows/gotests.yaml@v0.4.1" to use
the specific commit SHA for that release, e.g.
"RedHatInsights/processing-tools/.github/workflows/gotests.yaml@<COMMIT_SHA>",
and optionally add the original "@v0.4.1" tag as a trailing comment for
readability.

@joselsegura joselsegura merged commit 1ce1153 into RedHatInsights:master May 5, 2026
3 checks passed
@joselsegura joselsegura deleted the sync-gotest branch May 5, 2026 10:41
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.

4 participants