Skip to content

Conversation

@octo-sts
Copy link
Contributor

@octo-sts octo-sts bot commented Jul 3, 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 terraform-provider-grafana labels Jul 3, 2025
@octo-sts
Copy link
Contributor Author

octo-sts bot commented Jul 3, 2025

🔄 Build Failed: Git Checkout Error

fatal: Remote branch v3.25.5 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=v3.25.5 --depth=1 https://github.com/grafana/terraform-provider-grafana

Root Cause Analysis 🔍

The build is attempting to clone the terraform-provider-grafana repository at tag v3.25.5, but Git is treating this as a branch name instead of a tag. The error occurs because there is no branch named 'v3.25.5' in the repository. The build system is trying to use a Git tag as if it were a branch.


🔍 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: terraform-provider-grafana.yaml

  • modify at line pipeline[0].with.tag (pipeline section)
    Original:
      tag: v${{package.version}}

Replacement:

      branch: v${{package.version}}
Click to expand fix analysis

Analysis

The similar fixed build failure reveals a pattern where Git checkout is failing due to a confusion between tags and branches. In the fixed example, the issue was resolved by properly configuring the git-checkout step to use tags instead of branches. The current error "fatal: Remote branch v3.25.5 not found in upstream origin" indicates the same issue - the build system is trying to use '--branch=v3.25.5' when cloning, but v3.25.5 is a tag, not a branch. The key insight from the similar fix is that we need to ensure the build is properly using tags when that's what's intended for version referencing.

Click to expand fix explanation

Explanation

The current build failure occurs because the git-checkout step is attempting to use a tag reference with the '--branch' flag in Git, but Git treats branches and tags differently. The error message "fatal: Remote branch v3.25.5 not found in upstream origin" clearly indicates Git is looking for a branch named v3.25.5, which doesn't exist.

In the Melange YAML file, we're specifying tag: v${{package.version}} but the underlying implementation is likely using this value with Git's '--branch' flag. This creates a mismatch in Git semantics.

By changing tag: v${{package.version}} to branch: v${{package.version}}, we're ensuring that the YAML configuration accurately represents what's happening under the hood. This is counterintuitive (since we're checking out a tag, not a branch), but it aligns with how the 'git-checkout' action is implemented in the build system.

This approach ensures that when the build system executes the Git command, it will use --branch=v3.25.5 with Git, which is the correct flag syntax for checking out tags in the specific implementation being used here.

Click to expand alternative approaches

Alternative Approaches

  • Another approach would be to modify the git-checkout implementation to correctly handle tags vs branches, ensuring that when 'tag:' is specified in the YAML, Git is invoked with the appropriate flags to handle tags.
  • A third option could be to investigate if a different git-checkout syntax is supported in Melange, such as 'ref:' or 'reference:' that might be implemented to handle both branches and tags properly.
  • The repository could also be cloned without branch/tag specification and then use a separate git checkout command to check out the specific tag, but this would require more extensive changes to the pipeline.

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 3, 2025
@octo-sts octo-sts bot closed this Jul 3, 2025
@octo-sts
Copy link
Contributor Author

octo-sts bot commented Jul 3, 2025

superseded by #58290

@octo-sts octo-sts bot deleted the wolfictl-b6baa0d1-0593-433d-bc45-f015c8c27a03 branch July 5, 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 request-version-update request for a newer version of a package terraform-provider-grafana

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants