refactor: simplify AWS CodeArtifact publishing to use AWS secrets + PYPI_REPOSITORY_URL#886
refactor: simplify AWS CodeArtifact publishing to use AWS secrets + PYPI_REPOSITORY_URL#886
Conversation
Add a new CodeArtifact job to both GitHub Actions and GitLab CI release workflows. The job is conditional on AWS_CODEARTIFACT_DOMAIN being set and uses OIDC-based role assumption (GitHub) or CI/CD variables (GitLab) for credential-free authentication. - Add `codeartifact` job to `.github/workflows/rhiza_release.yml` - Add `release:codeartifact` job to `.gitlab/workflows/rhiza_release.yml` - Update finalise-release jobs to include CodeArtifact links in release notes - Add comprehensive setup instructions to RELEASING.md - Update architecture diagrams and documentation Co-authored-by: markrichardson <5681211+markrichardson@users.noreply.github.com> Agent-Logs-Url: https://github.com/Jebel-Quant/rhiza/sessions/ecb241b0-b8bf-4bb7-a48b-7467c69e6fec
|
@tschm @HarryCampion ... reasonable? |
If we're going down the route of very custom deployments like this we should split these into actions. Release will get very big otherwise. I have not used AWS CodeArtifact before. What's the use case? |
|
We would want to eventually have a number of standard options catered for out of the box: PyPi (done already as the standard), but also Azure, AWS, Nexus. So some way of the rhiza user abstractly specifying what they want in this regard upfront would be good. Thinking about the way bundles work, something simliar would be useful here. (User states in a yaml somehow ... "I am publishing artifacts to AWS, not PyPi, here are all the details you need to make it happen") |
Think most get covered by the action we use if twine can upload, otherwise makes sense. They need to be actions that can be included and excluded in the template, other rhiza release is going to bundle too much into one workflow. |
|
it looks like twine can be used. but claude thinks it needs changes to the the rhiza-release.yml also |
|
@HarryCampion the "make release" flow is genuinely excellent it just works, which is very appreciated. It also looks like you already have the right infrastructure in place to test all of this properly. Have you come across JFrog? They’ve built quite a comprehensive ecosystem around artifact management and CI/CD. That said, Astral seems to be working on something that could potentially leapfrog a lot of the existing solutions. |
|
@claude[agent] I think it would be great to support additional endpoints for artifact feeds. Could you please refactor the release pipeline to allow different release actions to be injected depending on the 'artifact provider/storage mechanism'. This will eventually mean a user can define at the .rhiza/template.yml level what artifact feed they are using and not have to worry about configuring the release mechanism and also the rhiza release workflow is then not polluted. |
I understand the goal of making release targets configurable and preventing workflow bloat. However, I need to clarify the scope and approach before proceeding with this refactor. Current Architecture Analysis:
Concerns with Proposed Approach:
Proposed Alternative:
Would you like me to explore this reusable workflow approach, or would you prefer a different strategy? I want to ensure we solve the right problem before making significant architectural changes. |
|
please ensure the user can configure AWS CodeArtifact within Rhiza via provision of the following: Set two GitHub Secrets: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY |
Remove the separate codeartifact job from both GitHub Actions and GitLab CI workflows. Instead, integrate CodeArtifact support directly into the existing pypi job — auto-detect CodeArtifact URLs and fetch a temporary auth token using AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY secrets. Users configure just 3 things: - AWS_ACCESS_KEY_ID (secret) - AWS_SECRET_ACCESS_KEY (secret) - PYPI_REPOSITORY_URL (variable, set to CodeArtifact endpoint) Co-authored-by: markrichardson <5681211+markrichardson@users.noreply.github.com> Agent-Logs-Url: https://github.com/Jebel-Quant/rhiza/sessions/d31294fb-ccb9-44fc-8f54-4720cee99ca3
…fe pattern matching Co-authored-by: markrichardson <5681211+markrichardson@users.noreply.github.com> Agent-Logs-Url: https://github.com/Jebel-Quant/rhiza/sessions/d31294fb-ccb9-44fc-8f54-4720cee99ca3
Done in f501825. Removed the separate Configuration is just 3 items:
The |
|
@markrichardson can you point dummyrepo at this to test publishing mechanism still works. E..g PRIVATE is not publishing? |
|
I don't think we ever set up dummyrepo to publish to pypi even so not sure what we could validate (or invalidate) doing this |
It would confirm the path it takes for deployment. It shouldn't publish. |
Summary
Simplifies the AWS CodeArtifact publishing support by integrating it directly into the existing PyPI publishing job, rather than as a separate workflow job. Users configure just three items: two GitHub Secrets (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY) and one GitHub Variable (PYPI_REPOSITORY_URLpointing to the CodeArtifact endpoint). The workflow auto-detects CodeArtifact URLs and handles token exchange transparently.Changes
GitHub Actions (
.github/workflows/rhiza_release.yml):codeartifactjob — CodeArtifact is now handled inline in thepypijobPYPI_REPOSITORY_URL, parses domain/region, and fetches a temporary auth token using AWS secretsawsusername) when available, falling back toPYPI_TOKENor OIDCPrivate :: Do Not Uploadcheck: now only blocks publishing to default PyPI — custom feeds (including CodeArtifact) still publishcodeartifactfromfinalise-releasedependencies and link generationGitLab CI (
.gitlab/workflows/rhiza_release.yml):release:codeartifactjob — same inline integration intorelease:pypirelease:finalizeto remove codeartifact dependencyDocumentation:
.rhiza/docs/RELEASING.md: simplified CodeArtifact setup to 3 configuration items with step-by-step instructionsdocs/ARCHITECTURE.md: updated release pipeline diagram (removed separate CodeArtifact box)docs/PRESENTATION.md,docs/CHANGELOG_GUIDE.md,.gitlab/TESTING.md,.gitlab/README.md: updated to reflect simplified approachUser configuration (all that's needed for CodeArtifact):
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYPYPI_REPOSITORY_URLNo OIDC setup, no domain/repository variables, no separate job. The workflow auto-detects CodeArtifact URLs and handles everything.
Testing
make testpasses locallymake fmthas been run (actionlint, shellcheck, markdownlint all pass)actionlintandcheck-jsonschemapre-commit hooks. Both YAML files parsed and structurally verified. No unit-testable application code was changed.Checklist
make deptrypasses (no unused or missing dependencies)Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.