Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add simple multibranch #147

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

km1chno
Copy link
Contributor

@km1chno km1chno commented Dec 18, 2024

Resolves #122

Changes

  • Changes cli interface: remove --preset flag and instead add -pull-request and -main. Example usage could be setup-ci -pull-request jest ts -main lint ts.
  • Extends CycliConfig to Map<WorkflowEvent, Set<CycliWorkflowType>>, which is obtained by ConfigExtension using two multiselect prompts (one for pull request, one for push to main), or provided cli flags.
  • Add ExecutorExtension that based on CycliConfig, performs all required actions, which are split into two steps: project configuration and workflow generation
  • WorkflowsExtension receives object events: WorkflowEvent[] based on which appropriate on: field in generated workflows is created.

All changes are designed in such a way to make the logic extendable in the direction of adding more supported events.

TODO:

  • Update documentation
  • Update links to docs
  • Adjust help message (use [<workflow1> <workflow2>...] to signalize that -pull-request and -main flags should be proceeded by a list of workflows
  • Add unit tests for new cases (new syntax works, but push, or multiple branches do not work)
  • Manual testing of less trivial cases in large projects
  • More push branches are not handled by recipes
  • Adjust analytics (it should work, but potentially not important as union of all features is sent)

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.

Add possibility to setup multibranch
1 participant