Skip to content

Conversation

@octo-sts
Copy link
Contributor

@octo-sts octo-sts bot commented May 21, 2025

Signed-off-by: wolfi-bot <121097084+wolfi-bot@users.noreply.github.com>
@octo-sts octo-sts bot added request-version-update request for a newer version of a package automated pr P1 This label indicates our scanning found High, Medium or Low CVEs for these packages. labels May 21, 2025
@octo-sts
Copy link
Contributor Author

octo-sts bot commented May 21, 2025

🔄 Build Failed: Git Checkout Error

fatal: Remote branch vertical-pod-autoscaler-1.4.0 not found in upstream origin

Build Details

Category Details
Build System melange
Failure Point git clone --quiet --origin=origin --config=user.name=Melange Build --config=user.email=melange-build@cgr.dev --config=advice.detachedHead=false --branch=vertical-pod-autoscaler-1.4.0 --depth=1 https://github.com/kubernetes/autoscaler /tmp/tmp.a4C6Zb

Root Cause Analysis 🔍

The build is attempting to check out a branch named 'vertical-pod-autoscaler-1.4.0' from the repository, but this branch doesn't exist in the remote repository. The configuration file (vertical-pod-autoscaler.yaml) likely specifies this branch name, but it should be referring to a tag instead, as the log indicates the expected tag is 'vertical-pod-autoscaler-1.4.0'.


🔍 Build failure fix suggestions

Found similar build failures that have been fixed in the past and analyzed them to suggest a fix:

Similar PRs with fixes

Suggested Changes

File: vertical-pod-autoscaler.yaml

  • replacement at line 12-13 (git-checkout block)
    Original:
  - uses: git-checkout
    with:
      repository: https://github.com/kubernetes/autoscaler
      tag: vertical-pod-autoscaler-${{package.version}}
      expected-commit: 2b33c4c7909162bfd38691beab5406fa74e1f69a

Replacement:

  - uses: git-checkout
    with:
      repository: https://github.com/kubernetes/autoscaler
      branch: vertical-pod-autoscaler-${{package.version}}
      expected-commit: 2b33c4c7909162bfd38691beab5406fa74e1f69a
Click to expand fix analysis

Analysis

The pattern in the similar fixed build failures is consistent: all involve Git checkout issues where the build system attempts to check out a branch that doesn't exist. In all three examples, the issue was related to tag naming or branch versus tag confusion.

The key patterns observed:

  1. In fix example #0 and Add binutils-2.39 configuration #1, the system was attempting to checkout a tag (v2.32.0, v3.88.13) as if it were a branch.
  2. In fix example Add pax-utils into the OS. #2, there was a prefix issue where the tag needed a 'v' prefix.

For the current vertical-pod-autoscaler failure, the error is similar: it's trying to checkout "vertical-pod-autoscaler-1.4.0" as a branch, but this is actually a tag in the repository, not a branch.

Click to expand fix explanation

Explanation

The current error is happening because the YAML file specifies tag: vertical-pod-autoscaler-1.4.0 but the git-checkout step is attempting to use this as a branch name with the --branch flag. This is evidenced by the error message: "Remote branch vertical-pod-autoscaler-1.4.0 not found in upstream origin".

When examining the git command that's failing, we can see:
git clone --quiet --origin=origin --config=user.name=Melange Build --config=user.email=melange-build@cgr.dev --config=advice.detachedHead=false --branch=vertical-pod-autoscaler-1.4.0 --depth=1 https://github.com/kubernetes/autoscaler /tmp/tmp.a4C6Zb

The error occurs because the --branch flag is being used, but this doesn't match how the Melange YAML file is configured. The issue is that in the Melange git-checkout action, when using tag: in the YAML, the system should be using a different git clone approach for tags.

Looking at how Melange maps its YAML properties to git commands, when specifying a tag: in the YAML, Melange is likely still attempting to do a branch checkout instead of a tag checkout. By changing from tag: to branch: in the YAML file, we align the YAML configuration with how the git-checkout action is actually executing the command (with the --branch flag).

Click to expand alternative approaches

Alternative Approaches

  • Update the URL to target the specific release tag. Instead of using branch or tag parameters, use a specific URL that includes the tag reference: https://github.com/kubernetes/autoscaler/archive/refs/tags/vertical-pod-autoscaler-1.4.0.tar.gz
  • Use 'ref:' instead of 'tag:' or 'branch:' if the Melange git-checkout action supports it, which would be more flexible in handling either branches or tags
  • Examine if the particular tag needs to be renamed in the YAML file to match the actual git repository structure - check if there's a different tag name pattern being used in the repo

Was this comment helpful? Please use 👍 or 👎 reactions on this comment.

@octo-sts octo-sts bot added the ai/skip-comment Stop AI from commenting on PR label May 21, 2025
Signed-off-by: Batuhan Apaydin <batuhan.apaydin@chainguard.dev>
@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label May 21, 2025
@developer-guy developer-guy requested a review from a team May 21, 2025 18:46
@developer-guy developer-guy self-assigned this May 21, 2025
@kbsteere kbsteere merged commit 7e1a586 into main May 21, 2025
18 checks passed
@kbsteere kbsteere deleted the wolfictl-222a3824-4d7a-4e94-9486-d07d236a2956 branch May 21, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/skip-comment Stop AI from commenting on PR automated pr bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. manual/review-needed P1 This label indicates our scanning found High, Medium or Low CVEs for these packages. request-version-update request for a newer version of a package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants