Skip to content

Migrate emergency-rollback job to have optional github actions route#395

Open
jaredly wants to merge 4 commits into
masterfrom
emergency-rollback
Open

Migrate emergency-rollback job to have optional github actions route#395
jaredly wants to merge 4 commits into
masterfrom
emergency-rollback

Conversation

@jaredly
Copy link
Copy Markdown
Contributor

@jaredly jaredly commented May 27, 2026

Summary:

  • Add USE_GITHUB_BRIDGE to emergency-rollback.groovy, defaulting to false
  • Keep the existing Jenkins rollback implementation as the default path
  • When bridge mode is enabled, dispatch Khan/webapp/.github/workflows/emergency-rollback.yml on master and wait for completion
  • Preserve Jenkins wrapper behavior for job notifications and follow-up deploy E2E trigger

Context:

This is the Jenkins side of migrating emergency rollback to GitHub Actions. During the bridge phase, Jenkins remains the operator entrypoint and keeps the old rollback path available as fallback.

The GitHub Actions path runs rollback in webapp and sends rollback-specific Slack messages from Actions. Jenkins still controls the job-level notify(...) wrapper and triggers ../deploy/e2e-test after a successful non-dry-run rollback.

Issue: https://khanacademy.atlassian.net/browse/INFRA-11068

Test Plan:

  • git diff --check -- jobs/emergency-rollback.groovy .tasks/migrate-jobs/emergency-rollback/implementation-log.md
  • Groovy syntax check using a temporary copy with Jenkins @Library stripped and src on the classpath:
    • perl -ne 'print unless /^@Library/' jobs/emergency-rollback.groovy > /tmp/emergency-rollback.compile.groovy
    • `groovy -cp src -c UTF-8 /tmp/emergency-rollback.compile.groovy

jaredly added 4 commits May 20, 2026 11:54
…ions bridge

Summary:
- Adds an opt-in `USE_GITHUB_BRIDGE` path to `merge-branches.groovy`, preserving the existing Jenkins merge behavior as the default.
- Adds a `merge-branches` GitHub Actions workflow in `webapp` plus a Python merge script that preserves Jenkins merge semantics.
- Keeps Slack and Buildmaster notification ownership in Jenkins during bridge mode by downloading a workflow result artifact and calling `buildmaster.notifyMergeResult(...)` from Jenkins.
- Extends `runGithubAction` with `dispatchAndWait(...)` so callers can get the completed Actions run id.

Test Plan:
- `python3 -m unittest deploy.merge_branches_test`
- `python3 -m py_compile deploy/merge_branches.py deploy/merge_branches_test.py`
- `actionlint .github/workflows/merge-branches.yml`
- `git diff --check`
- Local Groovy parse check for changed Jenkins scripts, with Jenkins `@Library` stripped for local parsing.
…github actions route

- Add `USE_GITHUB_BRIDGE` to `emergency-rollback.groovy`, defaulting to `false`
- Keep the existing Jenkins rollback implementation as the default path
- When bridge mode is enabled, dispatch `Khan/webapp/.github/workflows/emergency-rollback.yml` on `master` and wait for completion
- Preserve Jenkins wrapper behavior for job notifications and follow-up deploy E2E trigger

Context:

This is the Jenkins side of migrating emergency rollback to GitHub Actions. During the bridge phase, Jenkins remains the operator entrypoint and keeps the old rollback path available as fallback.

The GitHub Actions path runs rollback in `webapp` and sends rollback-specific Slack messages from Actions. Jenkins still controls the job-level `notify(...)` wrapper and triggers `../deploy/e2e-test` after a successful non-dry-run rollback.

Test Plan:

- `git diff --check -- jobs/emergency-rollback.groovy .tasks/migrate-jobs/emergency-rollback/implementation-log.md`
- Groovy syntax check using a temporary copy with Jenkins `@Library` stripped and `src` on the classpath:
  - `perl -ne 'print unless /^@Library/' jobs/emergency-rollback.groovy > /tmp/emergency-rollback.compile.groovy`
  - `groovy -cp src -c UTF-8 /tmp/emergency-rollback.compile.groovy
@jaredly jaredly self-assigned this May 27, 2026
@jaredly jaredly marked this pull request as ready for review May 27, 2026 21:52
@jaredly jaredly requested a review from a team as a code owner May 27, 2026 21:52
@jaredly jaredly changed the base branch from delete-versions to master May 29, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants