-
Notifications
You must be signed in to change notification settings - Fork 280
fix: return revision from getGitGeneratorInfo #520
Conversation
f6b041d
to
d7911a6
Compare
I see that this puts back the errors package that was addressed in #509 Unfortunately, the build did not work for me without this dependency (which was re-introduced by running I'm not really sure what is causing this. @crenshaw-dev would you know anything about this? |
Strange. What was the error message when building? |
See workflow run https://github.com/argoproj/applicationset/runs/5333719894?check_suite_focus=true Once I ran the |
Yep, that's weird. Opened a PR to fix just that. #525 |
I'm not too familiar with the go ecosystem, but could it be because of https://github.com/argoproj/applicationset/blob/master/pkg/services/scm_provider/github.go#L5 that It seems that the However, I tested removing this import and code, and still got the same error, strangely enough |
Yeah, I guess it's a transient dependency. I'm not sure when/why go mod decides it needs indirect dependencies explicitly listed in go.mod, but guess we gotta trust it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Would be interested to see a test added, if that's not too tricky. But for a trivial change, I think this is fine. :-)
I'll have a look. It seems that |
adb732e
to
e78fc97
Compare
87a8bf9
to
1e89af4
Compare
Signed-off-by: Reinier Timmer <reinier.timmer@ah.nl>
@crenshaw-dev it took a while before I got some time, but I added a test case. It wasn't that tricky, but I needed to add the revision in the mock git-generator (default it to master), because it was not used anywhere in the tests. I'm guessing the test suite was a bit limited in that sense. Anyway, when removing my fix (the one line) the test fails, but with the change it succeeds as expected. Who should I include to get this merged? @wtam2018 would you mind having a look? |
@jgwest would you mind having a look? |
LGTM to me, moving this in argocd |
@reiniertimmer : Can u please move this PR into argocd as applicationset is moved. If u find it laborious, i can do it on your behalf with your consent |
@rishabh625 thanks! Sure can do, I will have a look to find some time to move it over |
It seems that the webhook endpoint was not working completely as expected when tracking a repository branch (other than the default branch).
It turns out that the
revision
that is being used to compare against thetargetRevision
is always empty. So the test on https://github.com/argoproj/applicationset/blob/master/pkg/utils/webhook.go#L246 would always returnfalse
.The
revision
field is already being evaluated on https://github.com/argoproj/applicationset/blob/master/pkg/utils/webhook.go#L146, but for some reason it was never included in the response.After this change, we verified this on our own installation and now the webhook processing does recognize the correct branches on
push
events from GitHub.