Skip to content

feat(CC-0003): add minimal GitHub Actions CI workflow#4

Closed
berendt wants to merge 4 commits intomainfrom
feature/CC-0003
Closed

feat(CC-0003): add minimal GitHub Actions CI workflow#4
berendt wants to merge 4 commits intomainfrom
feature/CC-0003

Conversation

@berendt
Copy link
Contributor

@berendt berendt commented Mar 1, 2026

  • Add .github/workflows/ci.yaml with three parallel jobs: lint,
    test, and test-integration running on push to main and PRs
  • Pin all GitHub Actions to full commit SHAs for supply chain
    security (checkout, setup-go, golangci-lint-action)
  • Use golangci-lint-action v9 (v2.10) for linting against the
    Go workspace root without a separate setup-go step
  • Read Go version from go.work via actions/setup-go for test jobs
    with default module caching enabled
  • Apply least-privilege permissions (contents: read) and add
    concurrency group with cancel-in-progress to save CI resources
  • Implement test-integration Makefile target to run go test with
    -tags=integration across all workspace modules
  • Add TODO for KUBEBUILDER_ASSETS setup step when envtest-based
    integration tests are introduced (CC-0002/S002)
  • Add reference documentation in docs/ci-workflow.md covering
    triggers, jobs, Go setup convention, and dependencies

berendt added 2 commits March 1, 2026 15:28
- Add .github/workflows/ci.yaml with three parallel jobs: lint,
test, and test-integration running on push to main and PRs
- Pin all GitHub Actions to full commit SHAs for supply chain
security (checkout, setup-go, golangci-lint-action)
- Use golangci-lint-action v9 (v2.10) for linting against the
Go workspace root without a separate setup-go step
- Read Go version from go.work via actions/setup-go for test jobs
with default module caching enabled
- Apply least-privilege permissions (contents: read) and add
concurrency group with cancel-in-progress to save CI resources
- Implement test-integration Makefile target to run go test with
-tags=integration across all workspace modules
- Add TODO for KUBEBUILDER_ASSETS setup step when envtest-based
integration tests are introduced (CC-0002/S002)
- Add reference documentation in docs/ci-workflow.md covering
triggers, jobs, Go setup convention, and dependencies

AI-assisted: Claude Code
On-behalf-of: @SAP christian.berendt@sap.com
Signed-off-by: Christian Berendt <berendt@23technologies.cloud>
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 1, 2026

Reviewer's Guide

Adds a minimal GitHub Actions CI workflow with parallel lint, unit test, and integration test jobs wired to existing Makefile targets, using pinned action SHAs, workspace-based Go version detection, least-privilege permissions, and accompanying documentation.

Flow diagram for the updated Makefile test_integration target

flowchart TD
  Start[Start test_integration target] --> InitLoop[Read ALL_MODULE_DIRS]
  InitLoop --> ForEachDir{More module directories?}

  ForEachDir -->|yes| EchoDir[Print Integration testing dir]
  EchoDir --> CdDir[cd into module directory]
  CdDir --> RunGoTest[Run go test -tags=integration ./...]

  RunGoTest --> TestSuccess{go test exit code 0?}
  TestSuccess -->|no| ExitError[Exit 1]
  TestSuccess -->|yes| NextIter[Next directory]
  NextIter --> ForEachDir

  ForEachDir -->|no| Done[All integration tests completed successfully]

  style ExitError fill:#fdd,stroke:#f00
  style Done fill:#dfd,stroke:#080
Loading

File-Level Changes

Change Details Files
Introduce GitHub Actions CI workflow with lint, unit test, and integration test jobs running in parallel on pushes to main and on pull requests.
  • Define workflow triggers for push to main and all pull_request events.
  • Configure three independent jobs (lint, test, test-integration) all on ubuntu-latest with no needs dependencies.
  • Add top-level least-privilege permissions and a concurrency group that cancels in-progress runs per-branch per-workflow.
.github/workflows/ci.yaml
Wire CI jobs to Go tooling using pinned actions, workspace-based Go version resolution, and Makefile targets.
  • Pin actions/checkout, actions/setup-go, and golangci-lint-action to specific commit SHAs with version comments.
  • Use golangci/golangci-lint-action v9 configured to run golangci-lint v2.10 at the repo root for linting.
  • Configure test and test-integration jobs to read the Go version from go.work via actions/setup-go with default module caching.
  • Execute make test and make test-integration from the workflow for unit and integration tests respectively, leaving a TODO for adding KUBEBUILDER_ASSETS setup via make install-test-deps.
.github/workflows/ci.yaml
Makefile
Implement Makefile integration test target to run integration-tagged tests across all modules.
  • Replace the previous stubbed test-integration target with a loop over ALL_MODULE_DIRS.
  • Within each module directory, run go test -tags=integration ./... and fail fast on the first error.
  • Update the target documentation comment to clarify it runs integration tests for all modules and requires KUBEBUILDER_ASSETS.
Makefile
Document the CI workflow behavior, conventions, and dependencies and update plan/progress metadata for the feature.
  • Add documentation describing the CI workflow location, triggers, jobs, Go setup convention, concurrency, permissions, and dependencies.
  • Record progress and review metadata for CC-0003-a003 in the planwerk tracking files.
docs/ci-workflow.md
.planwerk/features/CC-0003-a003-add-minimal-github-actions-ci-workflow.json
.planwerk/progress/CC-0003-a003-add-minimal-github-actions-ci-workflow.json
.planwerk/reviews/CC-0003-a003-add-minimal-github-actions-ci-workflow-review-1.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@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 test-integration Makefile target iterates over $(ALL_MODULE_DIRS) while docs/ci-workflow.md describes these targets in terms of OPERATORS; consider aligning the variable/terminology so CI behavior matches the documented module set.
  • Given that test-integration depends on KUBEBUILDER_ASSETS and a future S002 implementation, you may want to gate the test-integration CI job behind a condition (e.g., env flag or path filter) to avoid having the main CI pipeline blocked by a known-not-yet-implemented integration setup.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `test-integration` Makefile target iterates over `$(ALL_MODULE_DIRS)` while `docs/ci-workflow.md` describes these targets in terms of `OPERATORS`; consider aligning the variable/terminology so CI behavior matches the documented module set.
- Given that `test-integration` depends on `KUBEBUILDER_ASSETS` and a future S002 implementation, you may want to gate the `test-integration` CI job behind a condition (e.g., env flag or path filter) to avoid having the main CI pipeline blocked by a known-not-yet-implemented integration setup.

## Individual Comments

### Comment 1
<location path=".github/workflows/ci.yaml" line_range="27" />
<code_context>
+      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
+      - uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
+        with:
+          version: v2.10
+
+  test:
</code_context>
<issue_to_address>
**issue (bug_risk):** The golangci-lint `version` input looks off and may not match actual released versions, causing the lint job to fail.

This `version` value is for the golangci-lint binary, not the action. golangci-lint releases use tags like `v1.xx.x` (e.g. `v1.59.1`), and there is no `v2.10`, so this will likely fail to resolve. Please update it to a valid golangci-lint release (or `latest`) and keep it aligned with the rest of the toolchain’s expected version.
</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.

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: v2.10
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): The golangci-lint version input looks off and may not match actual released versions, causing the lint job to fail.

This version value is for the golangci-lint binary, not the action. golangci-lint releases use tags like v1.xx.x (e.g. v1.59.1), and there is no v2.10, so this will likely fail to resolve. Please update it to a valid golangci-lint release (or latest) and keep it aligned with the rest of the toolchain’s expected version.

berendt added 2 commits March 1, 2026 15:40
Gate the test-integration CI job behind a ENABLE_INTEGRATION_TESTS
repository variable until S002 provides KUBEBUILDER_ASSETS setup.
Bump golangci-lint from v2.10 to v2.10.1. Update ci-workflow docs
to align terminology and reflect the new gating condition.

AI-assisted: Claude Code
On-behalf-of: @SAP christian.berendt@sap.com
Signed-off-by: Christian Berendt <berendt@23technologies.cloud>
AI-assisted: Claude Code
On-behalf-of: @SAP christian.berendt@sap.com
Signed-off-by: Christian Berendt <berendt@23technologies.cloud>
@berendt berendt closed this Mar 1, 2026
@berendt berendt deleted the feature/CC-0003 branch March 1, 2026 16:06
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.

1 participant