Skip to content

ci: label-triggered stagex builds and cache/credential fixes#226

Closed
shahan-khatchadourian-anchorage wants to merge 2 commits into
mainfrom
shahankhatch/ci-restructure
Closed

ci: label-triggered stagex builds and cache/credential fixes#226
shahan-khatchadourian-anchorage wants to merge 2 commits into
mainfrom
shahankhatch/ci-restructure

Conversation

@shahan-khatchadourian-anchorage
Copy link
Copy Markdown
Contributor

@shahan-khatchadourian-anchorage shahan-khatchadourian-anchorage commented Mar 27, 2026

Summary

  • stagex.yml: PR image builds now require the stagex label instead of auto-triggering on path changes. Push to main/tags with path filtering unchanged. GHCR credentials moved after build step so build runs without registry write access.
  • main.yml: Disable setup-rust-toolchain built-in cache (Swatinem/rust-cache) which fails because Cargo.toml is in src/, not the repo root. The manual actions/cache step already handles caching correctly.

Test plan

  • Verify adding stagex label triggers the build on a PR
  • Verify push to main with relevant path changes still triggers the build
  • Verify GHCR push still works on push to main
  • Verify Continuous Integration no longer shows Cargo.toml not found errors

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 27, 2026 02:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Restructures GitHub Actions workflows to separate fast, always-on validation from the heavier OCI image build pipeline, aligning CI triggers with the intended PR label–based build flow and adding musl cargo check coverage to match container build settings.

Changes:

  • Split workflows into check.yml (runs on every push/PR) and ci.yml (full image build on push/main/tags, manual dispatch, or PR ci label).
  • Add musl (x86_64-unknown-linux-musl) cargo check for parser_app and parser_gateway with --no-default-features.
  • Gate GHCR upload to push events only.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/check.yml Removes branch filters and adds musl cargo check steps to validate container-equivalent build configs.
.github/workflows/ci.yml Changes PR trigger to label-based, adds job-level gating for ci label, and restricts GHCR upload to push events.
Comments suppressed due to low confidence (3)

.github/workflows/check.yml:61

  • The new musl cargo check --target x86_64-unknown-linux-musl steps will often require a musl linker/toolchain on Ubuntu runners (e.g., musl-tools, and sometimes pkg-config/musl-dev depending on dependencies). Add an explicit install step before these checks so the workflow doesn't fail due to missing musl-gcc/linker tooling.
    .github/workflows/ci.yml:21
  • Since this job now runs on pull_request (label-triggered), be careful not to pass registry credentials during PR runs. The current workflow still runs the Docker setup composite action with DockerHub/GHCR tokens, which makes those credentials available to PR code even if the upload step is push-only. Consider gating the login/credential passing to push events (or moving login/push into a separate push-only job) so PR builds never receive registry write credentials.
    .github/workflows/ci.yml:24
  • The job runs on pull_request (label-triggered) but grants id-token: write and packages: write to the PR workflow run. This is an unnecessary privilege escalation for PR builds and increases the blast radius if a workflow change is introduced in a PR. Consider splitting into separate jobs so PR builds run with read-only permissions, and only the push-triggered job has packages: write/id-token: write for publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shahan-khatchadourian-anchorage shahan-khatchadourian-anchorage marked this pull request as draft March 27, 2026 02:42
@shahan-khatchadourian-anchorage shahan-khatchadourian-anchorage changed the title ci: restructure workflows into check.yml and ci.yml ci(stagex): label-triggered PR builds and deferred GHCR login Mar 27, 2026
@shahan-khatchadourian-anchorage shahan-khatchadourian-anchorage changed the title ci(stagex): label-triggered PR builds and deferred GHCR login ci: label-triggered stagex builds and cache/credential fixes Mar 27, 2026
- PR image builds now require the `stagex` label instead of
  auto-triggering on path changes. Push to main/tags unchanged.
- GHCR credentials moved after build step so build runs without
  registry write access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The action's bundled Swatinem/rust-cache fails because Cargo.toml is
in src/, not the repo root. The manual actions/cache step already
handles caching correctly. Disabling removes the error noise.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shahan-khatchadourian-anchorage added a commit that referenced this pull request Apr 11, 2026
Incorporates changes from PR #226:
- stagex.yml: PR builds require `stagex` label instead of auto-triggering
  on path changes. GHCR login moved after build step.
- main.yml: disable setup-rust-toolchain built-in cache which fails
  because Cargo.toml is in src/, not repo root.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shahan-khatchadourian-anchorage
Copy link
Copy Markdown
Contributor Author

Superseded by PR #232 which now incorporates these changes (commit 2bf5b2c).

shahan-khatchadourian-anchorage added a commit that referenced this pull request Apr 11, 2026
- Add images/parser_cli/Containerfile for Solana-only CLI build
- Add parser_cli target to Makefile and stagex.yml matrix
- stagex.yml: PR builds require `stagex` label instead of
  auto-triggering on path changes; GHCR login moved after build
- main.yml: disable setup-rust-toolchain built-in cache (Cargo.toml
  is in src/, not repo root)

Incorporates PR #226 (now closed).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shahan-khatchadourian-anchorage added a commit that referenced this pull request Apr 13, 2026
## Summary

- Add `images/parser_cli/Containerfile` for Solana-only CLI build using
StageX
- Add `parser_cli` target to `Makefile` and `stagex.yml` matrix
- **Incorporates PR #226**: stagex PR builds now require the `stagex`
label instead of auto-triggering on path changes; GHCR login moved after
build; disable setup-rust-toolchain built-in cache in main.yml

Replaces #232 (rebased). Stacked on #224.

## Test plan

- [ ] StageX build passes for `parser_cli` in CI (add `stagex` label to
trigger)
- [ ] Existing `parser_app` and `parser_gateway` builds unaffected
- [ ] Push to main with relevant path changes still triggers the build
- [ ] GHCR push still works on push to main

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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