Skip to content

refactor(tools): extract tools/retest into independent Go module#19401

Draft
davdhacs wants to merge 1 commit intomasterfrom
davdhacs/retest-independent-module
Draft

refactor(tools): extract tools/retest into independent Go module#19401
davdhacs wants to merge 1 commit intomasterfrom
davdhacs/retest-independent-module

Conversation

@davdhacs
Copy link
Contributor

@davdhacs davdhacs commented Mar 12, 2026

Description

tools/retest only depends on go-github and testify, with no imports from the main github.com/stackrox/rox module. Extracting it into its own Go module means:

  • Its go.sum contains only 6 dependencies instead of the full monorepo's ~1000+
  • Removes go-github/v60 from the root go.mod (no other code imports it)

Updates retest_periodic.yml to use tools/retest/go.mod for go-version-file and tools/retest/go.sum for cache-dependency-path.

Partially generated by AI.

Testing and quality

How I validated my change

  • go build ./... and go test ./... pass in tools/retest/ as an independent module
  • No other Go files in the repo import go-github/v60
  • retest_periodic.yml sparse checkout already includes tools/retest

@openshift-ci
Copy link

openshift-ci bot commented Mar 12, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The go version in tools/retest/go.mod is set to 1.25.5, which is not a valid released Go version; consider aligning it with the root module’s Go version or the CI Go version used in this repo.
  • If save: false for .github/actions/cache-go-dependencies is intended as a permanent default for these workflows, it may be clearer to set this as the default inside the reusable action rather than repeating it across individual jobs.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `go` version in `tools/retest/go.mod` is set to `1.25.5`, which is not a valid released Go version; consider aligning it with the root module’s Go version or the CI Go version used in this repo.
- If `save: false` for `.github/actions/cache-go-dependencies` is intended as a permanent default for these workflows, it may be clearer to set this as the default inside the reusable action rather than repeating it across individual jobs.

## Individual Comments

### Comment 1
<location path="tools/retest/go.mod" line_range="3" />
<code_context>
+module github.com/stackrox/rox/tools/retest
+
+go 1.25.5
+
+require (
</code_context>
<issue_to_address>
**issue (bug_risk):** The Go version `1.25.5` is not a valid released Go version and will break tooling and CI setup.

This will surface as an `unknown go version` error in both the `go` toolchain and `actions/setup-go`, and will cause the `retest` workflow to fail because it uses `tools/retest/go.mod` as its `go-version-file`. Please update this to a valid released version, ideally matching the root `go.mod` (e.g., `go 1.22.x` or whatever the repo targets).
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@davdhacs davdhacs force-pushed the davdhacs/retest-independent-module branch from 5cb3c16 to af0a54c Compare March 12, 2026 17:49
tools/retest only depends on go-github and has no imports from the main
stackrox module. Making it a standalone module means:

- Its go.sum only contains 6 dependencies instead of the full monorepo's
- The setup-go cache key in retest_periodic.yml is now based on this
  small go.sum, so it only invalidates when go-github is updated rather
  than on every repo-wide dependency bump
- Removes go-github/v60 from the root go.mod (no other code uses it)

Update retest_periodic.yml to use tools/retest/go.mod for Go version
and tools/retest/go.sum for cache-dependency-path.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davdhacs davdhacs force-pushed the davdhacs/retest-independent-module branch from af0a54c to 97c4d6c Compare March 12, 2026 17:51
@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 12, 2026

Images are ready for the commit at 97c4d6c.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-311-g97c4d6cc6c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants