feat: add optional scope input for affected-since-last-release - #30
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
| /** | ||
| * Scenario scope: `affected` (only scenarios impacted since the last release, | ||
| * on a matching release tag) or `full` (whole suite). Ignored when | ||
| * `userStoryTypes` or `userStoryIds` is set. Omit to let the server self-gate. | ||
| */ | ||
| scope?: string |
There was a problem hiding this comment.
why don't we have a dedicated literal type here so it's explicit what is waited here, and we odn't need to expain in pain code comments ?
There was a problem hiding this comment.
Good call — replaced scope?: string with a dedicated exported RunScope = 'affected' | 'full' literal type (in src/api.ts), used it in main.ts, and dropped the explanatory comment since the type is now self-documenting. Pushed in d0a469d.
What
Adds an optional `scope` input to the action, passed through to `POST /api/v1/ci/run` as the `scope` field.
`scope` is ignored when `user-stories` or `user-story-types` is set (those already select an explicit scenario set). Invalid values fail fast in the action.
Why
Companion to testing-service PR https://github.com/minitap-ai/testing-service/pull/785, which teaches `/ci/run` to run only scenarios affected since the last release on a matching release tag. This lets a customer's workflow explicitly opt in/out via the action input; without it the server still self-gates.
Changes (source only)
`dist/` is intentionally not committed here — it is force-committed at release time by `release.yml`.
Verification
`npm run build` / `lint` / `format:check` / `bundle` all clean; `scope` confirmed present in the rebuilt bundle.