feat(cli): add --ci-provider flag to setup-ci#295
Open
addielaruee wants to merge 1 commit into
Open
Conversation
setup-ci already generated config for 5 CI providers internally but had no way to select one explicitly, and the --workflow option's baked-in default silently prevented the provider-based default path from ever being used from the CLI. Add a --ci-provider flag (validated against the 5 supported providers, with a clear error listing valid options), drop the hardcoded --workflow default so provider-based path selection actually reaches the CLI, and keep auto-detection as the fallback when the flag is omitted. Fixes KryptosAI#289
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #289.
setup-ci(init-ci) already generated config for 5 CI providers (InitCiOptions.ciProvider), but there was no CLI flag to select one explicitly — only auto-detection via env vars.Changes
--ci-provider <provider>tosetup-ci/init-ci, acceptinggithub-actions,gitlab-ci,circleci,bitbucket-pipelines,azure-pipelines.validateCiProvider) shared byinitCianddoctorSetupCi, so an invalid value throws a clear error listing the valid options instead of silently falling through — applies tosetup-ciandsetup-ci --doctoralike.detectCiProvider(), unchanged.--workflowhad a hardcoded default (DEFAULT_WORKFLOW_PATH) baked into the Commander option itself, sooptions.workflowwas neverundefinedwhen invoked from the actual CLI. That meant the existingoptions.workflow ?? defaultPathprovider-based path selection could never trigger outside of direct function calls/tests —--ci-provider gitlab-ciwould still write to.github/workflows/mcp-observatory.ymlinstead of.gitlab-ci.yml. Removed the baked-in default so the provider-based default path resolves correctly; behavior for the github-actions case (the ultimate fallback) is unchanged.Acceptance criteria (from #289)
--ci-provideraccepts: github-actions, gitlab-ci, circleci, bitbucket-pipelines, azure-pipelinesValidation
Each provider produced the correct config file with correct content; the invalid value produced a clean non-zero-exit error instead of silently defaulting; omitting the flag left auto-detection behavior unchanged.
Files touched:
src/commands/init-ci.ts,tests/init-ci.test.ts.