Skip to content

Instantly share code, notes, and snippets.

@KostyaSha
Last active December 10, 2015 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KostyaSha/1de94870ae254520f218 to your computer and use it in GitHub Desktop.
Save KostyaSha/1de94870ae254520f218 to your computer and use it in GitHub Desktop.
[21:34] <kohsuke> KostyaSha: it is to remember what commits it has built on what branches
[21:34] <kohsuke> ... which is necessary in the general case of one job building all the branches
[21:35] <KostyaSha> kohsuke, hm, why not store it near job config?
[21:35] <KostyaSha> like git.runtime.xml
[21:35] <kohsuke> that would have worked too, I think
[21:36] <kohsuke> oleg-nenashev: just in case, when I say code signatures I mean digital signature on the executable file
[21:36] <KostyaSha> kohsuke, so what do you think about mu suggestion on passing this call to BuildChooser https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitSCM.java#L1002
[21:37] <kohsuke> I don't understand what you mean by "passing this call"
[21:37] <KostyaSha> kohsuke, get BuildChooser stratefy and allow extension to find right BuildData
[21:37] <KostyaSha> default impl will be build.getPreviousBuild()
[21:39] <KostyaSha> kohsuke, in this way i will have for every build right attached BuildData that will show in UI only PR related info
[21:40] <kohsuke> I'm still struggling with what you are trying to say, but I'm guessing that your question is "what if we allow BuildChooser to determine the effective "previous build" to copy BuildData from, instead of always using build.getPreviousBuild() as it is today?"
[21:40] <KostyaSha> kohsuke, exactly :)
[21:41] <KostyaSha> kohsuke, like it done for changelogs https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitSCM.java#L1108
[21:42] <kohsuke> KostyaSha: yeah, great discovery that is prevBuildForChangelog(...)
[21:43] <kohsuke> Can that same method be used here?
[21:44] <KostyaSha> kohsuke, but it has not obvious name
[21:44] <KostyaSha> though it looks right to use the same BuildData for changelog and for initial BuildData
[21:45] <KostyaSha> kohsuke, maybe better create new proxy method getPreviousBuildData(args) { return prevBuildForChangelog();} ?
[21:45] <KostyaSha> in case this behavior will be needed for some strange case...
[22:07] <KostyaSha> kohsuke, so BuildData is the first problem. The way of configuring git scm for PR builds is other.
[22:10] <kohsuke> KostyaSha: create new proxy method --- works for me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment