-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fetch target revision which is not merged to HEAD
#1604
Comments
I think I've also encountered this myself. This feels like a bug to me. Gerrit support - Argo CD is typically agnostic to such things. @yujunz are you able to provide reproduction steps please? |
As I described, "The reason is probably this commit is NOT merged to HEAD and the ref is NOT included in default fetched heads i.e. refs/heads/*.". Gerrit has its own way to manage refs. You may reproduce it on any Gerrit server. Just try to deploy from a patch that is NOT merged yet. |
It seems such refs are skipped on-purpose in https://github.com/argoproj/argo-cd/blob/master/util/git/client.go#L204 if refName != "HEAD" && !strings.HasPrefix(refName, "refs/heads/") && !strings.HasPrefix(refName, "refs/tags/") {
// ignore things like 'refs/pull/' 'refs/reviewable'
continue |
@yujunz the goal of this logic was to be able to support: git clone https://giturl.com/org/proj
git checkout XXXXX Where XXXXXX is a symbolic reference (e.g. HEAD), branch name, tag, commit sha (basically anything supported after I think for your use case, you would need to supply the commit sha instead of the reference for this to work. |
@jessesuen I tried commit SHA, since it is NOT merged to HEAD nor any fetched refs, check out will fail to find it. |
But there has to be some repo (e.g. the downstream repo) hosted somewhere. In other words, the commit SHA has to be valid someplace clone-able, right? The trick to address your use case is supplying both the clone-able repo URL and commit-SHA for the preview. Another way to ask this is, for the command: |
Just regular ssh url
|
How? could you give an example. If I put them separately, it doesn't work. Since |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Part of the problem is addressed in #2201 . To make it more user friendly, it would be nice if we can infer |
I'd love to see this picked up again, I'd have loved finishing #2201, but after a quick look at the changes I have a feeling my extremely limited knowledge of Go and complete ignorance of Argo CD internals will make it too tall an order to pull of on my own 😞 |
commit sha doesn't work though..... and i'm supplying the correct format as i'm getting some other error if i supply only the first 7 / 8 / 9 characters from the sha ........ neither supplying a branch name that's not merged into master... |
Should this make it possible to set the target revision to pull request refs that are from forked repos? I'm currently getting "reference is not a tree" when using something along the lines of |
Is your feature request related to a problem? Please describe.
I was trying to create application from an under review patch in Gerrit. However, the target revision is considered invalid in argo-cd.
The reason is probably this commit is NOT merged to HEAD and the ref is NOT included in default fetched heads i.e.
refs/heads/*
.But as a developer, I would like to have a test deployment before merging the patch.
Describe the solution you'd like
Fetch the revision before checkout, e.g.
Describe alternatives you've considered
A full support of Gerrit would be even better. This is how
git-review
helper query, fetch and checkout a target revision.It would be nice to support spec like
Additional context
N/A
The text was updated successfully, but these errors were encountered: