Skip to content

Conversation

@octo-sts
Copy link
Contributor

@octo-sts octo-sts bot commented Jul 25, 2025

No description provided.

@octo-sts
Copy link
Contributor Author

octo-sts bot commented Jul 25, 2025

🔄 Build Failed: Git Checkout Error

fatal: Remote branch v1.72 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=v1.72 --depth=1 https://github.com/grpc/grpc /tmp/tmp.tyHU7C

Root Cause Analysis 🔍

The build is attempting to clone the grpc repository using tag v1.72 as a branch. The v1.72 tag likely exists in the repository, but the git clone command is incorrectly using --branch instead of referring to 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: grpc-1.72.yaml

  • replace at line 66-69 (pipeline section)
    Original:
  - uses: git-checkout
    with:
      repository: https://github.com/grpc/grpc
      tag: v${{package.version}}
      expected-commit: d6b42b2fd3e522a60318c7e2f2021219c6b5c470

Replacement:

  - uses: git-checkout
    with:
      repository: https://github.com/grpc/grpc
      branch: v${{package.version}}
      expected-commit: d6b42b2fd3e522a60318c7e2f2021219c6b5c470
Click to expand fix analysis

Analysis

The similar fixed build failure shows a common pattern when dealing with Git version tags in Melange build files. In both cases, the build system is trying to use a version tag (v2.32.0 in the example, v1.72 in the current case) as a branch name with the --branch flag in the git checkout command. This is incorrect because version tags are tags, not branches. The fixed example didn't directly modify the git checkout command but instead updated the Melange build file configuration to correctly handle the tag reference. The pattern indicates that when dealing with version tags in repositories, Melange's git-checkout action needs to be properly configured to use the tag parameter rather than branch.

Click to expand fix explanation

Explanation

The build is failing because the git-checkout action is trying to check out v1.72 as a tag, but the underlying git command is using the --branch parameter, which expects a branch name, not a tag. The error "Remote branch v1.72 not found in upstream origin" clearly indicates that Git is looking for a branch named v1.72, which doesn't exist.

By changing the parameter from tag: v${{package.version}} to branch: v${{package.version}}, we correctly align the Melange configuration with how the git command is actually being executed. This ensures that the git-checkout action will properly clone the repository using --branch=v1.72 as it's currently trying to do.

This fix addresses the root cause by making the Melange configuration match the actual git command behavior. The current configuration has a mismatch between what Melange is being asked to do (checkout a tag) and how the underlying git command is being constructed (looking for a branch).

Click to expand alternative approaches

Alternative Approaches

  • Instead of changing from 'tag' to 'branch', an alternative would be to update the Melange 'git-checkout' action implementation to correctly handle tags vs branches, ensuring that when 'tag' is specified, it uses the appropriate git command parameters.
  • Another approach would be to reference the exact commit hash directly with 'expected-commit' and remove the tag/branch parameter altogether, since the expected-commit is already specified: d6b42b2fd3e522a60318c7e2f2021219c6b5c470.
  • If v1.72 is a tag and not a branch, we could also check if there's a release branch like 'release-1.72' that should be used instead of the tag.

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 Jul 25, 2025
@OddBloke OddBloke self-assigned this Jul 25, 2025
@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 Jul 25, 2025
@OddBloke OddBloke requested a review from a team July 28, 2025 13:25
@OddBloke OddBloke enabled auto-merge July 28, 2025 13:26
@OddBloke OddBloke merged commit 6270128 into main Jul 28, 2025
25 checks passed
@OddBloke OddBloke deleted the grpc-1.72 branch July 28, 2025 14:24
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. service:version-stream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants