also looking at this
fix: keep the low-tier promises — bulk-update label, event-name validation, workflow personalisation
#1434
9 files
+325
-13
| @@ -290,6 +290,12 @@ interface CLIOptions { | ||
| 290 | 290 | ignore?: string |
| 291 | 291 | dryRun?: boolean |
| 292 | 292 | 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 | |
| 293 | 299 | /** Which settings pages `open-settings` should open: repo, org or both. */ |
| 294 | 300 | type?: string |
| 295 | 301 | /** Set by the generated workflow: honour the `ai.review` filters. */ |
| @@ -844,6 +850,9 @@ cli | ||
| 844 | 850 | .option('--strategy <type>', 'Update strategy: major|minor|patch|all', { default: 'all' }) |
| 845 | 851 | .option('--ignore <names>', 'Comma-separated list of packages to ignore') |
| 846 | 852 | .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)') | |
| 847 | 856 | .option('--respect-latest', 'Respect "latest", "*", and other dynamic version indicators (default: true)') |
| 848 | 857 | .option('--no-respect-latest', 'Allow updating "latest", "*", and other dynamic version indicators') |
| 849 | 858 | .example('buddy update') |
| @@ -864,9 +873,26 @@ cli | ||
| 864 | 873 | ignore = options.ignore.split(',').map(p => p.trim()) |
| 865 | 874 | } |
| 866 | 875 | |
| 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 | ||
| 867 | 890 | const finalConfig: BuddyConfig = { |
| 868 | 891 | ...config, |
| 869 | 892 | verbose: options.verbose ?? config.verbose, |
| 893 | ...(Object.keys(prOverrides).length | |
| 894 | ? { pullRequest: { ...config.pullRequest, ...prOverrides } } | |
| 895 | : {}), | |
| 870 | 896 | packages: { |
| 871 | 897 | ...config.packages, |
| 872 | 898 | strategy: options.strategy ?? config.packages?.strategy ?? 'all', |
| @@ -1864,6 +1890,13 @@ cli | ||
| 1864 | 1890 | const logger = options.verbose ? Logger.verbose() : Logger.quiet() |
| 1865 | 1891 | const config = await resolveConfig(options.config) |
| 1866 | 1892 | |
| 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 | ||
| 1867 | 1900 | console.log('⚠️ The "generate-workflows" command is deprecated.') |
| 1868 | 1901 | console.log('💡 Use "buddy setup" for a better interactive experience.\n') |
| 1869 | 1902 | |