Skip to content

Conversation

@octo-sts
Copy link
Contributor

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

octo-sts bot commented Jun 20, 2025

🔄 Build Failed: Git Checkout Error

fatal: Remote branch v4.101.0 not found in upstream origin

Build Details

Category Details
Build System Git
Failure Point git clone --quiet --origin=origin --config=user.name=Melange Build --config=user.email=melange-build@cgr.dev --config=advice.detachedHead=false --branch=v4.101.0 --depth=1 https://github.com/coder/code-server /tmp/tmp.Od7CVeq3sU

Root Cause Analysis 🔍

The build is attempting to clone a specific tag (v4.101.0) from the code-server repository but is incorrectly using --branch flag for a tag reference. Git is looking for a branch named 'v4.101.0' instead of interpreting it as a tag.


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

  • replace at line 47-50 (pipeline.git-checkout configuration)
    Original:
  - uses: git-checkout
    with:
      repository: https://github.com/coder/code-server
      tag: v${{package.version}}
      expected-commit: 27a112c3a7f00e4cb77874145c95f03f9b586415

Replacement:

  - uses: git-checkout
    with:
      repository: https://github.com/coder/code-server
      branch: main
      tag: v${{package.version}}
      expected-commit: 27a112c3a7f00e4cb77874145c95f03f9b586415
Click to expand fix analysis

Analysis

The similar fixed build failures reveal a common pattern where git checkout operations fail when attempting to reference a tag using the --branch flag. In both examples, the solution involved properly specifying how to reference the tag:

  1. In Fix Example #0 (filebrowser.yaml), the issue was addressed by modifying package dependencies, though the git checkout issue appears to have been fixed separately.

  2. In Fix Example Add binutils-2.39 configuration #1 (py3-typing-inspection.yaml), the solution was explicitly using the 'tag' parameter with the correct format 'v${{package.version}}' in the git-checkout step, rather than using a branch reference.

The current error shows the same pattern - attempting to use --branch=v4.101.0 when checking out what is actually a tag, not a branch. The git checkout operation is failing because it's looking for a branch named 'v4.101.0' in the repository, but this is likely a tag instead.

Click to expand fix explanation

Explanation

The build failure is occurring because the git-checkout step is attempting to use the '--branch' flag with a tag reference 'v4.101.0'. Git treats branches and tags differently - when using the '--branch' flag, git specifically looks for a branch with that name, not a tag.

Looking at the error message: "fatal: Remote branch v4.101.0 not found in upstream origin", we can see that git is searching for a branch called "v4.101.0", but this is actually a tag in the repository.

The suggested fix adds a 'branch: main' parameter to the git-checkout step. This instructs the git clone operation to first checkout the main branch, and then the tag specified in the 'tag' parameter will be applied after that.

This approach is similar to the fix in Example #1, where the build system properly distinguished between branch and tag references. By explicitly specifying both:

  1. We first clone the default branch (main)
  2. Then checkout the specific tag

This mirrors how you would resolve this issue manually with git commands:

git clone https://github.com/coder/code-server
cd code-server
git checkout v4.101.0

The fix works because it properly separates the branch and tag concepts in the git checkout operation, allowing git to find the correct reference.

Click to expand alternative approaches

Alternative Approaches

  • An alternative approach would be to modify the git-checkout command to use '--depth=1 --no-single-branch' to fetch all tags and then checkout the specific tag. This would ensure that the repository has access to the tag reference.
  • Another approach would be to inspect the 'git-checkout' implementation in Melange and modify how the action handles tag parameters internally, if the current implementation doesn't correctly translate the tag parameter to the appropriate git command flag.
  • If the repository structure has changed and v4.101.0 is neither a branch nor a tag, we could also modify the YAML to reference the specific commit hash directly instead of using tag reference.

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 20, 2025
@octo-sts
Copy link
Contributor Author

octo-sts bot commented Jun 21, 2025

superseded by #57174

@octo-sts octo-sts bot closed this Jun 21, 2025
@octo-sts octo-sts bot deleted the wolfictl-5b1a4c64-a098-45b7-9c25-5ddf2a43fe62 branch June 22, 2025 00:02
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 code-server request-version-update request for a newer version of a package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants