feat(schedule): Add option to edit an existing scheduled pipeline
Description
Add a schedule update
option:
--active Whether or not the schedule is active (default to not change)
--create-variable strings Pass new variables to schedule in format <key>:<value>
--cron string Cron interval pattern
--cronTimeZone string Cron timezone
--delete-variable strings Pass variables you want to delete from schedule in format <key>
--description string Description of the schedule
--update-variable strings Pass updated variables to schedule in format <key>:<value>
--ref string Target branch or tag
Notes:
- It only updates the corresponding parameters if provided.
- To avoid unneeded API calls, it will skip those calls if no updated fields are provided.
- The function
CreateScheduleVariable
signature is changed to accept the schedule ID instead of a schedule object.
Related Issues
Resolves #7560
How has this been tested?
5 test cases have been added in commands/schedule/update/update_test.go
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Edited by Lucas Li