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

Fix INSTALL_K3S_PR support #11383

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Fix INSTALL_K3S_PR support #11383

merged 1 commit into from
Nov 27, 2024

Conversation

brandond
Copy link
Member

@brandond brandond commented Nov 27, 2024

Proposed Changes

Fix INSTALL_K3S_PR support

Filter check names server-side instead of with jq. With recent changes to CI we now have more than 30 check runs, which is more than the API will return by default. Rather than paginating or increasing the page size, ask the server to filter for us.

Also replaces the awk/sort/head with jq split/sort/last

Types of Changes

install script
bugfix

Verification

See linked issue
curl -sL get.k3s.io | INSTALL_K3S_PR=10973 sh -s -

Testing

Linked Issues

User-Facing Change

Further Comments

successful download:

#11 0.500 + curl -f -s -H Authorization: Bearer gho_XXX https://api.github.com/repos/k3s-io/k3s/pulls/10973
#11 0.500 + jq -r .head.sha
#11 1.172 + commit_id=d39ab65ca69ab7b7c6ea3825e1257e7812e57168
#11 1.172 + set -e
#11 1.172 + [ -z d39ab65ca69ab7b7c6ea3825e1257e7812e57168 ]
#11 1.173 + curl -s -H Authorization: Bearer gho_XXX https://api.github.com/repos/k3s-io/k3s/commits/d39ab65ca69ab7b7c6ea3825e1257e7812e57168/check-runs?check_name=build%20%2F%20Build
#11 1.173 + jq -r [.check_runs | sort_by(.id) | .[].details_url | split("/")[7]] | last
#11 1.449 + run_id=12039360333
#11 1.450 + curl -s -H Authorization: Bearer gho_XXX https://api.github.com/repos/k3s-io/k3s/actions/runs/12039360333/artifacts
#11 1.450 + jq -r .artifacts[] | select(.name == "k3s") | .archive_download_url
#11 1.688 + GITHUB_PR_URL=https://api.github.com/repos/k3s-io/k3s/actions/artifacts/2241392253/zip
#11 1.688 + info Using PR 10973 as release
#11 1.688 + echo [INFO]  Using PR 10973 as release
#11 1.688 + download_hash
#11 1.688 + [ -n 10973 ]
#11 1.688 + info Downloading hash https://api.github.com/repos/k3s-io/k3s/actions/artifacts/2241392253/zip
#11 1.688 + echo [INFO]  Downloading hash https://api.github.com/repos/k3s-io/k3s/actions/artifacts/2241392253/zip
#11 1.688 + curl -s -o /tmp/k3s-install.ZzYQ3oVohy/k3s.zip -H Authorization: Bearer gho_XXX -L https://api.github.com/repos/k3s-io/k3s/actions/artifacts/2241392253/zip
#11 1.688 [INFO]  Using PR 10973 as release
#11 1.688 [INFO]  Downloading hash https://api.github.com/repos/k3s-io/k3s/actions/artifacts/2241392253/zip

@brandond brandond requested a review from a team as a code owner November 27, 2024 19:54
Filter check names server-side instead of with jq. With recent changes to CI we now have more than 30 check runs, which is more than the API will return by default. Rather than paginating or increasing the page size, ask the server to filter for us.

Also replaces the awk/sort/head with jq split/sort/last

Signed-off-by: Brad Davidson <[email protected]>
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.54%. Comparing base (c669600) to head (1c9233b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11383      +/-   ##
==========================================
- Coverage   45.66%   42.54%   -3.12%     
==========================================
  Files         179      179              
  Lines       18600    18600              
==========================================
- Hits         8493     7913     -580     
- Misses       8796     9481     +685     
+ Partials     1311     1206     -105     
Flag Coverage Δ
e2etests 34.26% <ø> (-7.93%) ⬇️
inttests 34.73% <ø> (?)
unittests 13.82% <ø> (ø)

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.

@brandond
Copy link
Member Author

brandond commented Nov 27, 2024

Merging without backports because install script.

@brandond brandond merged commit 0e15269 into k3s-io:master Nov 27, 2024
45 checks passed
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.

4 participants