psakar / buildmetadata-plugin-git-provider

0 stars 0 forks source link

Original scmRevision url is lost #3

Closed rnc closed 8 years ago

rnc commented 8 years ago

With the normally configured metadata plugin I might end up with e.g.

build.scmRevision.date=08.02.2015
build.scmRevision.id=5bffd87ffaac9fc81f7d483529539940a085e22b
build.scmRevision.url=scm\:git\:git@github.com\:searchbox-io/Jest.git

With this configured I get

build.scmRevision.date=08.02.2015 build.scmRevision.id=5bffd87ffaac9fc81f7d483529539940a085e22b build.scmRevision.url=scm:git:git+ssh:// /jest.git

I think this should be build.scmRevision.mirrorUrl ?

psakar commented 8 years ago

The intent is to use in the build.scmRevisionUrl the url of git used to check out the project

rnc commented 8 years ago

But this means we have lost information rather than adding to it. Where do we record the upstream information in the metadata?

psakar commented 8 years ago

would you agree with solution to store the scmRevisionUrl parsed from pom in build.scmRevision.pom_url ?

rnc commented 8 years ago

If (which I know is not consistent), the META-INF/MANIFEST.MF has been configured to add the metadata that would use the POM SCM URL. Which IMHO I think we should be consistent with, and hence use something like build.scmRevision.mirrorUrl

@jdcasey - thoughts?

Thinking on this leads to a couple of questions:

  1. What happens if upstream pom points to repository X on github. This is mirrored onto a private github repository (a product branch). Onto this, some fixes (e.g. product branding is applied). This branch is then mirrored internally. When the git SHA is established, does the code read the local, current git sha? i.e. it doesn't matter what the SCM is configured with at that point?
  2. For a reproducible build, which @pgier is concerned about, if a developer rebuilds the project internally they should get the same metadata / same build? What about if a customer rebuilds it - I suppose, without the mirror url information it will be different?
psakar commented 8 years ago

that return us to old discussion. in case of eap, the git used to build is master, not the mirror, as it can contain prod commit not available in upstream. so mirror url does not make sense, and if you specify in build.scmRevision.url upstream url, you will not be able to find the commit