Skip to content

Upgraded to new go version and added build action#36

Open
costa-labs wants to merge 20 commits into
mainfrom
github_actions
Open

Upgraded to new go version and added build action#36
costa-labs wants to merge 20 commits into
mainfrom
github_actions

Conversation

@costa-labs
Copy link
Copy Markdown
Collaborator

@costa-labs costa-labs commented May 8, 2026

Summary by CodeRabbit

  • Chores
    • Updated Go toolchain declaration to go 1.26 and aligned builder base image accordingly.
    • Added a CI workflow triggered on push that runs on self-hosted runners, sets a default image name, and performs container build, registry login and environment checks.

Review Change Stack

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Synchronizes Go version from 1.26.2 → 1.26 in go.mod and Dockerfile, and adds a ci GitHub Actions workflow (on push) that checks out code, logs into Docker Hub on a self-hosted runner, verifies Podman, and builds a container image.

Changes

Build Infrastructure Update

Layer / File(s) Summary
Go Version Configuration
go.mod, Dockerfile
go directive changed from 1.26.21.26; Docker builder base image tag changed from golang:1.26.2golang:1.26.
CI Workflow: header & env
.github/workflows/build.yaml
Introduces ci workflow triggered on push and sets workflow-level env.IMAGE_NAME.
CI Workflow: job definition
.github/workflows/build.yaml
Adds job container running on self-hosted and begins job steps.
CI Workflow: checkout step
.github/workflows/build.yaml
Adds actions/checkout@v4 step.
CI Workflow: Docker login
.github/workflows/build.yaml
Adds docker/login-action@v4 step using workflow vars and secrets.
CI Workflow: verify tooling
.github/workflows/build.yaml
Adds step to run podman --version.
CI Workflow: build step
.github/workflows/build.yaml
Adds podman build step with source_repository label and hardcoded destination tag (user/app).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • senolcolak
  • sumitarora2786

Poem

🐰 I hopped through Dockerfiles and lines of Go,
I nudged the tags so builds can flow,
A workflow wakes when pushes arrive,
It logs in, checks Podman, keeps builds alive,
A little rabbit cheers — CI's set to go!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: upgrading the Go version (in go.mod and Dockerfile) and adding a new GitHub Actions build workflow.
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
  • Commit unit tests in branch github_actions

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

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

Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
.github/workflows/build.yaml (1)

3-5: ⚡ Quick win

CI should also run on PRs, not only pushes.

With only push, failures are discovered after merge instead of at review time.

Suggested change
 on:
   push:
+  pull_request:
🤖 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 @.github/workflows/build.yaml around lines 3 - 5, The workflow currently
triggers only on the "push" event; update the workflow's top-level "on:" block
to include "pull_request" alongside "push" so CI runs for PRs as well as pushes
(i.e., add a "pull_request:" entry next to the existing "push:" entry in the
workflow definition).
🤖 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 @.github/workflows/build.yaml:
- Line 14: Replace mutable action tags with their immutable commit SHAs: find
occurrences like "docker/login-action@v4" (and the other action tags referenced
in the diff at lines 20, 24, 29) and pin each to the full 40-character commit
SHA (e.g., docker/login-action@<40-char-sha>) instead of the short tag; keep the
rest of the workflow syntax unchanged and optionally add a trailing comment with
the original tag (e.g., # v4) for readability. Ensure every action reference in
the workflow is updated to use a full commit SHA.
- Line 34: The current labels entry using a static custom key
"source_repository='c5413905/remotearbiter'" is nonstandard and brittle; update
the labels configuration (the labels: entry) to use standard OCI annotation keys
such as org.opencontainers.image.source and org.opencontainers.image.revision
and source the values from CI context (e.g., the GitHub repository or
metadata-action outputs like github.repository / github.sha) instead of
hardcoding the repo ID so the build-push-action emits proper OCI metadata.
- Around line 13-17: Remove the unnecessary Docker Hub login step: delete the
workflow step named "Login to Docker Hub" that uses docker/login-action@v4 and
references vars.DOCKERHUB_USERNAME and secrets.DOCKERHUB_TOKEN, since the job
runs with push: false and uses only public base images; ensure no other steps
reference those secrets so they can be safely removed from the workflow.

In `@Dockerfile`:
- Line 5: The Dockerfile's builder stage uses the floating image tag
"golang:1.26" which breaks reproducible builds; update the FROM line in the
Dockerfile to pin a specific patch version (e.g., "golang:1.26.2") or pin to an
immutable digest (e.g., "golang:1.26.2@sha256:<digest>") for the builder stage
so the image referenced by the builder (FROM golang:1.26 ...) remains
deterministic; choose patch-pin for automatic patch rollups or digest-pin for
maximum immutability and update the FROM instruction accordingly.

---

Nitpick comments:
In @.github/workflows/build.yaml:
- Around line 3-5: The workflow currently triggers only on the "push" event;
update the workflow's top-level "on:" block to include "pull_request" alongside
"push" so CI runs for PRs as well as pushes (i.e., add a "pull_request:" entry
next to the existing "push:" entry in the workflow definition).
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1edd9405-d604-4b93-8dec-8a2c62756fe9

📥 Commits

Reviewing files that changed from the base of the PR and between efa11a6 and c764dd3.

📒 Files selected for processing (3)
  • .github/workflows/build.yaml
  • Dockerfile
  • go.mod

Comment thread .github/workflows/build.yaml Outdated
Comment thread .github/workflows/build.yaml
Comment thread .github/workflows/build.yaml Outdated
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta.outputs.annotations }}
push: false
labels: "source_repository='c5413905/remotearbiter'" No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use standard OCI labels (or metadata-action outputs) instead of static custom label text.

labels: "source_repository='c5413905/remotearbiter'" is brittle and non-standard; prefer OCI keys like org.opencontainers.image.source.

What label format does docker/build-push-action expect, and what are the standard OCI image annotation/label keys for source repository metadata?
Suggested change
-          labels: "source_repository='c5413905/remotearbiter'"
+          labels: |
+            org.opencontainers.image.source=https://github.com/cobaltcore-dev/external-arbiter-operator
+            org.opencontainers.image.revision=${{ github.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 @.github/workflows/build.yaml at line 34, The current labels entry using a
static custom key "source_repository='c5413905/remotearbiter'" is nonstandard
and brittle; update the labels configuration (the labels: entry) to use standard
OCI annotation keys such as org.opencontainers.image.source and
org.opencontainers.image.revision and source the values from CI context (e.g.,
the GitHub repository or metadata-action outputs like github.repository /
github.sha) instead of hardcoding the repo ID so the build-push-action emits
proper OCI metadata.

Comment thread Dockerfile

# Build the manager binary
FROM golang:1.26.2 AS builder
FROM golang:1.26 AS builder
Copy link
Copy Markdown

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:

What are the Docker Official Image tag semantics for golang(e.g.,1.26vs1.26.x), and what do Docker/GitHub recommend for reproducible CI builds regarding digest pinning?

💡 Result:

Docker Official Image tag semantics for golang 1) What tags exist and how they relate - The golang Official Image publishes “version tags” and “shared tags” that are aliases of the same underlying build. The Docker Hub tag listing explicitly groups 1.26.2, 1.26, 1, and latest together as shared tags [1][2]. - Therefore, golang:1.26 is a moving alias for the current patch release in the 1.26 series (and golang:latest is also an alias) rather than a patch-pinned immutable reference [1][2]. - Conversely, golang:1.26.2 (three-part version) is patch-pinned; it is not described as being aliased with a different patch release the way the two-part alias (1.26) is [1][2]. Practical implication for CI: - FROM golang:1.26 can change over time as the 1.26.x patch line advances, while FROM golang:1.26.2 stays on that exact patch release, which is closer to reproducibility [1][2]. - There are also suite/OS-variant tags (e.g., bookworm, trixie, alpine3.23) that indicate the Debian/Alpine base variant; they are independent of the Go version tag choice [1][3]. 2) Example seen in Docker Hub - Docker Hub shows 1.26.2-trixie, 1.26-trixie, 1-trixie, and trixie as tags in the golang repository [1][2]. This indicates multiple tag names can point at the same build for different “levels” of specificity (patch vs series vs “latest-like” aliases) [1][2]. Digest pinning recommendations for reproducible CI builds 1) Prefer digest pinning when you need immutable/reproducible container inputs - Docker’s documentation describes that digests are immutable and “pin” an image to a specific version: pulling by digest guarantees you get “exactly the same image” each time, whereas tags are not immutable and may resolve to different content over time [4][5]. - Docker also explicitly warns: when you pin by digest, you stop automatically receiving updates (including security updates); you must change the digest yourself to pick up new security fixes [4]. 2) What Docker/GitHub community recommendations look like - Docker/OCI ecosystem guidance and CI-security discussions commonly recommend digest pinning specifically to prevent “floating” tag behavior from breaking reproducibility/security expectations. For example, a Docker-related pinning guidance proposal for pinned dependencies suggests using node@sha256:...-style references for container images in CI [6]. How to apply this to your CI - For maximum reproducibility of the Go build environment image, use a patch (or full) version tag if you cannot use digests, e.g. golang:1.26.2 rather than golang:1.26 [1][2]. - For maximum immutability, pin the base image by digest, e.g. FROM golang:1.26.2@sha256:<digest> (digest format shown in Docker docs) [4][5]. - Keep an update process (manual or automated) to periodically refresh the digest to get security fixes, since digest pinning disables “automatic” tag movement [4].

Citations:


Pin builder image to a deterministic version or digest.

golang:1.26 is a floating tag alias that resolves to different patch releases as the 1.26.x line advances, breaking build reproducibility. Use a patch-pinned tag (golang:1.26.2) for consistency, or pin by digest (golang:1.26.2@sha256:<digest>) for maximum immutability. Note that digest pinning requires manual updates to receive security patches.

Suggested change
-FROM golang:1.26 AS builder
+FROM golang:1.26.2 AS builder
+# or stronger:
+# FROM golang:1.26.2@sha256:<resolved-digest> AS builder
🤖 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 `@Dockerfile` at line 5, The Dockerfile's builder stage uses the floating image
tag "golang:1.26" which breaks reproducible builds; update the FROM line in the
Dockerfile to pin a specific patch version (e.g., "golang:1.26.2") or pin to an
immutable digest (e.g., "golang:1.26.2@sha256:<digest>") for the builder stage
so the image referenced by the builder (FROM golang:1.26 ...) remains
deterministic; choose patch-pin for automatic patch rollups or digest-pin for
maximum immutability and update the FROM instruction accordingly.

Copy link
Copy Markdown

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

🤖 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 @.github/workflows/build.yaml:
- Around line 11-12: The workflow contains duplicate YAML keys named "runs-on"
which makes the file invalid; remove one of the "runs-on" entries so only a
single runner is specified (choose and keep the intended value, e.g.,
"ubuntu-latest" per the proposed fix) and ensure the remaining "runs-on" key is
the only occurrence in the workflow.
- Around line 6-7: The workflow's IMAGE_NAME env value is a placeholder
("user/app") and should be replaced with this repo's real container image
reference; update the IMAGE_NAME environment variable in the YAML to the correct
registry/repository:tag (or set it to a repo-level variable/secrets value) so
pushes/builds target the correct image. Locate the IMAGE_NAME entry in the env
block and replace "user/app" with your actual image name (or wire it to a
secret/variable) to ensure correct registry path when push is enabled.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 471dddc8-44f8-423c-a287-6b32205eb037

📥 Commits

Reviewing files that changed from the base of the PR and between c764dd3 and 4158611.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml

Comment thread .github/workflows/build.yaml
Comment thread .github/workflows/build.yaml Outdated
Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
.github/workflows/build.yaml (1)

9-12: ⚡ Quick win

Set explicit least-privilege GITHUB_TOKEN permissions.

Define token permissions in the workflow (or job) so scope is deterministic and minimized.

Suggested change
 name: ci

 on:
   push:

+permissions:
+  contents: read
+
 env:
   IMAGE_NAME: user/app
🤖 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 @.github/workflows/build.yaml around lines 9 - 12, The workflow currently
relies on the default GITHUB_TOKEN scope; add an explicit least-privilege
permissions block for the job named "container" so the token scope is
deterministic and minimized (e.g., under jobs.container add a permissions
mapping such as permissions: contents: read and only other scopes required by
the steps), ensuring the permissions block is placed alongside runs-on and steps
for that job.
🤖 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.

Nitpick comments:
In @.github/workflows/build.yaml:
- Around line 9-12: The workflow currently relies on the default GITHUB_TOKEN
scope; add an explicit least-privilege permissions block for the job named
"container" so the token scope is deterministic and minimized (e.g., under
jobs.container add a permissions mapping such as permissions: contents: read and
only other scopes required by the steps), ensuring the permissions block is
placed alongside runs-on and steps for that job.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9dc982fa-6389-49d6-9e17-2ad817a056c4

📥 Commits

Reviewing files that changed from the base of the PR and between 4158611 and df40c48.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml

Copy link
Copy Markdown

@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.

♻️ Duplicate comments (1)
.github/workflows/build.yaml (1)

13-21: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Workflow is not performing a build, and it unnecessarily consumes registry secrets.

On Line 13–18, the job logs into a registry, but on Line 20–21 it only runs podman --version. There is no container build/test/push step, so this CI job currently doesn’t validate the Go upgrade and exposes secrets without need.

Suggested minimal fix
 jobs:
   container:
     runs-on: self-hosted
     steps:
-      - name: Login to Docker Hub
-        uses: docker/login-action@v4
-        with:
-          registry: ${{ vars.KEPPEL_REGISTRY }}
-          username: ${{ vars.KEPPEL_USERNAME }}
-          password: ${{ secrets.KEPPEL_SECRET }}
-
-      - name: Check Podman version
-        run: podman --version
+      - name: Check Podman version
+        run: podman --version
+      - name: Build container image
+        run: podman build -t ${{ env.IMAGE_NAME }} .
🤖 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 @.github/workflows/build.yaml around lines 13 - 21, The workflow currently
performs "Login to Docker Hub" (docker/login-action@v4) but never
builds/tests/pushes any container—remove the login step (and the referenced
vars.secrets usage) to avoid exposing registry credentials, or alternatively add
the corresponding container build/test/push steps that actually use the
registry; update or delete the "Login to Docker Hub" step (and any references to
vars.KEPPEL_REGISTRY, vars.KEPPEL_USERNAME, secrets.KEPPEL_SECRET) so the job
either performs a real Podman/Build action after "Check Podman version" or does
not perform any registry login.
🤖 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.

Duplicate comments:
In @.github/workflows/build.yaml:
- Around line 13-21: The workflow currently performs "Login to Docker Hub"
(docker/login-action@v4) but never builds/tests/pushes any container—remove the
login step (and the referenced vars.secrets usage) to avoid exposing registry
credentials, or alternatively add the corresponding container build/test/push
steps that actually use the registry; update or delete the "Login to Docker Hub"
step (and any references to vars.KEPPEL_REGISTRY, vars.KEPPEL_USERNAME,
secrets.KEPPEL_SECRET) so the job either performs a real Podman/Build action
after "Check Podman version" or does not perform any registry login.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6abc2671-b563-4804-b15a-3167ca8697e2

📥 Commits

Reviewing files that changed from the base of the PR and between df40c48 and 365bbaa.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml

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