/gaia-ci-edit

user-facing
Category:
Configuration
Lifecycle phase:
Any
Arguments:
[--add|--remove|--edit|--order] [env-id]

What it does

/gaia-ci-edit edits the CI/CD promotion chain -- add, remove, edit, or reorder environments. Each environment has an id, name, branch, CI provider, merge strategy, and CI checks. Changes cascade to workflow files and test-environment mappings.

When to use it

  • You need to add a new environment to the promotion chain (e.g., a QA stage).
  • You want to reorder environments or change which branch an environment targets.
  • You need to remove an environment that is no longer used.

Prerequisites

How to invoke

/gaia-ci-edit
/gaia-ci-edit --add
/gaia-ci-edit --remove staging
/gaia-ci-edit --edit prod
/gaia-ci-edit --order

What it does step by step

  1. Load current chain Reads the promotion chain from the configuration. Displays a formatted table of all environments.
  2. Present operation menu Shows options: add, remove, edit, reorder, view, exit.
  3. Apply operation Collects input for the chosen operation. The environment id is immutable. Removing the last environment is blocked.
  4. Validate and list cascade targets Validates the modified chain and lists all files that will be affected (workflow files, test-environment tiers, ci-setup.md).
  5. Confirm and write Shows the cascade targets and asks for confirmation. On confirm, writes the chain and cascades updates to affected files.
  6. Summary Displays what changed, which files were updated, and any warnings.

Inputs

InputSourceDescriptionExample
--addArgument (optional)Insert a new environment into the chain./gaia-ci-edit --add
--removeArgument (optional)Delete an existing environment (with safety scan)./gaia-ci-edit --remove staging
--editArgument (optional)Modify fields of an existing environment./gaia-ci-edit --edit prod
--orderArgument (optional)Reorder the promotion chain./gaia-ci-edit --order
env-idPositional argument (optional)The environment id to operate on./gaia-ci-edit --remove staging

Outputs

OutputLocationDescription
Updated promotion chainCI configurationThe modified promotion chain.
Cascaded filesWorkflow files, test-environment.yamlUpdated trigger branches and tier mappings.

Example session

> /gaia-ci-edit

Current promotion chain:
| Pos | ID      | Branch  | Environment | Merge Strategy |
|-----|---------|---------|-------------|----------------|
| 0   | staging | staging | Staging     | squash         |
| 1   | prod    | main    | Production  | merge          |

Operations: [a] add  [r] remove  [e] edit  [o] order  [v] view  [x] exit
> a

New environment ID: qa
Name: QA
Branch: qa
CI Provider: github_actions
Merge Strategy: squash
Insert at position: 0

Cascade targets:
  Workflows: .github/workflows/gaia-pre-merge.yml (branch: qa)
  test-environment.yaml tiers: (none affected)
  ci-setup.md (will be regenerated)

Apply this edit and cascade to the listed targets? [y/n]
> y

Environment added. Position 0 changed (PR target for feature branches).

What to run next

Troubleshooting

Cannot remove the last environment

The promotion chain must have at least one environment. Add a replacement first.

Field id is immutable

To rename an environment, remove the old one and add a new one.

Cascade failure

A downstream file could not be updated. The error reports the failing file and reason. The promotion chain itself was written successfully.