Skip to content

ci: move Harbor registry refs to repository variables, add .gitleaksignore - #360

Open
Abdelsalam-Abbas wants to merge 7 commits into
mainfrom
abbas1/eng-597-internal-refs
Open

ci: move Harbor registry refs to repository variables, add .gitleaksignore#360
Abdelsalam-Abbas wants to merge 7 commits into
mainfrom
abbas1/eng-597-internal-refs

Conversation

@Abdelsalam-Abbas

@Abdelsalam-Abbas Abdelsalam-Abbas commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Quiets the recurring internal-reference secret-scan alerts for this repo (18 findings re-posting on every PR; now 25 in grown history).

  • docker.yml: the internal registry hostname now comes from the ASTERA_REGISTRY and SAMPLEWORKS_CHECKPOINTS_SOURCE_IMAGE repository variables, with no in-repo fallback. New fail-fast guard in the astera job: docker/login-action with an empty registry defaults to Docker Hub and would send the Harbor credentials there.
  • .gitleaksignore: fingerprints for all historical findings (all astera-internal-hostname). README and Dockerfile.astera keep their references as intentional internal docs while the repo is private; going public requires republishing as a fresh single-commit repo per the runbook regardless.

Merge requirement: the two repository variables must be set first or the next docker workflow run fails fast:

  • ASTERA_REGISTRY = the Harbor hostname
  • SAMPLEWORKS_CHECKPOINTS_SOURCE_IMAGE = the digest-pinned checkpoints ref

Verified: full-history scan with the internal-refs rules is clean with this ignore file; workflow YAML parses; pre-commit hooks pass.

Summary by CodeRabbit

  • Documentation

    • Updated setup instructions to use the sampleworks ACTL image alias.
    • Documented required digest-pinned checkpoint images and registry configuration.
    • Clarified that builds stop early when the Astera registry is unavailable or invalid.
  • Bug Fixes

    • Improved image validation and registry handling during checkpoint synchronization and Astera builds.
    • Removed hardcoded registry references from local image build instructions.
    • Added checks to reject public registries and require valid private registry destinations.

…gnore

The internal registry hostname now comes from the ASTERA_REGISTRY and
SAMPLEWORKS_CHECKPOINTS_SOURCE_IMAGE repository variables instead of
workflow literals. The astera job fails fast when ASTERA_REGISTRY is
unset, since login-action would otherwise default to Docker Hub and send
the Harbor credentials there. Remaining README/Dockerfile.astera
references are intentional docs for internal use; their historical scan
fingerprints are listed in .gitleaksignore to quiet the warn-only
internal-refs check.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: be5d4a1a-d5ba-4950-8236-ea0c43e0a38d

📥 Commits

Reviewing files that changed from the base of the PR and between d7f2905 and d989c43.

📒 Files selected for processing (3)
  • .github/workflows/docker.yml
  • Dockerfile.astera
  • README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • Dockerfile.astera
  • .github/workflows/docker.yml
  • README.md

📝 Walkthrough

Walkthrough

The Docker workflow now composes checkpoint image references from configured registry inputs, requires digest-pinned sources, and validates registry values. Astera builds use ASTERA_REGISTRY. The README documents the updated image aliases and configuration.

Changes

Docker registry parameterization

Layer / File(s) Summary
Checkpoint source composition and validation
.github/workflows/docker.yml
The workflow builds the checkpoint source reference from the registry secret and repository-variable path. It validates the registry, source path, Docker Hub destination, and digest suffix.
Astera registry wiring
.github/workflows/docker.yml, Dockerfile.astera
The Astera job reads ASTERA_REGISTRY from a repository secret and fails before login when it is unset or public. The local image tag uses the same variable.
Registry configuration documentation
README.md
The README documents image aliases, digest-pinned checkpoint paths, the ASTERA_REGISTRY secret, fail-fast validation, and local registry-based image tags.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: mag-astera, denis-zaitsev

🚥 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 clearly summarizes the main changes: moving Harbor registry references to repository variables and adding .gitleaksignore entries.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch abbas1/eng-597-internal-refs

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.

@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/docker.yml:
- Around line 20-26: Update the README configuration-variable table to mark
SAMPLEWORKS_CHECKPOINTS_SOURCE_IMAGE and ASTERA_REGISTRY as required. Replace
the former source-image default description with the requirement that
SAMPLEWORKS_CHECKPOINTS_SOURCE_IMAGE reference the digest-pinned Harbor source
image, and add ASTERA_REGISTRY with its required-variable description.
🪄 Autofix

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 Plus

Run ID: abf3ab14-2098-496a-88be-10d87b527ccd

📥 Commits

Reviewing files that changed from the base of the PR and between d69b062 and 8b00dcd.

📒 Files selected for processing (2)
  • .github/workflows/docker.yml
  • .gitleaksignore

Comment thread .github/workflows/docker.yml Outdated
sampleworks is a public repo, so suppressing the internal-reference
warning is the wrong response: the alert is reporting real disclosure,
not noise.
The actl image catalog already resolves the `sampleworks` alias to a
digest-pinned Harbor ref, so the README no longer needs to spell out the
internal registry. That also pins the image the docs point at, which the
mutable tag did not. Maintainer-only local builds take the registry host
from ASTERA_REGISTRY, the same variable CI uses.
Repository variables are not masked in Actions logs, and this repo is
public, so the registry host would have been printed by login-action and
metadata-action on every run. Making the bare host a secret masks it
everywhere it appears, since masking is substring-based, while leaving
image paths and digests readable for debugging a failed build. The
source-image guard now checks the parts rather than the composed ref: an
unset host still yields a non-empty, digest-pinned-looking string.

@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: 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/docker.yml:
- Around line 55-61: Update the validation in the workflow before constructing
or using the source image reference to normalize ASTERA_REGISTRY and reject
Docker Hub aliases, including docker.io, registry-1.docker.io, index.docker.io,
and any value matching PUBLIC_REGISTRY. Keep the existing empty checks, and
ensure the rejected value cannot reach the skopeo copy operation or receive
Harbor credentials.

In `@Dockerfile.astera`:
- Around line 8-9: Update the local-build documentation wording from “CI
repository variable” to “CI repository secret” at Dockerfile.astera lines 8-9
and README.md lines 341-343, matching the workflow’s use of
secrets.ASTERA_REGISTRY.
🪄 Autofix

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 Plus

Run ID: 9a9005f8-6f9d-4ee5-bfa3-3cb703975b46

📥 Commits

Reviewing files that changed from the base of the PR and between 8b00dcd and d7f2905.

📒 Files selected for processing (3)
  • .github/workflows/docker.yml
  • Dockerfile.astera
  • README.md

Comment thread .github/workflows/docker.yml
Comment thread Dockerfile.astera Outdated
Records a deliberate risk acceptance rather than hiding a finding: the
host resolves only on the tailnet, so the exposure is reconnaissance
-only, and removal would rewrite 81 commits and 22 tags while our forks
would keep the objects regardless. Fingerprints are commit-scoped, so
new occurrences still alert. Taken from the CI run's own report so they
match the org rule config exactly.
The Harbor credentials are passed to whatever host ASTERA_REGISTRY names,
as skopeo --src-creds and as the login-action registry, so pointing it at
Docker Hub would hand them to a third party. The empty case was already
guarded; this covers the explicitly-public case. Also corrects the local
build docs, which still called the value a repository variable after it
became a secret.
The 18 accepted fingerprints are recorded in ENG-597. Whether they live
in-repo or in a central private repo is still open, so this PR ships only
the registry cleanup. The internal-ref check stays red meanwhile, which
is the status quo, not a regression.
@manzuoni-astera

Copy link
Copy Markdown
Contributor

The workflow changes are solid. Two things about the PR itself rather than the code.

.gitleaksignore isn't in the diff. It's in the title and the body ("fingerprints for all historical findings"), but the PR touches exactly three files — docker.yml, Dockerfile.astera, README.md — and the file doesn't exist on main either. So the stated headline purpose, quieting the 25 historical findings, isn't delivered by this branch. Either it got lost before pushing, or the title/body needs to drop it.

The merge requirement names the wrong things. The body says to set ASTERA_REGISTRY and SAMPLEWORKS_CHECKPOINTS_SOURCE_IMAGE as repository variables. The diff reads secrets.ASTERA_REGISTRY and vars.SAMPLEWORKS_CHECKPOINTS_SOURCE_PATH. Following the body verbatim gets you a secret set as a variable and a variable under the old name, and the new guards then fail the next run — which is exactly the situation the "set these first" note is meant to prevent. Worth fixing since that's the bit someone will action at merge time.

Body also says README and Dockerfile.astera "keep their references as intentional internal docs", but the diff removes them from both. That's the better outcome — I checked and harbor.astera.sh no longer appears anywhere in the tree — the body just describes an earlier version.

What's good: checking the parts instead of the composed ref is a genuinely subtle catch, since an unset host still yields a non-empty /library/...@sha256:... that sails through both the emptiness and digest-pinned checks. The public-registry guard is the right call too, given login-action silently defaults to Docker Hub on an empty registry and the Harbor creds would follow. Both jobs that consume the secret scope it themselves, the rename is clean with no stale _SOURCE_IMAGE references, the YAML parses, and the push/tag/dispatch triggers sidestep the fork-PR secrets problem.

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.

2 participants