Skip to content

test: set the upgrade compatibility test pipeline to use commit-specific setup#64

Merged
ryanzhang-oss merged 7 commits intokubefleet-dev:mainfrom
michaelawyu:feat/upgrade-test-commit-match
May 23, 2025
Merged

test: set the upgrade compatibility test pipeline to use commit-specific setup#64
ryanzhang-oss merged 7 commits intokubefleet-dev:mainfrom
michaelawyu:feat/upgrade-test-commit-match

Conversation

@michaelawyu
Copy link
Copy Markdown
Member

Description of your changes

This PR sets the upgrade compatibility test pipeline to use commit-specific setup (i.e., use old helm chart with old image).

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

N/A

Special notes for your reviewer

N/A

Signed-off-by: michaelawyu <chenyu1@microsoft.com>
Signed-off-by: michaelawyu <chenyu1@microsoft.com>
Signed-off-by: michaelawyu <chenyu1@microsoft.com>
Signed-off-by: michaelawyu <chenyu1@microsoft.com>
@codecov
Copy link
Copy Markdown

codecov bot commented May 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@ryanzhang-oss ryanzhang-oss requested a review from Copilot May 20, 2025 05:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the upgrade compatibility test pipeline to use commit-specific setups by removing in-script git checkouts and handling version switching entirely in the GitHub Actions workflow.

  • Removed internal GIT_TAG and branch/commit checkout logic from upgrade.sh and setup.sh.
  • Added explicit “travel back” and “return to current state” steps in .github/workflows/upgrade.yml.
  • Updated setup.sh header comment and pipeline invocation (introduced a couple of typos in echo statements).

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
test/upgrade/upgrade.sh Removed git-tag checkout and branch-restore logic
test/upgrade/setup.sh Removed checkout logic, added header note (typos in some echo lines)
.github/workflows/upgrade.yml Added pre-/post-upgrade git checkout steps for commit-specific setup

run: |
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1

- name: Travel back in time to the before upgrade version
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

[nitpick] This git checkout block is repeated for each upgrade scenario; consider extracting it into a reusable composite action or workflow step to reduce duplication.

Copilot uses AI. Check for mistakes.
@ryanzhang-oss ryanzhang-oss requested a review from Copilot May 20, 2025 05:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the upgrade compatibility test pipeline to use commit-specific setup by removing the in-script Git checkout logic and shifting that responsibility into the workflow.

  • Removed commit checkout logic in upgrade.sh
  • Removed commit-specific restore logic and updated messaging in setup.sh
  • Updated GitHub Actions workflow to handle commit switching for both before and after upgrade scenarios

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
test/upgrade/upgrade.sh Removed Git checkout logic to use commit-specific setups externally
test/upgrade/setup.sh Removed previous branch/commit restoration and updated log messages
.github/workflows/upgrade.yml Added explicit steps to switch to the desired commit/tag and back

- name: Travel back in time to the before upgrade version
run: |
GIT_TAG="${{ github.event.inputs.beforeTagOrCommit }}"
PREVIOUS_BRANCH=$(git branch --show-current)
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

[nitpick] The logic to capture the current branch and commit is repeated across multiple workflow steps. Consider extracting this repetitive logic into a reusable script or GitHub Action to improve maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Second this, there are a lot of duplicated code here

Copy link
Copy Markdown
Member Author

@michaelawyu michaelawyu May 23, 2025

Choose a reason for hiding this comment

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

Hi Ryan! This part is a bit tricky unfortunately. The commands manipulate the current state of the repo; as a script file it would mean that once traveling back the script would be gone (I could add a step that copies out the script as a untracked file, but that would be a bit weird I guess -> but if it is OK with you I could make the changes); for the separate GitHub Action proposal, it would require a separate public repo dedicated to the Action as required by GitHub, which is also tricky.

# baseline commit, i.e., the commit that triggers the workflow.
run: |
echo "Returning to the current state..."
git checkout $PREVIOUS_COMMIT
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is this not current commit?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hi Ryan! The upgrade pipeline often runs on dangling commits (commits that have not been checked as the PR hasn't been merged) so we couldn't just jump to the HEAD.

- name: Travel back in time to the before upgrade version
run: |
GIT_TAG="${{ github.event.inputs.beforeTagOrCommit }}"
PREVIOUS_BRANCH=$(git branch --show-current)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Second this, there are a lot of duplicated code here

Signed-off-by: michaelawyu <chenyu1@microsoft.com>
…o feat/upgrade-test-commit-match

Signed-off-by: michaelawyu <chenyu1@microsoft.com>
@ryanzhang-oss ryanzhang-oss merged commit f18e64f into kubefleet-dev:main May 23, 2025
17 checks passed
audrastump pushed a commit to audrastump/kubefleet that referenced this pull request Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants