UNCLASSIFIED - NO CUI

Skip to content

Update Bigbang Automatic MR Pipeline to Include Upgrade Notices field

Michael Mendez requested to merge 1695-update-mr-desc into master

General MR

Summary

Added in functionality to the create_bigbang_merge_request function that runs as part of the tag->release pipeline that's run when a new package version is pushed that automatically opens up a Merge Request to the umbrella bigbang repo to update the chart version to copy over the Upgrade Notices form the package merge request.

Refactors the Upgrade Notice validation pipeline slightly to allow us to re-use the same regex magic there and make this easier to test locally.

Relevant logs/screenshots

Pushing a new package version triggers the various pipelines that tag and "release" the package. As part of the release stage, create_bigbang_merge_request is called. This will inspect the recently opened Merge Requests, identify the recent one, and open a new merge request against Bigbang, copying over some contents of the package MR.

To test this, I've used the pipeline-validation process and overridden a few variables in the pipeline:


# Force the pipeline to request this URL directly rather than pull from the local JSON copy. This MR is just a random one I have for testing purposes so I can easily modify the description (have to set a few of these things to prevent variables from being unbound)
PACKAGE_MR_URL="https://repo1.dso.mil/big-bang/product/packages/kiali/-/merge_requests/125"
DESCRIPTION=$(curl "https://repo1.dso.mil/api/v4/projects/big-bang%2Fproduct%2Fpackages%2Fkiali/merge_requests/125" | jq -r '.description')
description=$(fetch_mr_description "https://repo1.dso.mil/api/v4/projects/big-bang%2Fproduct%2Fpackages%2Fkiali/merge_requests/125" 2 "$DANIELDIDES_FORK_TOKEN")

# Hardcode the Changelog path:
CHANGELOG_URL="https://repo1.dso.mil/big-bang/product/packages/kiali/-/blob/ea59ca27d73d706ff86496380da0f9f4df86e15c/CHANGELOG.md"

# Override the default token
BB_AUTO_MR_TOKEN=${DANIELDIDES_FORK_TOKEN}

# Configure the push to open the MR against my fork (later found out you can configure this in the settings of the fork as well under the Merge Request settings
      git push --set-upstream origin ${BB_SOURCE_BRANCH} \
        -o merge_request.create \
        -o merge_request.title="Draft: ${valuesKey} update to ${CI_COMMIT_TAG}" \
        -o merge_request.label="status::review"	\
        -o merge_request.label="bot::mr"	\
        -o merge_request.label=${valuesKey} \
        -o merge_request.target_project="daniel.dides/bigbang" \
        -o merge_request.target="master" \
        ${BB_MR_ASSIGNEE} 1>/dev/null

Reverting !472 (a5593d18) should allow this to be re-tested easily.

Note in the .gitlab-ci.yml I also had to configure:


BB_REPO: repo1.dso.mil/daniel.dides/bigbang
BB_PROJECT_ID: 14950

to properly target my fork.

The result of all of this is that when the pipeline runs, my package MR is correctly parsed and an MR is opened against my fork of Bigbang.

Package MR

Screenshot_2024-01-12_at_1.11.47_PM

Resulting Bigbang MR

Screenshot_2024-01-12_at_1.12.43_PM

Linked Issue

Closes big-bang/bigbang#1695 (closed)

Upgrade Notices

N/A

Edited by Daniel Dides

Merge request reports