Skip to content

fix: occasional minified JSON from GitHub release API#6164

Merged
kubernetes-prow[bot] merged 3 commits into
kubernetes-sigs:masterfrom
EdwardCooke:minifiedreleasejson
Jul 16, 2026
Merged

fix: occasional minified JSON from GitHub release API#6164
kubernetes-prow[bot] merged 3 commits into
kubernetes-sigs:masterfrom
EdwardCooke:minifiedreleasejson

Conversation

@EdwardCooke

Copy link
Copy Markdown
Contributor

The github releases API occasionally returns a minified JSON object. The original grep command works when each browser_download_url was on the same line, but with a minified blob it returns the last quoted string, which is the URL to the release itself.

Fixes #6163

Copilot AI review requested due to automatic review settings June 15, 2026 00:53
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 15, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: EdwardCooke / name: Edward Cooke (92b3eeb)

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @EdwardCooke!

It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 15, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @EdwardCooke. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 15, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: EdwardCooke
Once this PR has been reviewed and has the lgtm label, please assign koba1t for approval. For more information see the Code Review Process.

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

Details 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the kustomize install helper to extract the latest matching asset download URL more reliably from the GitHub releases payload.

Changes:

  • Extract browser_download_url values explicitly instead of grepping whole JSON lines.
  • Filter extracted URLs by ${opsys}_${arch} before selecting the latest via version-sort.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hack/install_kustomize.sh
Comment thread hack/install_kustomize.sh
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 15, 2026
@EdwardCooke

Copy link
Copy Markdown
Contributor Author

FYI, the response from github to a similar question about minified vs not.

https://github.com/orgs/community/discussions/189605

@EdwardCooke EdwardCooke changed the title Fix for the occasional minified JSON from GitHub release API fix: occasional minified JSON from GitHub release API Jun 15, 2026
@koba1t

koba1t commented Jun 27, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 27, 2026
@koba1t

koba1t commented Jun 27, 2026

Copy link
Copy Markdown
Member

@EdwardCooke

I think we need to fix this problem.
Could you please add tests to verify that this fix is ​​sufficient and does not break existing functionality?

@EdwardCooke

Copy link
Copy Markdown
Contributor Author

@koba1t i ran a bunch of tests against both minified and non-minified json on Mac and Linux. They all produced the same result. Do you want it automated so it runs everytime a build kicks off?

@koba1t

koba1t commented Jun 28, 2026

Copy link
Copy Markdown
Member

Up until now, simply running install_kustomize.sh and verifying that the binary was downloaded was considered a sufficient test.
However, surely that is not enough for the changes proposed in this PR, is it?

While it may not be necessary to run it during every CI execution, we do need a way to verify that this functionality remains intact whenever the script is modified.

@EdwardCooke

Copy link
Copy Markdown
Contributor Author

I’ll work on that over the next few days. How would you like me to go about it? One idea I have is keep a copy of both minified and unminified files in the repo and use an environment variable to tell it to read the files instead of downloading them.

Trying to reproduce the problem was very time consuming and didn’t always work so my recommendation is we find at least someway to read both good and bad release files.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 11, 2026
@EdwardCooke

Copy link
Copy Markdown
Contributor Author

@koba1t I have added a way of testing the releases file through an environment variable. I also added a github action that will run only when the test files or the install_kustomize script are modified.

@EdwardCooke
EdwardCooke force-pushed the minifiedreleasejson branch from 3056b9a to f602af3 Compare July 16, 2026 03:41
@EdwardCooke

Copy link
Copy Markdown
Contributor Author

@koba1t this latest commit should have fixed the test workflow.

@koba1t

koba1t commented Jul 16, 2026

Copy link
Copy Markdown
Member

@EdwardCooke
Thank you for your contribution!

/lgtm
/approve

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 16, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: EdwardCooke, koba1t

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

The pull request process is described here

Details 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

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit f7d33c2 into kubernetes-sigs:master Jul 16, 2026
24 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install_kustomize.sh occasionally fails

4 participants