|
| 1 | +--- |
| 2 | +title: "Manual Test Plan - Issue #1022: Apostrophe in Workflow Dispatch Reason Crashes Weekly Promotion" |
| 3 | +status: Open |
| 4 | +priority: Medium |
| 5 | +labels: testing, ci |
| 6 | +--- |
| 7 | + |
| 8 | +# Test Objective |
| 9 | + |
| 10 | +Confirm that the `weekly-nightly-promotion` workflow completes successfully when the manual trigger `reason` field contains an apostrophe (e.g., `it's`), and that the PR body reflects the reason correctly. |
| 11 | + |
| 12 | +# What Was Fixed |
| 13 | + |
| 14 | +The `Create Promotion PR` step previously injected `${{ inputs.reason }}` directly into a bash heredoc. An apostrophe in the reason value (e.g., `it's an ad-hoc run`) broke the shell quoting and caused the step to fail with a syntax error. |
| 15 | + |
| 16 | +The fix moves `inputs.reason` into a dedicated `TRIGGER_REASON` environment variable, which is then read inside the `actions/github-script` step via `process.env.TRIGGER_REASON`. This isolates the user-supplied string from the shell entirely. |
| 17 | + |
| 18 | +Manual testing is required because this workflow runs against the live GitHub Actions environment and cannot be fully covered by unit or integration tests. |
| 19 | + |
| 20 | +# Prerequisites |
| 21 | + |
| 22 | +- Write access to the repository (to trigger `workflow_dispatch`). |
| 23 | +- The `nightly` branch must exist and have at least one commit ahead of `main`, **or** `skip_workflow_check` must be set to `true` to bypass the health gate. |
| 24 | +- A GitHub account with permission to view Actions run logs. |
| 25 | + |
| 26 | +# Manual Scenarios |
| 27 | + |
| 28 | +## 1) Apostrophe in reason — primary regression check |
| 29 | + |
| 30 | +- [ ] Navigate to **Actions → Weekly Nightly to Main Promotion → Run workflow**. |
| 31 | +- [ ] Set **Why are you running this manually?** to: `it's a manual test run` |
| 32 | +- [ ] Set **Skip nightly workflow status check?** to `true` (avoids a failing nightly blocking the test). |
| 33 | +- [ ] Click **Run workflow**. |
| 34 | +- [ ] Wait for the run to complete. |
| 35 | +- [ ] **Expected**: The run completes without a syntax error. All jobs show green (or the run skips the PR-creation job with "No changes to promote" if `nightly` is already up-to-date with `main` — both are acceptable outcomes). |
| 36 | +- [ ] Open the run logs for the **Create Promotion PR** step. |
| 37 | +- [ ] **Expected**: No `syntax error` or `unexpected token` entries in the log. |
| 38 | +- [ ] If a PR was created, open it and confirm the **Trigger** line in the PR body reads: `it's a manual test run`. |
| 39 | + |
| 40 | +## 2) Double apostrophe / multiple special characters |
| 41 | + |
| 42 | +- [ ] Trigger the workflow again with reason: `can't stop, won't stop` |
| 43 | +- [ ] Set **Skip nightly workflow status check?** to `true`. |
| 44 | +- [ ] **Expected**: Run completes. PR body (if created) or log output contains the reason verbatim. |
| 45 | + |
| 46 | +## 3) Plain-text reason — regression check |
| 47 | + |
| 48 | +- [ ] Trigger the workflow with reason: `Ad-hoc promotion request` (the default value, no special characters). |
| 49 | +- [ ] **Expected**: Run behaves identically to before the fix. No regressions introduced. |
| 50 | + |
| 51 | +## 4) Scheduled trigger (no `inputs.reason`) |
| 52 | + |
| 53 | +- [ ] Review a recent scheduled Monday run in the Actions history (or re-run one). |
| 54 | +- [ ] **Expected**: The `TRIGGER_REASON` env var falls back to `'Scheduled weekly promotion'` and the PR body reflects that. No errors introduced by the env-var change. |
| 55 | + |
| 56 | +# Expected Results |
| 57 | + |
| 58 | +| Scenario | Expected outcome | |
| 59 | +|---|---| |
| 60 | +| Reason with apostrophe | Workflow completes; no shell syntax error | |
| 61 | +| Reason with multiple special chars | Workflow completes; reason appears verbatim in PR body | |
| 62 | +| Plain-text reason | No regression; workflow behaves as before | |
| 63 | +| Scheduled run | Fallback reason used; no errors | |
| 64 | + |
| 65 | +# Pass / Fail Criteria |
| 66 | + |
| 67 | +**PASS** — All four scenarios complete without a `syntax error` or `unexpected token` in the logs, and user-supplied reason text appears correctly in the PR body or step output. |
| 68 | + |
| 69 | +**FAIL** — Any scenario produces a shell syntax error, an unexpected token error, or the reason field is garbled/missing in the PR body. |
| 70 | + |
| 71 | +# Related |
| 72 | + |
| 73 | +- Issue #1022 — Apostrophe in `workflow_dispatch` reason causes syntax error in weekly promotion workflow |
0 commit comments