Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .buildkite/pipeline.backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: "integrations-backport"

env:
YQ_VERSION: 'v4.35.2'
# Agent images used in pipeline steps
LINUX_AGENT_IMAGE: "golang:${GO_VERSION}"

steps:

Expand Down Expand Up @@ -49,6 +51,8 @@ steps:
- label: "Creating the backport branch"
key: "create-backport-branch"
command: ".buildkite/scripts/backport_branch.sh"
agents:
image: "${LINUX_AGENT_IMAGE}"
depends_on:
- step: "input-variables"
allow_failure: false
23 changes: 20 additions & 3 deletions .buildkite/scripts/backport_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,21 @@ updateBackportBranchContents() {
rm -rf "$JENKINS_FOLDER_PATH"
fi

# Update scripts used by mage
local MAGEFILE_SCRIPTS_FOLDER="dev/citools"
local TESTSREPORTER_SCRIPTS_FOLDER="dev/testsreporter"
if git ls-tree -d --name-only main:${MAGEFILE_SCRIPTS_FOLDER} > /dev/null 2>&1 ; then
echo "Copying $MAGEFILE_SCRIPTS_FOLDER from $SOURCE_BRANCH..."
git checkout "$SOURCE_BRANCH" -- "${MAGEFILE_SCRIPTS_FOLDER}"
git checkout "$SOURCE_BRANCH" -- "${TESTSREPORTER_SCRIPTS_FOLDER}"
git checkout "$SOURCE_BRANCH" -- "magefile.go"
# Run go mod tidy to update just the dependencies related to magefile and dev scripts
go mod tidy
fi
Comment on lines +134 to +143
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if it would be better to update the whole dev folder.

These are the minimum changes in order to work (for now) the mage targets.

Or should we step syncing these files/folders? If those files are not synced, changes related to secrets or others paths would not be added to the backport branches.

Related issue where this feature was introduced #8721

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can try by now to update these files only, and if problems continue appearing, update the whole dev in a future change.


if [ "${REMOVE_OTHER_PACKAGES}" == "true" ]; then
echo "Removing all packages from $PACKAGES_FOLDER_PATH folder"
removeOtherPackages "$PACKAGES_FOLDER_PATH"
removeOtherPackages "${PACKAGES_FOLDER_PATH}"
ls -la $PACKAGES_FOLDER_PATH
fi

Expand All @@ -142,7 +154,12 @@ updateBackportBranchContents() {
echo "Commiting"
git add $BUILDKITE_FOLDER_PATH
if [ -d "${JENKINS_FOLDER_PATH}" ]; then
git add $JENKINS_FOLDER_PATH
git add "${JENKINS_FOLDER_PATH}"
fi
if [ -d "${MAGEFILE_SCRIPTS_FOLDER}" ] ; then
git add ${MAGEFILE_SCRIPTS_FOLDER}
git add ${TESTSREPORTER_SCRIPTS_FOLDER}
git add go.mod go.sum
fi
git add $PACKAGES_FOLDER_PATH/
git status
Expand All @@ -156,7 +173,7 @@ updateBackportBranchContents() {

if [ "$DRY_RUN" == "true" ];then
echo "DRY_RUN mode, nothing will be pushed."
git diff $SOURCE_BRANCH...$BACKPORT_BRANCH_NAME
git --no-pager diff $SOURCE_BRANCH...$BACKPORT_BRANCH_NAME
else
echo "Pushing..."
git push origin $BACKPORT_BRANCH_NAME
Expand Down