Skip to content

Conversation

@octo-sts
Copy link
Contributor

@octo-sts octo-sts bot commented Jun 18, 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 linkerd2 labels Jun 18, 2025
@octo-sts
Copy link
Contributor Author

octo-sts bot commented Jun 18, 2025

🔄 Build Failed: Git Checkout Error

fatal: Remote branch edge-25.6.3 not found in upstream origin

Build Details

Category Details
Build System git/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=edge-25.6.3 --depth=1 https://github.com/linkerd/linkerd2/ /tmp/tmp.d9JSF6

Root Cause Analysis 🔍

The build is attempting to check out the tag 'edge-25.6.3' from the linkerd2 repository, but is incorrectly treating it as a branch rather than a tag. Git is unable to find a branch with this name in the remote repository.


🔍 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: linkerd2.yaml

  • replace at line 36-39 (pipeline.git-checkout)
    Original:
  - uses: git-checkout
    with:
      expected-commit: f9150a804cfc64a12f5e5f0864675fdc5fa9631a
      repository: https://github.com/linkerd/linkerd2/
      tag: edge-${{package.version}}

Replacement:

  - uses: git-checkout
    with:
      expected-commit: f9150a804cfc64a12f5e5f0864675fdc5fa9631a
      repository: https://github.com/linkerd/linkerd2/
      branch: main
      ref: edge-${{package.version}}
Click to expand fix analysis

Analysis

The build failure is related to git checkout, specifically when trying to check out what appears to be a tag as if it were a branch. In the similar fixed build failure (#49939), the issue was identical - the build system was attempting to use the '--branch' flag with a tag value ('v2.32.0'). The current failure shows the same pattern with the tag 'edge-25.6.3'.

The git-checkout step in the Melange YAML file is using a combination of 'repository' and 'tag' parameters, but the error indicates that the system is incorrectly treating the tag as a branch name. The fix pattern suggests we need to modify how the git checkout is performed to correctly handle tags rather than branches.

Click to expand fix explanation

Explanation

The current build failure occurs because the Melange build system is attempting to use the tag parameter in a way that results in a git command using --branch=edge-25.6.3 when cloning the repository. However, 'edge-25.6.3' is a tag, not a branch, which leads to the error: "fatal: Remote branch edge-25.6.3 not found in upstream origin".

By changing the configuration from using tag: edge-${{package.version}} to using branch: main and ref: edge-${{package.version}}, we're telling the git-checkout action to:

  1. First clone the repository using the main branch (which always exists)
  2. Then checkout the specific tag/reference named 'edge-25.6.3'

This approach avoids the incorrect assumption that the tag is a branch. The 'ref' parameter is more flexible and can refer to tags, branches, or specific commit hashes. This is the appropriate way to check out a specific tag in the Melange build system.

The expected-commit parameter is kept to verify the integrity of the checkout, ensuring we get exactly the commit we expect even when checking out via a tag reference.

Click to expand alternative approaches

Alternative Approaches

  • Instead of using both branch and ref, we could potentially modify the git-checkout action to use only 'ref' without specifying a branch, if the Melange build system supports this pattern.
  • Another approach would be to use a direct git command in a 'runs' step instead of the git-checkout action, giving more direct control over the clone and checkout process.
  • If the package's update strategy consistently follows a pattern where tags are prefixed with 'edge-', we could potentially modify the update section to better handle this tag pattern, though this wouldn't directly fix the current issue.

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 Jun 18, 2025
Signed-off-by: Ajay Kemparaj <ajaykemparaj@gmail.com>
@octo-sts octo-sts bot added bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. manual/review-needed labels Jun 19, 2025
@debasishbsws debasishbsws self-assigned this Jun 20, 2025
Signed-off-by: Debasish Biswas <debasishbsws.dev@gmail.com>
@debasishbsws debasishbsws requested a review from a team June 20, 2025 16:38
@AmberArcadia AmberArcadia merged commit 667fa3f into main Jun 20, 2025
18 checks passed
@AmberArcadia AmberArcadia deleted the wolfictl-5fec332f-e21c-4ca2-b05f-aced7f7b4d29 branch June 20, 2025 17:29
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. linkerd2 manual/review-needed request-version-update request for a newer version of a package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants