Re: Git Parameter plugin ambiguous log messages
https://issues.jenkins-ci.org/browse/JENKINS-40523 On Saturday, November 26, 2016 at 12:06:15 AM UTC-7, Oleg Nenashev wrote: > > Have you created a JIRA ticket for it? > This mailing list is not a bugtracker && not all plugin maintainers read > all messages. > > среда, 16 ноября 2016 г., 23:44:19 UTC+3 пользователь Michael Giroux > написал: >> >> The following log message would be a lot more informative if it provided >> the job name so we could go adjust the configuration. >> >> Git Parameter Version 0.7.0 >> Jenkins 2.19.2 LTS >> JDK 1.8 >> >> Nov 16, 2016 8:36:01 PM >> net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition >> getBranch >> INFO: Specified branchFilter is not a valid regex. Setting to .* >> >> >> >> -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/67373411-fa21-4d18-80ec-e3099ab693b6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Git Parameter plugin ambiguous log messages
The following log message would be a lot more informative if it provided the job name so we could go adjust the configuration. Git Parameter Version 0.7.0 Jenkins 2.19.2 LTS JDK 1.8 Nov 16, 2016 8:36:01 PM net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition getBranch INFO: Specified branchFilter is not a valid regex. Setting to .* -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/28d82fad-08fa-40c9-9865-1a6bfb7f80a6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Enhancing LocalBranch to support maven release builds
Thanks Mark. Any chance you could quantify "a while"? Perhaps in terms of weeks? Would like to report to my employer when we can hope for it to be included. On Wednesday, March 2, 2016 at 8:58:43 AM UTC-7, Mark Waite wrote: > > > > On Tuesday, March 1, 2016 at 7:48:02 PM UTC-7, Michael Giroux wrote: >> >> What can I do to get some traction on this pull request ( >> https://github.com/jenkinsci/git-plugin/pull/381 >> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fgit-plugin%2Fpull%2F381&sa=D&sntz=1&usg=AFQjCNE0po0xwGqRjP6EXDBVvHbBWwUK4w>) >> >> The functionality is common to any type of maven release build, builds >> performed by the maven plugin, and builds performed by manual build steps. >> The maven-release-plugin requires that the local branch name is the same >> as the remote branch name, so it is necessary to have a way to derive local >> branch name from the branch being built. Since git plugin always includes >> the remote name in the GIT_BRANCH variable, we need a new facility to strip >> the remote name to derive the local branch name. >> >> > It is in the queue of pull requests to be evaluated on the git plugin. > There are several requests ahead of it, so it will be a while before it is > evaluated. > > Mark Waite > > >> I'm running this plugin locally with no adverse effects, the new test >> cases pass, and the code coverage appears to reflect decent test coverage. >> >> Michael >> >> On Tuesday, February 23, 2016 at 4:36:37 PM UTC-7, Michael Giroux wrote: >>> >>> I have submitted a pull request to extend the functionality of >>> LocalBranch to make it easier to configure a job that can be used to build >>> any branch (via notifyCommit) and also perform maven builds on any branch >>> using a combination of Git Parameter plugin, and LocalBranch extension ( >>> https://github.com/jenkinsci/git-plugin/pull/381 >>> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fgit-plugin%2Fpull%2F381&sa=D&sntz=1&usg=AFQjCNE0po0xwGqRjP6EXDBVvHbBWwUK4w> >>> ) >>> >>> The main issue is that the maven release plugin requires that the local >>> branch name is the same as the remote branch. As described here ( >>> https://maven.apache.org/scm/git.html) the maven release plugin will >>> perform a push as >>> >>> git push pushUrl currentBranch:currentBranch >>> >>> >>> Hence, if we are doing a release build on origin/master, then the local >>> branch needs to be master. >>> >>> The new feature is triggered when LocalBranch is set to "**" or null >>> (empty string). The "**" is consistent with other "any branch" place >>> holders throughout the existing git-plugin. >>> >> -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/9cb89e2d-f91c-4c68-9f6f-e38d5bd12fa2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Enhancing LocalBranch to support maven release builds
Created an issue to describe the need for this feature: https://issues.jenkins-ci.org/browse/JENKINS-33202 On Tuesday, March 1, 2016 at 7:48:02 PM UTC-7, Michael Giroux wrote: > > What can I do to get some traction on this pull request ( > https://github.com/jenkinsci/git-plugin/pull/381 > <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fgit-plugin%2Fpull%2F381&sa=D&sntz=1&usg=AFQjCNE0po0xwGqRjP6EXDBVvHbBWwUK4w>) > > The functionality is common to any type of maven release build, builds > performed by the maven plugin, and builds performed by manual build steps. > The maven-release-plugin requires that the local branch name is the same > as the remote branch name, so it is necessary to have a way to derive local > branch name from the branch being built. Since git plugin always includes > the remote name in the GIT_BRANCH variable, we need a new facility to strip > the remote name to derive the local branch name. > > I'm running this plugin locally with no adverse effects, the new test > cases pass, and the code coverage appears to reflect decent test coverage. > > Michael > > On Tuesday, February 23, 2016 at 4:36:37 PM UTC-7, Michael Giroux wrote: >> >> I have submitted a pull request to extend the functionality of >> LocalBranch to make it easier to configure a job that can be used to build >> any branch (via notifyCommit) and also perform maven builds on any branch >> using a combination of Git Parameter plugin, and LocalBranch extension ( >> https://github.com/jenkinsci/git-plugin/pull/381 >> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fgit-plugin%2Fpull%2F381&sa=D&sntz=1&usg=AFQjCNE0po0xwGqRjP6EXDBVvHbBWwUK4w> >> ) >> >> The main issue is that the maven release plugin requires that the local >> branch name is the same as the remote branch. As described here ( >> https://maven.apache.org/scm/git.html) the maven release plugin will >> perform a push as >> >> git push pushUrl currentBranch:currentBranch >> >> >> Hence, if we are doing a release build on origin/master, then the local >> branch needs to be master. >> >> The new feature is triggered when LocalBranch is set to "**" or null >> (empty string). The "**" is consistent with other "any branch" place >> holders throughout the existing git-plugin. >> > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/9dbab9c0-e9b6-4ca6-b088-4405bd80a50d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Enhancing LocalBranch to support maven release builds
What can I do to get some traction on this pull request ( https://github.com/jenkinsci/git-plugin/pull/381 <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fgit-plugin%2Fpull%2F381&sa=D&sntz=1&usg=AFQjCNE0po0xwGqRjP6EXDBVvHbBWwUK4w>) The functionality is common to any type of maven release build, builds performed by the maven plugin, and builds performed by manual build steps. The maven-release-plugin requires that the local branch name is the same as the remote branch name, so it is necessary to have a way to derive local branch name from the branch being built. Since git plugin always includes the remote name in the GIT_BRANCH variable, we need a new facility to strip the remote name to derive the local branch name. I'm running this plugin locally with no adverse effects, the new test cases pass, and the code coverage appears to reflect decent test coverage. Michael On Tuesday, February 23, 2016 at 4:36:37 PM UTC-7, Michael Giroux wrote: > > I have submitted a pull request to extend the functionality of LocalBranch > to make it easier to configure a job that can be used to build any branch > (via notifyCommit) and also perform maven builds on any branch using a > combination of Git Parameter plugin, and LocalBranch extension ( > https://github.com/jenkinsci/git-plugin/pull/381 > <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjenkinsci%2Fgit-plugin%2Fpull%2F381&sa=D&sntz=1&usg=AFQjCNE0po0xwGqRjP6EXDBVvHbBWwUK4w> > ) > > The main issue is that the maven release plugin requires that the local > branch name is the same as the remote branch. As described here ( > https://maven.apache.org/scm/git.html) the maven release plugin will > perform a push as > > git push pushUrl currentBranch:currentBranch > > > Hence, if we are doing a release build on origin/master, then the local > branch needs to be master. > > The new feature is triggered when LocalBranch is set to "**" or null > (empty string). The "**" is consistent with other "any branch" place > holders throughout the existing git-plugin. > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/6455da2f-fa91-4c95-94bc-ad59ecac764a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Enhancing LocalBranch to support maven release builds
I have submitted a pull request to extend the functionality of LocalBranch to make it easier to configure a job that can be used to build any branch (via notifyCommit) and also perform maven builds on any branch using a combination of Git Parameter plugin, and LocalBranch extension (https://github.com/jenkinsci/git-plugin/pull/381) The main issue is that the maven release plugin requires that the local branch name is the same as the remote branch. As described here ( https://maven.apache.org/scm/git.html) the maven release plugin will perform a push as git push pushUrl currentBranch:currentBranch Hence, if we are doing a release build on origin/master, then the local branch needs to be master. The new feature is triggered when LocalBranch is set to "**" or null (empty string). The "**" is consistent with other "any branch" place holders throughout the existing git-plugin. -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/35afc9d7-f285-4299-b652-2f4bf5e41617%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Why is GIT_BRANCH set twice in GitSCM.checkout
I added a few log messages to track the progress of a build and discovered that buildEnvVars is called several times. I doubt this hurts anything, but it seems this could be optimized some. Feb 22, 2016 2:56:26 PM hudson.plugins.git.GitSCM buildEnvVars INFO: ENTER Feb 22, 2016 2:56:26 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_BRANCH: origin/master Feb 22, 2016 2:56:26 PM hudson.plugins.git.GitSCM buildEnvVars INFO: LocalBranch configured as: null Feb 22, 2016 2:56:26 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_LOCAL_BRANCH: master Feb 22, 2016 2:56:26 PM net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition generateContents INFO: generateContents contenttype PT_BRANCH RemoteConfig [file:///Users/mgiroux/understanding-jenkins] Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: ENTER Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_BRANCH: origin/master Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: LocalBranch configured as: null Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_LOCAL_BRANCH: master Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: ENTER Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_BRANCH: origin/master Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: LocalBranch configured as: null Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_LOCAL_BRANCH: master Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: ENTER Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_BRANCH: origin/master Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: LocalBranch configured as: null Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_LOCAL_BRANCH: master Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM checkout INFO: Setting GIT_BRANCH: origin/master Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM checkout INFO: LocalBranch configured as: null Feb 22, 2016 2:56:30 PM hudson.plugins.git.GitSCM checkout INFO: Setting GIT_LOCAL_BRANCH: master Feb 22, 2016 2:56:31 PM hudson.plugins.git.GitSCM buildEnvVars INFO: ENTER Feb 22, 2016 2:56:31 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_BRANCH: origin/master Feb 22, 2016 2:56:31 PM hudson.plugins.git.GitSCM buildEnvVars INFO: LocalBranch configured as: null Feb 22, 2016 2:56:31 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_LOCAL_BRANCH: master Feb 22, 2016 2:56:31 PM hudson.model.Run execute INFO: DefaultEnvironmentReport #22 main build action completed: SUCCESS Feb 22, 2016 2:56:31 PM hudson.plugins.git.GitSCM buildEnvVars INFO: ENTER Feb 22, 2016 2:56:31 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_BRANCH: origin/master Feb 22, 2016 2:56:31 PM hudson.plugins.git.GitSCM buildEnvVars INFO: LocalBranch configured as: null Feb 22, 2016 2:56:31 PM hudson.plugins.git.GitSCM buildEnvVars INFO: Setting GIT_LOCAL_BRANCH: master On Monday, February 22, 2016 at 2:43:17 PM UTC-7, Michael Giroux wrote: > > I'm looking to add a new environment variable to expose the LocalBranch > name as GIT_LOCAL_BRANCH. I'm looking at the code in GitSCM.checkout and > am not able to figure out why GIT_BRANCH is being set twice. > > GIT_BRANCH is set first when checkout sets environment: > > EnvVars environment = build.getEnvironment(listener); > > This call results in a call to GitSCM.buildEnvVars which will set > GIT_BRANCH. > > A few lines later, GitSCM.checkout tests GIT_BRANCH again: > > environment.put(GIT_COMMIT, revToBuild.revision.getSha1String()); > > Branch branch = Iterables.getFirst(revToBuild.revision > .getBranches(),null); > > if (branch != null && branch.getName() != null) { // null for a > detached HEAD > > environment.put(GIT_BRANCH, getBranchName(branch)); > > } > > Do I need to set my new variable GIT_LOCAL_BRANCH in checkout AND > buildEnvVars, or can I get by with setting it only in checkout? > > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b5668284-b5b3-4147-ad23-b63ec1a9ba74%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Why is GIT_BRANCH set twice in GitSCM.checkout
I'm looking to add a new environment variable to expose the LocalBranch name as GIT_LOCAL_BRANCH. I'm looking at the code in GitSCM.checkout and am not able to figure out why GIT_BRANCH is being set twice. GIT_BRANCH is set first when checkout sets environment: EnvVars environment = build.getEnvironment(listener); This call results in a call to GitSCM.buildEnvVars which will set GIT_BRANCH. A few lines later, GitSCM.checkout tests GIT_BRANCH again: environment.put(GIT_COMMIT, revToBuild.revision.getSha1String()); Branch branch = Iterables.getFirst(revToBuild.revision .getBranches(),null); if (branch != null && branch.getName() != null) { // null for a detached HEAD environment.put(GIT_BRANCH, getBranchName(branch)); } Do I need to set my new variable GIT_LOCAL_BRANCH in checkout AND buildEnvVars, or can I get by with setting it only in checkout? -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/bb9f615d-d905-4cad-8535-cf36926519a7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
git-plugin better support for Maven release
Issue: When performing a maven release, it is necessary that the local branch name is the same as the remote branch sans "origin/" to allow successful pushes of the updated pom files. The maven release plugin does a push as "git push origin {local_branch}:{local_branch}". As a result of this, we must checkout to a local branch. A detached head does not work. In the interest of creating a single Jenkins job that can build and release any branch, we configure the job with: Git Parameter, to allow selecting any branch specified by ${BRANCH}. Git Plugin builds branch specified by ${BRANCH} Unfortunately, ${BRANCH} will be origin/master, or origin/some-other-branch We need to specify a separate parameter for local branch, and use this parameter in the Local Branch extension. This approach requires the build person to enter the branch twice, once in the Git Parameter, and manually in a separate string parameter to specify the local branch to build. Proposal: To simplify this sequence, I have modified the git plugin GitSCM.checkout() method to allow the Local Branch extension to be specified without a value. In this case, the local branch is derived from the remote branch being built. In addition, the environment variable GIT_LOCAL_BRANCH is set. If the LocalBranch extension specifies a value, that value is used asis. If the value is null (LocalBranch was configured, but not set) then the value is derived from GIT_BRANCH by removing 'origin/'. Help Needed: I have cloned the git plugin, and updated GitSCM.commit() and the GitSCMTest. The project builds, but my new test cases fail because GIT_BRANCH and GIT_LOCAL_BRANCH have not been set. From this I conclude that I do not understand the test infrastructure. I will appreciate a code review of the changes in https://github.com/mlgiroux/git-plugin.git. I'm reluctant to create a PR back to the jenkins/git-plugin repo since this is my first attempt to contribute, and I'm not entirely sure of the process. Guidance appreciated. -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/7fce8a79-4657-464b-afe2-64589c4e7c36%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.