[ISSUE-139] Parameterize portainer-automation build workflow for multi-environment reuse #141
No reviewers
Labels
No Label
architect:complete
blocked-by:#139
blocks:#140
bug
CI/CD
complexity:low
complexity:medium
complexity:medium
config
depends-on:#124
docker
docs
effort:l
effort:s
effort:xs
epic/development
lead:complete
needs-decision
performance
priority:critical
priority:high
priority:low
priority:medium
security
spike
story-points:1
story-points:3
story-points:5
story-points:8
tech-debt
test
user-story
architect:complete
complexity:high
complexity:low
complexity:medium
cross-repo
cross-repo-dev
dev:in-progress
effort:l
effort:m
effort:s
effort:xl
effort:xs
epic
analytics
epic
development
epic
devops
epic
infra
epic
observability
epic
platform
epic
product
lead:complete
needs-decision
pipeline-complete
pipeline-error
pipeline-running
priority
later
priority
next
priority
now
start-pipeline
status
acceptance
status
blocked
status
done
status
in progress
status
in review
status
in testing
status
ready
status
refine
status
triage
subtask
type
analysis
type
bug
type
hygiene
type
mantainence
type
story
user-story
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Hithomelabs/CFTunnels#141
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Dave/CFTunnels:ISSUE-139"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Refactors
.gitea/workflows/portainer_automation_build_push.ymlinto a single parameterized workflow supporting both test and production environments, following the final architecture spec approved by Archie and hitanshu.Key Changes
testonlytest+main+workflow_dispatchpa-0.x.x0.x.x(no prefix)workflow_dispatchwith env choiceTrigger → Behavior Matrix
test0.x.y,testmain0.x.0,prodworkflow_dispatchtest0.x.y,testworkflow_dispatchprod0.x.0,prodIssues
Testing
test→ verify build + tag + pushworkflow_dispatchwithenv: testmanuallymain→ verify prod promotionworkflow_dispatchwithenv: prodmanuallyPR Review: [ISSUE-139] Parameterize portainer-automation build workflow for multi-environment reuse
Code Quality
Security
${{ secrets.TOKEN }}for registry authTesting
Recommendations
Tag prefix change (
pa-→ removed) — The issue #139 spec explicitly states tags should usepa-<version>prefix (e.g.pa-0.x.x). The PR changed this to just<version>(e.g.0.x.x). Please confirm this was agreed upon with the architect (@Archie) or PM (@Polly). If there's a decision to drop the prefix, it should be documented in the issue. This also affects thePORTAINER_STACK.mdreference mentioned in the tech notes.container:context limitation — Thebuild-and-pushjob usescontainer: image: 192.168.0.100:8928/hithomelabs/ci-runner:1.0.0. Running inside a container means Docker-in-Docker (DinD) behavior depends on the runner's Docker socket mount. If the runner doesn't mount/var/run/docker.sock, thedockercommands inside therun:steps will fail. Consider adding a comment or checking that the CI runner is configured with the Docker socket.docker pullon prod promotion — On the prod promotion path, you dodocker pull "${REG}:test"then tag as prod. If the test image was just built in a different CI runner instance,docker pullmay pull a stale cached version. Consider usingdocker pullwith--platformor explicit digest pinning to ensure you get the right image.Version tag collision edge case — When switching from
pa-prefix to no prefix, existing tags like0.1.0may conflict with oldpa-0.1.0tags if they exist. Thegit describe --tags --abbrev=0will pick up whichever is latest. Consider cleaning up oldpa-*tags or filtering them out in the semver calculation.workflow_dispatchrefbehavior — When usingworkflow_dispatch, the default checkout ref is the default branch (main), nottest. The prod promotion path (docker pulltest image and tag as prod) would work correctly only if the test image was already built. However, if someone triggersworkflow_dispatchwithenv: testfrommain, it will build frommaincode which may not be tested yet. Consider documenting this behavior clearly.Approval Status
REVIEW COMPLETE — APPROVED with minor recommendations above. The changes are well-structured and correctly implement the parameterization logic.
PR Review: [ISSUE-139] Parameterize portainer-automation build workflow
Code Quality
workflow_dispatchSecurity
Testing
test→ build + tag + pushworkflow_dispatchwithenv: testmain→ prod promotionworkflow_dispatchwithenv: prodConcerns & Recommendations
⚠️ Git tag prefix removal — The change from
pa-0.x.xto0.x.xgit tags is significant. If any external tooling, scripts, or automation depend on thepa-prefix to identify portainer-automation releases, they will break. Confirm this is intentional and coordinate with any consumers.⚠️ Prod promotion assumes test image exists — The prod path does
docker pull "${REG}:test"which assumes atest-tagged image already exists in the registry. If the test workflow has never run or recently failed, this step will fail. Consider adding a fallback or validation step.Minor: Workflow name change — The workflow name changed from
portainer-automation build and pushtoBuild & Push Portainer Automation. Verify that no notifications or dashboards filter on the old workflow name.Optional: Add
if: success()guard — Thebuild-and-pushjob depends onversionbut doesn't have an explicitif: success()condition. While not strictly required, adding it makes the dependency intent explicit.Approval Status
APPROVED — Well-structured refactor. The concerns above are non-blocking but should be reviewed before merge.
Technical Review Summary
Effort Estimate
Complexity Assessment
pa-→ none) could impact downstream consumers; prod promotion depends on test image existenceImplementation Checklist
workflow_dispatchsupportRegarding the concerns:
We don't gave any consumers for this, a change won't hurt, @Polly create an issue to reflect this in
PORTAINER_STACK.mdand add it to backlog so we address it.This is by design, if someone tries to hurry to PROD without testing in lower envs. stuff should fail.
Acknowledged ✅
Thanks for the clarifications, @hitanshu. Both concerns are resolved:
Tag prefix (
pa-): Understood — no existing consumers, so the change is safe. Appreciate the action item for @Polly to updatePORTAINER_STACK.mdand track it in the backlog.Prod promotion depending on test image: Understood — this is an intentional guardrail. The explicit failure on missing test image is a feature, not a bug. Good design choice.
The PR has already been merged. These responses satisfy all the concerns raised in the review. No further action needed from my end.
Backlog issue created: #142 — Update PORTAINER_STACK.md to reflect git tag prefix change
Added to milestone Portainer Automation — Production & Parameterization (#5) with
docs/effort:xs/priority:lowlabels.The issue covers removing references to the old
pa-tag prefix and documenting the new plain semver convention (0.x.y) in PORTAINER_STACK.md.