Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot fetch/checkout specific version with no branch #415

Open
gsaslis opened this issue Sep 1, 2023 · 1 comment
Open

Cannot fetch/checkout specific version with no branch #415

gsaslis opened this issue Sep 1, 2023 · 1 comment
Labels

Comments

@gsaslis
Copy link

gsaslis commented Sep 1, 2023

Describe the bug

  • I am trying to use the git resource to fetch a specific commit from a repository.
  • The commit exists on the repository.
  • The commit is not on a specific branch.
  • git-resource cannot find this version.ref.

Reproduction steps

  1. Start up concourse (7.9.1)
  2. Define pipeline
---
resources:
- icon: git
  name: repo
  source:
    uri: "https://radicle.yorgos.net.gr/z4QJ2XjzjTioTfuWkR2J2rJjeL9dg.git"
  type: git

jobs:
- name: configure-pipeline
  plan:
  - get: "repo"
    params:
      fetch: ["48bb15c1ed6f085c0ee0b3f813a991cedd195f2b", "4c4a3907f9e13018f7899b4ae98d92782fa5ab44"]
    version:
      ref: 4c4a3907f9e13018f7899b4ae98d92782fa5ab44

  - file: "repo/.concourse/config.yaml"
    set_pipeline: self
    vars:
      patch_head: 4c4a3907f9e13018f7899b4ae98d92782fa5ab44
  1. Create and trigger pipeline in concourse
fly -t tutorial set-pipeline -p repo-configure -c pipeline.yaml
fly -t tutorial unpause-pipeline -p config
fly -t tutorial trigger-job --job config/configure-pipeline --watch
  1. Job gets stuck on:
preparing build
checking pipeline is not paused
checking job is not paused
discovering any new versions of repo
waiting for a suitable set of input versions
repo - pinned version ref:4c4a3907f9e13018f7899b4ae98d92782fa5ab44 not found
checking max-in-flight is not reached

Expected behavior

I should be able to fetch/checkout specific commits, even when they are not on a branch.

Here is the commit https://app.radicle.xyz/nodes/radicle.yorgos.net.gr/rad:z4QJ2XjzjTioTfuWkR2J2rJjeL9dg/commits/4c4a3907f9e13018f7899b4ae98d92782fa5ab44

Here is how I can clone the repo and checkout the specific commit with git tooling:

git clone https://radicle.yorgos.net.gr/z4QJ2XjzjTioTfuWkR2J2rJjeL9dg.git test-my-ci
cd test-my-ci
git fetch origin 48bb15c1ed6f085c0ee0b3f813a991cedd195f2b
git fetch origin 4c4a3907f9e13018f7899b4ae98d92782fa5ab44
git checkout FETCH_HEAD

Additional context

I tried various permutations of this:

  • defining version.ref on the resource / on the get step
  • adding params.fetch on the get step (which seems to be supported by the in script)
  • using the commit hash as the branch

... with no luck.

If it sounds like this scenario should be supported and that there should be some combination that supports this, I would really appreciate some pointers!

Thanks in advance!!

Relevant references I found:

@gsaslis gsaslis added the bug label Sep 1, 2023
@qzk
Copy link

qzk commented Sep 14, 2023

this is a hack, but try to change uri: "https://..." into:
uri: "--no-single-branch https://..."

does that go through for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants