Skip to content

Resolve developers can create schedules

Panos Kanellidis requested to merge 435357-developers-can-create-schedules into master

What does this MR do and why?

This MR enforces full refs to be passed on pipeline schedules while aiming not to break the existing functionality from the Frontend and currently existing records.

Cases considered:

  • Frontend creating records using full refs
  • Frontend creating records using short refs
  • Records with full refs being updated
  • Records with short refs being updated

Note for the Reviewers

Please make sure to double check all the specs changed as I don't want to break any existing functionality.

Most of the changes in existing specs, were to create the refs that were used in the schedules, as we now enforce this check

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Schedule would be created protected branch & ref both exists Screenshot_2024-01-26_at_11.18.32_AM
Short ref passed from the FE should create the schedule The functionality stays the same but the ref is expanded Screenshot_2024-01-26_at_11.26.30_AM Result, you see the target being set as the main branch Screenshot_2024-01-26_at_11.22.57_AM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Common steps

  • Create a new project or select an existing one
  • On the left panel navigate to Code -> Branches
  • Create a new protected branch

Case 1

  • on the left panel go to Builds -> Pipeline Schedules
  • Create a new schedule, you will see that the ref is by has a default value, don't change it, just populate the required fields and click create
  • The schedule should have been created successfully, even though a short ref was passed
  • Check the newly created schedule's Target column on the schedules list, there should be the branch symbol, this means that the ref was expanded

Case 2: Ambiguous ref

  • On the left panel, navigate to Code -> Tags
  • Create a new tag with the same name as the branch you created (select any base branch you want)
  • On the left panel, navigate to Settings -> Repository -> Default Branches and make the new branch the default one
  • Finally, on the left panel go to Builds -> Pipeline Schedules
  • Create a new schedule, you will see that the ref is by has a default value, don't change it, just populate the required fields and click create
  • An ambiguous ref error should have been triggered

Note: Both cases should have the same behaviour when updating a schedule

Related to #435357 (closed)

Edited by Panos Kanellidis

Merge request reports