#Is there a way to get the git info from

1 messages · Page 1 of 1 (latest)

high meadow
#

My use case is, I have a module that runs sonar scans and sonar needs the vcs information to do a proper comparison. Curious if this is possible today.

humble flint
#

What kind of git info? Like the head of pull/123/merge in that case?

high meadow
#

sonar needs prID, prTarget, prSource (names of the branches) or branchName if running in a branch and not a PR

humble flint
#

Got it. I think @rocky stump has probably pulled this thread the most. Wdyt?

rocky stump
#

similar to how we have contextual directories

#

we need to have contextual git

#

however, it's not fully there, but it's getting a lot closer than we were previously

high meadow
#

awesome! This would be super useful!

#

I guess there is no workaround for now. I may end up hardcoding an arbitrary branch. If not, sonar runs a scan against main and since it has nothing to compare to it fails.

rocky stump
#

mmm yeah you could always attach the info through the constructor?

high meadow
#

Interesting. I didn't want to default the branch because I am using the null'ness to determine whether to attach branch info or pr info if not. But if it's a static arbitrary branch I can check for that too

high meadow
#

when passing a git repo as directory, is it not possible to use a branch or a PR ref?

#

referring to a module via dagger -m github.com... works with refs like @nonmainbranch or @pull/123/merge but I can't do the same with dagger.Directory() argument

humble flint
#

Agree the inconsistency is confusing! #pr/123/merge or #pr/123/head should work for PR though