Skip to content

feat(cli): add -C cohort flag to sprouts list and jobs list#272

Merged
taigrr merged 1 commit into
masterfrom
cd/cohort-targeting-cli
Mar 31, 2026
Merged

feat(cli): add -C cohort flag to sprouts list and jobs list#272
taigrr merged 1 commit into
masterfrom
cd/cohort-targeting-cli

Conversation

@taigrr
Copy link
Copy Markdown
Member

@taigrr taigrr commented Mar 31, 2026

Summary

Extends cohort targeting (-C flag) to additional CLI commands that benefit from it:

Changes

sprouts list -C <cohort>

  • Resolves the cohort and filters the sprout list to only members of that cohort
  • Combines with existing --state and --online filters

jobs list -C <cohort>

  • Resolves the cohort and fetches jobs for each member sprout
  • Mutually exclusive with the positional sproutID argument (errors if both given)

Cohort targeting coverage

Command Flag Status
cook -C Already existed
cmd -C Already existed
test ping -C Already existed
ssh -C Already existed
sprouts list -C New
jobs list -C New

Tests

New targeting_test.go with comprehensive coverage:

  • resolveEffectiveTarget edge cases (single target, regex, comma-separated, both-set error, neither-set error)
  • Flag registration verification for all commands supporting cohort targeting
  • Cook Use string documentation check

All existing tests pass. Lint clean.

Add cohort targeting support to additional CLI commands:

- sprouts list: new -C/--cohort flag filters the sprout list to
  only members of the specified cohort
- jobs list: new -C/--cohort flag resolves a cohort and fetches
  jobs for each member sprout (mutually exclusive with positional
  sproutID argument)

Also adds targeting_test.go with comprehensive tests covering:
- resolveEffectiveTarget edge cases (single, regex, comma-separated,
  both-set error, neither-set error)
- Flag registration verification for all commands that support
  cohort targeting (cook, cmd, test, ssh, sprouts list, jobs list)
- Cook Use string documentation check
@taigrr taigrr merged commit 58df093 into master Mar 31, 2026
6 of 7 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