Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-22169

Migration from setenv overwrites existing envinject configuration

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If a job had both setenv and envinject configuration the "auto-migration" of setenv overwrites existing envInject configuration in the job.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Robert Sandell
          Path:
          .gitignore
          src/main/java/hudson/plugins/envfile/EnvFileBuildWrapper.java
          src/main/java/hudson/plugins/setenv/SetEnvBuildWrapper.java
          src/main/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapper.java
          src/main/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationListener.java
          src/test/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapperTest.java
          src/test/resources/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapperTest/testSetEnvAndEnvInject.zip
          http://jenkins-ci.org/commit/envinject-plugin/eac6c25d15978d4c9e9921efed8418b8ef34418e
          Log:
          Fix JENKINS-22169

          If setenv and envinject are both configured for a job the
          EnvInjectMigrationBuildWrapper will overwrite existing envinject config.

          This fix introduces the migration in SetEnvBuildWrapper to the original project
          so it can check if there is any existing config and transfer that over before
          returning the replacement. It currently only looks at the propertiesContent
          and any other config will still be overwritten.

          Change-Id: Ief68f06d714f0a31f8fc8461aaa4cd893c64599b

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: .gitignore src/main/java/hudson/plugins/envfile/EnvFileBuildWrapper.java src/main/java/hudson/plugins/setenv/SetEnvBuildWrapper.java src/main/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapper.java src/main/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationListener.java src/test/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapperTest.java src/test/resources/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapperTest/testSetEnvAndEnvInject.zip http://jenkins-ci.org/commit/envinject-plugin/eac6c25d15978d4c9e9921efed8418b8ef34418e Log: Fix JENKINS-22169 If setenv and envinject are both configured for a job the EnvInjectMigrationBuildWrapper will overwrite existing envinject config. This fix introduces the migration in SetEnvBuildWrapper to the original project so it can check if there is any existing config and transfer that over before returning the replacement. It currently only looks at the propertiesContent and any other config will still be overwritten. Change-Id: Ief68f06d714f0a31f8fc8461aaa4cd893c64599b
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          .gitignore
          src/main/java/hudson/plugins/envfile/EnvFileBuildWrapper.java
          src/main/java/hudson/plugins/setenv/SetEnvBuildWrapper.java
          src/main/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapper.java
          src/main/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationListener.java
          src/test/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapperTest.java
          src/test/resources/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapperTest/testSetEnvAndEnvInject.zip
          http://jenkins-ci.org/commit/envinject-plugin/c68558aba60280ea1d56978d827e91da5a5118e2
          Log:
          Merge pull request #28 from rsandell/jenkins-22169

          Fix JENKINS-22169

          Compare: https://github.com/jenkinsci/envinject-plugin/compare/0287bec62dd8...c68558aba602

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: .gitignore src/main/java/hudson/plugins/envfile/EnvFileBuildWrapper.java src/main/java/hudson/plugins/setenv/SetEnvBuildWrapper.java src/main/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapper.java src/main/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationListener.java src/test/java/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapperTest.java src/test/resources/org/jenkinsci/plugins/envinject/migration/EnvInjectMigrationBuildWrapperTest/testSetEnvAndEnvInject.zip http://jenkins-ci.org/commit/envinject-plugin/c68558aba60280ea1d56978d827e91da5a5118e2 Log: Merge pull request #28 from rsandell/jenkins-22169 Fix JENKINS-22169 Compare: https://github.com/jenkinsci/envinject-plugin/compare/0287bec62dd8...c68558aba602

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              rsandell rsandell
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: