Fix super-linter: fetch full git history to resolve master branch lookup failure#61
Merged
electrocucaracha merged 4 commits intomasterfrom Mar 23, 2026
Merged
Conversation
…cut delimiter Co-authored-by: electrocucaracha <2782150+electrocucaracha@users.noreply.github.com> Agent-Logs-Url: https://github.com/electrocucaracha/lint-devstack/sessions/7b31e12b-7e74-4978-af45-9aea5894c7bb
Copilot
AI
changed the title
[WIP] Fix issue in lint devstack action
Fix check-versions CI: stale Vagrant Cloud URLs and invalid cut delimiter
Mar 23, 2026
Co-authored-by: electrocucaracha <2782150+electrocucaracha@users.noreply.github.com> Agent-Logs-Url: https://github.com/electrocucaracha/lint-devstack/sessions/2373b90e-0d59-4f29-b775-59c3e1eaad56
Copilot
AI
changed the title
Fix check-versions CI: stale Vagrant Cloud URLs and invalid cut delimiter
Fix Vagrant Cloud URL deprecation and shell formatting in update_distros.sh
Mar 23, 2026
…h available Co-authored-by: electrocucaracha <2782150+electrocucaracha@users.noreply.github.com> Agent-Logs-Url: https://github.com/electrocucaracha/lint-devstack/sessions/075df27f-8e9d-4ce5-875c-46a7df4da1da
Copilot
AI
changed the title
Fix Vagrant Cloud URL deprecation and shell formatting in update_distros.sh
Fix super-linter: fetch full git history to resolve master branch lookup failure
Mar 23, 2026
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan Review Summary by QodoFix CI issues: super-linter, Vagrant Cloud API, and script formatting
WalkthroughsDescription• Fix super-linter CI by fetching full git history for master branch availability • Update Vagrant Cloud API URLs from v1 to v2 with architecture support • Add _get_box_arch function to detect and map system architecture • Fix shell script formatting and improve Vagrantfile cut delimiter handling Diagramflowchart LR
A["CI Workflows"] -->|fetch-depth: 0| B["super-linter"]
B -->|full git history| C["master branch available"]
D["Vagrant Cloud API"] -->|v1 to v2 migration| E["update_distros.sh"]
E -->|architecture detection| F["_get_box_arch function"]
G["Vagrantfile"] -->|improved delimiter| H["VBoxManage parsing"]
File Changes1. .github/workflows/linter.yml
|
Code Review by Qodo
1. Retry loop bypassed
|
Comment on lines
+30
to
33
| metadata="$(curl -s "https://vagrantcloud.com/api/v2/vagrant/${name%/*}/${name#*/}")" | ||
| if [ "$metadata" ]; then | ||
| version="$(echo "$metadata" | python -c 'import json,sys;print(json.load(sys.stdin)["current_version"]["version"])')" | ||
| version="$(echo "$metadata" | python3 -c 'import json,sys;print(json.load(sys.stdin)["current_version"]["version"])')" | ||
| break |
There was a problem hiding this comment.
1. Retry loop bypassed 🐞 Bug ⛯ Reliability
In ci/update_distros.sh, _get_box_current_version is intended to retry fetching metadata, but under set -o errexit any JSON parse error (or missing current_version.version) will abort the script immediately, bypassing the retry loop. This can happen when the curl response is a non-JSON error page or an API error payload that doesn’t match the expected shape.
Agent Prompt
### Issue description
`_get_box_current_version` uses an `until` retry loop, but with `set -o errexit` the script exits on JSON parse/KeyError before any retries can occur. This makes transient API/HTTP failures fatal.
### Issue Context
- The curl call does not fail the shell on HTTP errors (no `--fail`), so error pages/bodies can still be non-empty.
- The python3 JSON extraction is unguarded and will exit non-zero on invalid JSON or unexpected response shape.
### Fix Focus Areas
- ci/update_distros.sh[11-40]
- ci/update_distros.sh[20-44]
### Implementation notes
- Capture both HTTP status and body, e.g. `curl -fsSL -w '%{http_code}'` (or `--fail-with-body`) and only attempt JSON parsing on 2xx.
- Make the JSON extraction non-fatal inside the loop, e.g.:
- `version=$(python3 -c '...' <<<"$metadata" 2>/dev/null || true)`
- Only `break` when `version` is non-empty.
- If parsing fails, increment `attempt_counter` and continue retrying until `max_attempts` is reached (then exit 1 with a helpful message including HTTP code).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
super-linterwas fatally failing on PRs because the shallow checkout (fetch-depth: 1) left nomaster/origin/masterref available — which super-linter requires to diff changed files whenVALIDATE_ALL_CODEBASEis unset.Changes
.github/workflows/linter.yml— addfetch-depth: 0to theactions/checkoutstep incheck-super-linterso all branches (includingmaster) are fetched, unblocking super-linter's diff-based file filtering.ci/update_distros.sh— fixshfmt -i 4 -sformatting: aligncasepatterns in_get_box_archwith thecase/esackeywords (shfmt canonical style), resolving the "Check scripts format" CI failure.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.