ReviewOS

also looking at this

stacks/buddy

fix: keep the low-tier promises — bulk-update label, event-name validation, workflow personalisation

#1434
Merged glennmichael123 wants to merge fix/low-tier-wiring into main
9 files +325 -13
bin/cli.tsmodified+33-0
Changes to bin/cli.ts
@@ -290,6 +290,12 @@ interface CLIOptions {
290290 ignore?: string
291291 dryRun?: boolean
292292 respectLatest?: boolean
293 /** Comma-separated reviewers `update` assigns, overriding `pullRequest.reviewers` */
294 reviewers?: string
295 /** Comma-separated assignees `update` assigns, overriding `pullRequest.assignees` */
296 assignees?: string
297 /** Comma-separated labels `update` adds, overriding `pullRequest.labels` */
298 labels?: string
293299 /** Which settings pages `open-settings` should open: repo, org or both. */
294300 type?: string
295301 /** Set by the generated workflow: honour the `ai.review` filters. */
@@ -844,6 +850,9 @@ cli
844850 .option('--strategy <type>', 'Update strategy: major|minor|patch|all', { default: 'all' })
845851 .option('--ignore <names>', 'Comma-separated list of packages to ignore')
846852 .option('--dry-run', 'Preview changes without making them')
853 .option('--reviewers <names>', 'Comma-separated reviewers to assign (overrides pullRequest.reviewers)')
854 .option('--assignees <names>', 'Comma-separated assignees to assign (overrides pullRequest.assignees)')
855 .option('--labels <names>', 'Comma-separated labels to add (overrides pullRequest.labels)')
847856 .option('--respect-latest', 'Respect "latest", "*", and other dynamic version indicators (default: true)')
848857 .option('--no-respect-latest', 'Allow updating "latest", "*", and other dynamic version indicators')
849858 .example('buddy update')
@@ -864,9 +873,26 @@ cli
864873 ignore = options.ignore.split(',').map(p => p.trim())
865874 }
866875
876 // Per-run PR overrides, from the flags a generated workflow passes.
877 // Folded in only when given: `pullRequest` staying unset is itself a
878 // setting, and materialising an empty block would change what runs.
879 const splitList = (value?: string): string[] | undefined =>
880 value ? value.split(',').map(part => part.trim()).filter(Boolean) : undefined
881 const reviewers = splitList(options.reviewers)
882 const assignees = splitList(options.assignees)
883 const labels = splitList(options.labels)
884 const prOverrides = {
885 ...(reviewers ? { reviewers } : {}),
886 ...(assignees ? { assignees } : {}),
887 ...(labels ? { labels } : {}),
888 }
889
867890 const finalConfig: BuddyConfig = {
868891 ...config,
869892 verbose: options.verbose ?? config.verbose,
893 ...(Object.keys(prOverrides).length
894 ? { pullRequest: { ...config.pullRequest, ...prOverrides } }
895 : {}),
870896 packages: {
871897 ...config.packages,
872898 strategy: options.strategy ?? config.packages?.strategy ?? 'all',
@@ -1864,6 +1890,13 @@ cli
18641890 const logger = options.verbose ? Logger.verbose() : Logger.quiet()
18651891 const config = await resolveConfig(options.config)
18661892
1893 // Explicit `false` only, the same reading the dashboard uses: a
1894 // repository that never wrote a `workflows` block keeps the command.
1895 if (config.workflows?.enabled === false) {
1896 logger.info('\u2139\ufe0f Workflow generation is disabled by config (workflows.enabled: false)')
1897 return
1898 }
1899
18671900 console.log('⚠️ The "generate-workflows" command is deprecated.')
18681901 console.log('💡 Use "buddy setup" for a better interactive experience.\n')
18691902