feat(cli): multi-context simulation via --context flag
Add --context KEY=VALUE[,...] (repeatable) to glint check. When two or more --context flags are given, glint evaluates every pipeline job across all contexts and prints a side-by-side comparison table: glint check --context branch=main --context branch=develop .yml Each column shows active / manual / skipped / blocked per job. Known context keys are branch, tag, source (case-insensitive); any other KEY=VALUE pair is treated as a CI variable override. The --changes / --changes-from changed-file list is shared across all contexts. Implicit branch=main / source=push defaults are skipped when --context is used. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+18
@@ -151,6 +151,24 @@ Use `--list-vars` to print the resolved variable table to stderr.
|
||||
| `--changes PATH` | Mark PATH as changed; repeatable |
|
||||
| `--changes-from REF` | Run `git diff --name-only REF` to auto-detect changed files |
|
||||
|
||||
**Multi-context comparison** (`--context`):
|
||||
|
||||
Pass `--context KEY=VALUE[,...]` (repeatable) instead of `--branch`/`--tag`/`--source` to evaluate every job across multiple contexts simultaneously. Each `--context` flag defines one column; glint prints a table showing `active`, `manual`, `skipped`, or `blocked` per job per context.
|
||||
|
||||
Known context keys: `branch`, `tag`, `source` (case-insensitive). Any other `KEY=VALUE` pair is injected as a CI variable override. The `--changes`/`--changes-from` file list is shared across all contexts.
|
||||
|
||||
```
|
||||
glint check --context branch=main --context branch=develop .gitlab-ci.yml
|
||||
|
||||
Context comparison:
|
||||
|
||||
JOB branch=main branch=develop
|
||||
---------- ----------- -------------
|
||||
build-job active active
|
||||
deploy-job active skipped
|
||||
test-job active active
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Output formats
|
||||
|
||||
Reference in New Issue
Block a user