Skip to content

Commit b8f888c

Browse files
spectr(archive): add-ci-workflow-init-option (#162)
Archived to: spectr/changes/archive/2025-12-07-add-ci-workflow-init-option/ Spec operations applied: + 1 added Generated by: spectr pr archive
1 parent ddbf541 commit b8f888c

4 files changed

Lines changed: 79 additions & 0 deletions

File tree

spectr/changes/add-ci-workflow-init-option/proposal.md renamed to spectr/changes/archive/2025-12-07-add-ci-workflow-init-option/proposal.md

File renamed without changes.

spectr/changes/add-ci-workflow-init-option/specs/cli-interface/spec.md renamed to spectr/changes/archive/2025-12-07-add-ci-workflow-init-option/specs/cli-interface/spec.md

File renamed without changes.

spectr/changes/add-ci-workflow-init-option/tasks.md renamed to spectr/changes/archive/2025-12-07-add-ci-workflow-init-option/tasks.md

File renamed without changes.

spectr/specs/cli-interface/spec.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,85 @@ This prompt helps users maintain a clean working directory by offering an opport
14551455
- **THEN** display a warning: "Warning: Failed to remove change directory: <error>"
14561456
- **AND** the command still exits successfully (non-fatal error)
14571457

1458+
### Requirement: CI Workflow Setup Option in Init Wizard Review Step
1459+
The initialization wizard's Review step SHALL include an optional checkbox to create a GitHub Actions workflow file (`.github/workflows/spectr-ci.yml`) for automated Spectr validation during CI/CD. This option is presented alongside the tool selection summary, keeping the wizard flow quick without adding a separate step.
1460+
1461+
#### Scenario: CI option displayed in Review step
1462+
- **WHEN** user completes tool selection and proceeds to the Review step
1463+
- **THEN** a "Spectr CI Validation" checkbox option is displayed after the tool summary
1464+
- **AND** the option appears before the creation plan section
1465+
- **AND** a description explains: "Validate specs automatically on push and pull requests"
1466+
1467+
#### Scenario: CI option detects existing workflow
1468+
- **WHEN** user runs `spectr init` on a project that already has `.github/workflows/spectr-ci.yml`
1469+
- **AND** user reaches the Review step
1470+
- **THEN** the "Spectr CI Validation" option shows a "(configured)" indicator
1471+
- **AND** the option is pre-selected by default
1472+
- **AND** selecting it will update the existing workflow file
1473+
1474+
#### Scenario: CI option not pre-selected on fresh projects
1475+
- **WHEN** user runs `spectr init` on a project without `.github/workflows/spectr-ci.yml`
1476+
- **AND** user reaches the Review step
1477+
- **THEN** the "Spectr CI Validation" option is NOT pre-selected by default
1478+
- **AND** the user must explicitly select it to enable CI workflow creation
1479+
1480+
#### Scenario: User toggles CI option in Review step
1481+
- **WHEN** user is on the Review step
1482+
- **AND** user presses Space
1483+
- **THEN** the CI workflow checkbox toggles between selected and unselected
1484+
- **AND** the creation plan updates to reflect the change
1485+
- **AND** the visual state updates immediately
1486+
1487+
#### Scenario: CI workflow created when selected
1488+
- **WHEN** user selects the "Spectr CI Validation" option in Review
1489+
- **AND** user presses Enter to proceed with initialization
1490+
- **THEN** the system creates `.github/workflows/` directory if it doesn't exist
1491+
- **AND** the system creates `.github/workflows/spectr-ci.yml` with the Spectr validation workflow
1492+
- **AND** the workflow file is tracked in the execution result as created or updated
1493+
1494+
#### Scenario: CI workflow not created when unselected
1495+
- **WHEN** user does NOT select the "Spectr CI Validation" option
1496+
- **AND** user proceeds with initialization
1497+
- **THEN** no `.github/workflows/spectr-ci.yml` file is created
1498+
- **AND** any existing `.github/workflows/spectr-ci.yml` file is left unchanged
1499+
1500+
#### Scenario: CI workflow content uses pinned action version
1501+
- **WHEN** the CI workflow file is created
1502+
- **THEN** the workflow contains a single `spectr-validate` job
1503+
- **AND** the workflow uses `connerohnesorge/spectr-action@v0.0.2` (pinned version)
1504+
- **AND** the workflow triggers on push to `main` branch only
1505+
- **AND** the workflow triggers on pull requests to all branches
1506+
- **AND** the workflow uses `fetch-depth: 0` for full git history
1507+
- **AND** the workflow includes concurrency management to cancel in-progress runs
1508+
- **AND** the workflow runs on `ubuntu-latest`
1509+
1510+
#### Scenario: Creation plan shows CI workflow when enabled
1511+
- **WHEN** user has selected the "Spectr CI Validation" option
1512+
- **THEN** the creation plan section shows `.github/workflows/spectr-ci.yml`
1513+
- **AND** the file is listed with the tool configurations
1514+
1515+
#### Scenario: Creation plan hides CI workflow when disabled
1516+
- **WHEN** user has NOT selected the "Spectr CI Validation" option
1517+
- **THEN** the creation plan does NOT mention `.github/workflows/spectr-ci.yml`
1518+
1519+
#### Scenario: Completion screen shows CI workflow file
1520+
- **WHEN** the CI workflow file is successfully created
1521+
- **THEN** the completion screen lists `.github/workflows/spectr-ci.yml` in created or updated files
1522+
- **AND** the file path is displayed with the appropriate icon
1523+
1524+
#### Scenario: Non-interactive mode supports CI workflow flag
1525+
- **WHEN** user runs `spectr init --non-interactive --ci-workflow`
1526+
- **THEN** the CI workflow file is created without TUI interaction
1527+
- **AND** the workflow file content matches the interactive mode output
1528+
1529+
#### Scenario: Non-interactive mode without CI flag skips workflow
1530+
- **WHEN** user runs `spectr init --non-interactive` without `--ci-workflow`
1531+
- **THEN** no CI workflow file is created
1532+
- **AND** existing workflow files are not modified
1533+
1534+
#### Scenario: Review step help text includes Space for toggle
1535+
- **WHEN** user is on the Review step
1536+
- **THEN** the help text shows: "Space: Toggle CI Enter: Initialize Backspace: Back q: Quit"
14581537
### Requirement: PR Remove Subcommand
14591538

14601539
The `spectr pr rm` subcommand SHALL create a pull request that removes a change directory from the repository, using the same git worktree isolation as other PR subcommands.

0 commit comments

Comments
 (0)