Skip to content

ci(tests): fix OCIR registry login in Release E2E workflow - #2973

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix/release-e2e-ocir-secrets
Jun 22, 2026
Merged

ci(tests): fix OCIR registry login in Release E2E workflow#2973
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix/release-e2e-ocir-secrets

Conversation

@myasnikovdaniil

@myasnikovdaniil myasnikovdaniil commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What this PR does

The Release E2E workflow's build job logged into iad.ocir.io using secrets.OCI_REGISTRY_USERNAME / secrets.OCI_REGISTRY_PASSWORD — secret names that don't exist in the repo. docker/login-action therefore received empty credentials and failed at the very first step with Username and password required, before any image was built or any test ran.

The workflow has never succeeded since it was added (2026-05-02): all three tag runs to date died at this step — v1.5.0-rc.2, v1.5.0-rc.3, and v1.5.0.

This switches the login to the configured OCIR_USER / OCIR_TOKEN secrets — the same ones build-main.yaml and pull-requests.yaml use against the same registry — and adds the per-job Docker config isolation those workflows already use (Set up Docker config step + DOCKER_CONFIG env on the login and build steps), so the login doesn't clobber the shared ~/.docker/config.json on the self-hosted runner.

Release note

ci(tests): fix OCIR registry login in the Release E2E workflow so it can build and run the full suite on release tags

Summary by CodeRabbit

Release Notes

  • Chores
    • Improved the release workflow with enhanced Docker credential isolation and configuration handling during the build process.

The Release E2E build job referenced secrets OCI_REGISTRY_USERNAME /
OCI_REGISTRY_PASSWORD, which do not exist in the repo, so
docker/login-action received empty credentials and failed every run
with "Username and password required". The workflow has never built
since it was added (2026-05-02): v1.5.0-rc.2, v1.5.0-rc.3 and v1.5.0
all died at this step before any image was built or test run.

Use the configured OCIR_USER / OCIR_TOKEN secrets, matching
build-main.yaml and pull-requests.yaml, and isolate the Docker config
per job (Set up Docker config step + DOCKER_CONFIG on the login and
build steps) so login does not clobber the shared ~/.docker/config.json
on the self-hosted runner.

Assisted-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot added area/testing Issues or PRs related to testing (e2e, bats, unit tests) size/S This PR changes 10-29 lines, ignoring generated files labels Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The release E2E workflow's build job is updated to use an isolated Docker config directory at ${{ runner.temp }}/.docker. A new step copies existing ~/.docker contents into that temp path, the registry login step switches to OCIR_USER/OCIR_TOKEN secrets and sets DOCKER_CONFIG, and the build step also sets DOCKER_CONFIG to the same temp directory.

Changes

Release E2E Docker config isolation

Layer / File(s) Summary
Isolated Docker config setup, login, and image build
.github/workflows/release-e2e.yaml
Adds a step to copy ~/.docker into ${{ runner.temp }}/.docker; updates login to use OCIR_USER/OCIR_TOKEN secrets with DOCKER_CONFIG set to the temp path; updates the build step to export the same DOCKER_CONFIG env var.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • cozystack/cozystack#2962: Directly related — sets DOCKER_CONFIG so the Buildx builder is created in the same ${{ runner.temp }}/.docker store, the same pattern being applied here to the login and build steps.

Suggested labels

kind/bug, size/XS, area/ci, area/build

Suggested reviewers

  • kvaps
  • lllamnyp
  • androndo
  • IvanHunters
  • sircthulhu

Poem

🐇 Hopping through the runner's temp,
A Docker config, clean and kempt.
New secrets login, OCIR's the key,
Build images safely, wild and free.
No stray credentials left behind —
This rabbit leaves no mess to find! 🐾

🚥 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 change: fixing OCIR registry login in the Release E2E workflow by switching to correct credentials and implementing Docker config isolation.
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 fix/release-e2e-ocir-secrets

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.

@dosubot dosubot Bot added area/ci Issues or PRs related to CI workflows, GitHub Actions, automation kind/bug Categorizes issue or PR as related to a bug labels Jun 22, 2026

@coderabbitai coderabbitai Bot left a comment

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.

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 @.github/workflows/release-e2e.yaml:
- Line 46: The `docker/login-action@v3` on line 46 uses a mutable version tag
which violates security best practices and can lead to supply-chain attacks.
Replace the mutable tag `v3` with a full commit SHA (following the same pattern
already used in codeql.yml) to ensure the workflow uses an immutable, specific
version of the action.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6c409bd1-cf0e-4091-8293-e50d67fc1a5c

📥 Commits

Reviewing files that changed from the base of the PR and between 93aac35 and 1a6dd6f.

📒 Files selected for processing (1)
  • .github/workflows/release-e2e.yaml

fi

- name: Login to registry
uses: docker/login-action@v3

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

🧩 Analysis chain

🏁 Script executed:

# First, examine the file to confirm line 46 content
cat -n .github/workflows/release-e2e.yaml | sed -n '40,55p'

Repository: cozystack/cozystack

Length of output: 627


🏁 Script executed:

# Check if there are other workflows to see the pattern consistency
fd -e yaml .github/workflows/ -x grep -l "docker/login-action" {}

Repository: cozystack/cozystack

Length of output: 441


🏁 Script executed:

# Look for any pinning policy or security documentation
fd -e md -e txt . | xargs grep -l "pin\|commit.*sha\|docker/login" 2>/dev/null | head -20

Repository: cozystack/cozystack

Length of output: 579


🌐 Web query:

docker/login-action v3 mutable tag vs commit sha pinning security best practices

💡 Result:

The use of immutable commit SHA pinning for GitHub Actions, including docker/login-action, is widely considered the industry security best practice to prevent supply chain attacks [1][2][3]. Security Best Practices: 1. Use Immutable Commit SHAs: Unlike version tags (e.g., v3), which are mutable and can be retargeted by maintainers or attackers to point to malicious code, full 40-character commit SHAs are content-addressable and immutable [1][2][4]. Pinning to a specific SHA ensures your workflow executes the exact code you have reviewed and verified [5][4]. 2. Mitigating Tag Retargeting: If an attacker compromises a repository or an account with push access, they can update existing tags to point to compromised commits [6][7]. SHA pinning renders this attack vector ineffective because the workflow will continue to reference the original, verified commit hash [1][5]. 3. Organizational Policy Enforcement: Many organizations now enforce SHA pinning at the policy level [3][4]. GitHub allows administrators to mandate full commit SHA pinning for all actions; when enabled, workflows using tags will fail execution [2][3][4]. 4. Maintenance Strategy: To balance security with the need for updates, teams commonly use automated dependency management tools like Dependabot or Renovate [1][7][5]. These tools can be configured to automatically create pull requests that update SHAs, while preserving the human-readable version tag (e.g., v3) in a code comment [5][4]. This allows for easy tracking and controlled adoption of new versions [1][7]. Implementation Example: When pinning, use the full 40-character SHA and include a comment with the original version for readability [1][5]. - uses: docker/login-action@f4b8f3e # v3.3.0 While tags are more convenient and widely used, they should only be used if you fully trust the creator and are aware of the risks associated with mutability [2]. For enterprise or production-grade CI/CD pipelines, SHA pinning is the standard requirement [2][3][4].

Citations:


🏁 Script executed:

# Find all workflow files and check for unpinned docker/login-action uses
fd --full-path '.github/workflows' -type f -name '*.yaml' -o -name '*.yml' | xargs grep -n "docker/login-action" 2>/dev/null

Repository: cozystack/cozystack

Length of output: 236


🌐 Web query:

docker/login-action v3 latest commit sha

💡 Result:

docker/login-action@v3 latest commit SHA (i.e., the current HEAD of the v3 branch as of 2026-06-22): 06895751d15a223ec091bea144ad5c7f50d228d0 [1]. Notes: GitHub actions “めら (@V3)” points to the moving tag/branch for major version v3; the commit SHA shown for the v3 tree is 06895751d15a223ec091bea144ad5c7f50d228d0. [1]

Citations:


🏁 Script executed:

# Correct fd syntax to find all yaml files in .github/workflows
fd . '.github/workflows' -type f \( -name '*.yaml' -o -name '*.yml' \)

Repository: cozystack/cozystack

Length of output: 234


🏁 Script executed:

# Then check them for docker/login-action and other action uses
find .github/workflows -type f \( -name '*.yaml' -o -name '*.yml' \) -exec grep -n "uses:" {} + | head -30

Repository: cozystack/cozystack

Length of output: 2582


Pin docker/login-action to a commit SHA instead of a mutable tag.

Line 46 uses docker/login-action@v3, which is mutable and violates workflow hardening best practices. Pin this to a full commit SHA to prevent upstream tag retargeting and supply-chain attacks. This repo already practices SHA pinning in codeql.yml; apply the same pattern here for consistency.

Suggested change
      - name: Login to registry
-        uses: docker/login-action@v3
+        uses: docker/login-action@06895751d15a223ec091bea144ad5c7f50d228d0 # v3
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: docker/login-action@v3
uses: docker/login-action@06895751d15a223ec091bea144ad5c7f50d228d0 # v3
🧰 Tools
🪛 zizmor (1.25.2)

[error] 46-46: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 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/release-e2e.yaml at line 46, The `docker/login-action@v3`
on line 46 uses a mutable version tag which violates security best practices and
can lead to supply-chain attacks. Replace the mutable tag `v3` with a full
commit SHA (following the same pattern already used in codeql.yml) to ensure the
workflow uses an immutable, specific version of the action.

Source: Linters/SAST tools

@kvaps
Andrei Kvapil (kvaps) merged commit 77d42ab into main Jun 22, 2026
14 of 15 checks passed
@kvaps
Andrei Kvapil (kvaps) deleted the fix/release-e2e-ocir-secrets branch June 22, 2026 11:43
myasnikovdaniil added a commit that referenced this pull request Jun 25, 2026
## What this PR does

Removes the `Release E2E` workflow
(`.github/workflows/release-e2e.yaml`), which ran the full bats suite on
every release tag.

**Why it's redundant.** `release-e2e.yaml` was a non-blocking alarm —
its own header states *"a failure here is an alarm, not a release
blocker."* The coverage it provided is already delivered by the
release-cut PR: the "Prepare release" commit bakes image digests into
`packages/core/` (installer, platform, testing) and other packages, and
`select-e2e.sh`'s full-suite pattern escalates any `packages/core/`
change to the **full** suite. So the release PR already runs the whole
suite against the commit the tag will point at.

**Why now.** The workflow has never been green since it was added
(2026-05-02) — every tag run (`v1.5.0-rc.2`, `-rc.3`, `v1.5.0`) failed
at the build step. Even after #2973 fixed the registry login earlier
today, the next run still failed at *Build Talos image*. A
perpetually-red, non-gating duplicate is pure noise.

**Changes**

- Delete `.github/workflows/release-e2e.yaml`.
- Drop `release-e2e` from the full-suite pattern in
`hack/select-e2e.sh`.
- Repoint the workflow-trigger unit test in `hack/select-e2e_test.bats`
to `pull-requests.yaml` (the remaining E2E workflow), preserving
"workflow edit → full suite" coverage. All 11 `select-e2e_test.bats`
cases pass.
- Update `docs/agents/e2e-testing.md` to describe the release-cut PR as
where the full suite runs.

Refs #2397.

### Release note

```release-note
ci(tests): remove the redundant Release E2E workflow; the full E2E suite already runs on the release-cut PR
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
  * Removed automated release end-to-end testing workflow
* Updated E2E test selection logic to reflect testing infrastructure
changes

* **Documentation**
* Updated E2E testing procedures documentation to reflect current
testing approach

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
pull Bot pushed a commit to medampudi/cozystack that referenced this pull request Jun 25, 2026
The Release E2E workflow (`release-e2e.yaml`) ran the full bats suite on
every release tag as a non-blocking alarm — its own header notes "a
failure here is an alarm, not a release blocker." It duplicates coverage
the release-cut PR already provides: the "Prepare release" commit bakes
image digests into `packages/core/` (and other packages), which TIA
escalates to the full suite, so the release PR exercises the whole suite
against the commit the tag will point at.

It has also never been green since it was added (2026-05-02): every tag
run failed at the build step. Even after cozystack#2973 fixed the registry login
today, the next run still failed (Build Talos image). Removing a
perpetually-red, non-gating duplicate removes noise without losing
coverage.

Removes the workflow, drops `release-e2e` from `select-e2e.sh`'s
full-suite pattern, repoints its unit test to `pull-requests.yaml`, and
updates the e2e-testing doc.

Refs cozystack#2397

Assisted-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Issues or PRs related to CI workflows, GitHub Actions, automation area/testing Issues or PRs related to testing (e2e, bats, unit tests) kind/bug Categorizes issue or PR as related to a bug size/S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants