Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only update krew index for latest stable version. #5224

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

liangyuanpeng
Copy link
Contributor

@liangyuanpeng liangyuanpeng commented Jul 18, 2024

What type of PR is this?

/kind cleanup
What this PR does / why we need it:

Only update krew index for latest stable version. Avoid sending noisy PRs and in the future,we don't need some PR anymore like:

/cc @RainbowMango @zhzhuang-zju

Which issue(s) this PR fixes:

Ref #4703
Fixes #

Special notes for your reviewer:

Tested on my fork repo:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 18, 2024
@liangyuanpeng liangyuanpeng force-pushed the update_krew_stable branch 3 times, most recently from 88e63a1 to 34e2cf2 Compare July 18, 2024 08:36
@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 31.47%. Comparing base (a61d36a) to head (31177dd).
Report is 30 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5224      +/-   ##
==========================================
+ Coverage   31.14%   31.47%   +0.33%     
==========================================
  Files         640      643       +3     
  Lines       44417    44436      +19     
==========================================
+ Hits        13833    13987     +154     
+ Misses      29583    29423     -160     
- Partials     1001     1026      +25     
Flag Coverage Δ
unittests 31.47% <ø> (+0.33%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhzhuang-zju
Copy link
Contributor

@liangyuanpeng What a coincidence, we must have been on the same wavelength!
Thanks for your job, and review is ongoing~

@liangyuanpeng
Copy link
Contributor Author

ping @zhzhuang-zju for review :)

@zhzhuang-zju
Copy link
Contributor

/assign

@zhzhuang-zju
Copy link
Contributor

/lgtm
cc @RainbowMango

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2024
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2024
Comment on lines 221 to 225
update-krew-index:
needs: release-assests
needs:
- release-assests
- get-stable-tag
if: needs.get-stable-tag.outputs.stableTag == github.event.release.tag_name
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to get the latest tag at the update-krew-index job? So that we don't need another job.

Copy link
Contributor Author

@liangyuanpeng liangyuanpeng Aug 30, 2024

Choose a reason for hiding this comment

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

krew-release-bot action don't care the version #5224 (comment)

It is possible to do this using the krew-release-bot binary instead of the krew-release-bot action https://github.com/rajatjindal/krew-release-bot/blob/ad6e92e6daadabfedaa107ce5186a82d41229ef1/examples/circleci.yml#L17-L18, but that means we'll be dropping the automatic updates for rajatjindal/krew-release-bot action, I'd update it if that's what you want.

then it will be:

update-krew-index:
  gh api....
  // check is it the latest version
  curl -LO https://github.com/rajatjindal/krew-release-bot/releases/download/${KREW_RELEASE_BOT_VERSION}/krew-release-bot_${KREW_RELEASE_BOT_VERSION}_linux_amd64.tar.gz
  tar -xvf krew-release-bot_${KREW_RELEASE_BOT_VERSION}_linux_amd64.tar.gz
  ./krew-release-bot action

But I'd go with adding a job, it's not a big deal.

Copy link
Contributor Author

@liangyuanpeng liangyuanpeng Aug 30, 2024

Choose a reason for hiding this comment

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

We can wait and see how upstream reply.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't mean to hack anything of rajatjindal/krew-release-bot, I mean adding an extra step to the update-krew-index job, so that we don't need to share the variable between jobs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your clarify, i have update it , add a step and not a new job.

NOTE: have not test yet.

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

Looks much better now.

Comment on lines 218 to 219
- uses: actions/checkout@v4
if: steps.check-latest.outputs.stableTag == github.event.release.tag_name
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we don't need to check out the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

OK, then keep it.

.github/workflows/release.yml Outdated Show resolved Hide resolved
Signed-off-by: Lan Liang <gcslyp@gmail.com>
@RainbowMango
Copy link
Member

/retest

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 31, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 31, 2024
@karmada-bot karmada-bot merged commit 96f5149 into karmada-io:master Aug 31, 2024
12 checks passed
@pulsarsigs-bot pulsarsigs-bot deleted the update_krew_stable branch August 31, 2024 02:12
@RainbowMango RainbowMango added this to the v1.11 milestone Aug 31, 2024
Comment on lines 217 to +220
- uses: actions/checkout@v4
if: steps.get-latest-tag.outputs.latestTag == github.event.release.tag_name
- name: Update new version in krew-index
if: steps.get-latest-tag.outputs.latestTag == github.event.release.tag_name
Copy link
Member

Choose a reason for hiding this comment

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

The two steps were skipped, I don't know if this workflow could get the right latest tag, maybe there is a syntax error?
https://github.com/karmada-io/karmada/actions/runs/10645084310/job/29510560441#step:3:3

I can get the latest tag on my side.

# gh api repos/karmada-io/karmada/releases/latest | jq -r '.tag_name'
v1.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants