feat(e2e): plumb act event payload and env/* branch fetch#112
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two harness gaps blocked the hotfix e2e flow:
RunOpts.EventJSONwas declared inact.gobut never plumbed into the act invocation - the event payload was silently dropped on every run.SyncRepoToActContaineronly fetchedorigin main; act jobs that inspectenv/*branches or tags (plan/apply/finalize) could not see them.Changes
RunOpts.EventJSONis set, write the payload to/tmp/cascade-event.jsoninside the act container viaCopyToContainer, then pass-e /tmp/cascade-event.jsonto the act invocation. Applies to both act run paths (RunWorkflowandRunWorkflowFromRepo). Flag construction is factored into a pureeventFileArgshelper for unit testing.SyncRepoToActContainer): after the load-bearinggit fetch origin main && git reset --hard origin/main, also fetch+refs/heads/env/*:refs/remotes/origin/env/*and--tags, mirroring the fetch step in the generated hotfix workflow. The extra fetch is non-fatal (|| true) so the bounded-retry and lost-commit guarantees are preserved.localizeWorkflows): confirmed the existing yaml glob coverscascade-hotfix.yaml; added a comment noting the workflowname:field is only suffixed (not rewritten), preserving futureworkflow_filesassertions over hotfix job/trigger content.-e <file>appears in the act command when an event payload is written and is omitted otherwise.Apply-job strategy (recorded, not implemented here)
The generated apply job shells out to
gh pr create/gh pr merge --auto, which does not speak Gitea's API. Therefore the apply job is not run under act. A later unit will drive the cherry-pick/PR/merge via harness primitives (real git cherry-pick + Gitea PRs), and then fire the merged-PR event payload (assembled by this EventJSON plumbing) so act runs the context/build/deploy/finalize jobs for real.Verification
go build ./...andgo vet ./...pass for both root and e2e modules.TestMultiStepScenarios/Two_EnvironmentandThree_Environmentpass (no regression).eventFileArgs/buildActArgsunit tests pass.golangci-lint run ./e2e/...clean.