Skip to content

Update CommitSha in pipeline editor when switching branches

Mireya Andres requested to merge pipeline-editor/update-commit-sha into master

What does this MR do?

For #333369 (closed) and #332845 (closed).

When the user switches branches in the pipeline editor, we need to make sure that the CommitSha value in apollo cache is updated with the latest commit sha for the new branch.

This change affects two issues:

  • This is needed for #332845 (closed) so we can send the updated commit sha to the backend and fetch the correct merged yaml content for non-default branches. The actual updating of the CiConfig query to use the updated commit sha will is implemented in !64574 (merged).
  • This also fixes the bug mentioned in #333369 (closed) where the pipeline status does not show the latest pipeline for non-default branches. Right now, it will constantly show the latest pipeline for default branch regardless of the current branch the user sets the pipeline editor to.

A follow-up issue has been created in #335074 (closed) to refactor the handling of commit sha here, based on the discussion below in !64576 (comment 615547809). This will handle unifying the source of truth of commit sha and removing the client resolver in favor of setting it as a query. For now, the commit sha is updated using a local mutation, which

Screenshots

Updated commit sha in pipeline status

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Mireya Andres

Merge request reports