Skip to content

feat: add optional scope input for affected-since-last-release - #30

Merged
plfavreau merged 2 commits into
mainfrom
feat/scope-input
Jul 22, 2026
Merged

feat: add optional scope input for affected-since-last-release#30
plfavreau merged 2 commits into
mainfrom
feat/scope-input

Conversation

@plfavreau

Copy link
Copy Markdown
Contributor

What

Adds an optional `scope` input to the action, passed through to `POST /api/v1/ci/run` as the `scope` field.

  • `scope: affected` — run only scenarios affected since the last release
  • `scope: full` — run the whole suite
  • omitted — the server self-gates: on a release tag matching the app's configured tag pattern it runs affected; otherwise it keeps today's full-suite behavior

`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)

  • `action.yml` — new optional `scope` input
  • `src/main.ts` — read + validate (`affected`|`full`) + pass through
  • `src/api.ts` — `scope?: string` on `TriggerRunRequest` (pure JSON passthrough)

`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.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • rat-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e3a90c67-6236-48de-a8e1-e49f3ffe3c6f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Comment thread src/api.ts Outdated
Comment on lines +151 to +156
/**
* 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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@plfavreau
plfavreau merged commit 924e1c4 into main Jul 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant