We have a large GitHub organization folder job (over 100 repos) that is scanned every 15 mins for changes. Occasionally (usually overnight I think) branches are losing the build history and are reset to build number 1.

      I suspect the branch indexing is somehow losing communication with GitHub and the branch is deleted and then recreated on the next successful scan. Note this doesn't appear to happen in business hours, so possibly is a result of overnight resource conservation (Jenkins is not currently shutdown overnight).

      As a workaround I have configured to not delete branches unless unchanged for 7 days, however some branches are not updated this frequently, and I don't want to extend this period as we'll have too many jobs hanging around.

      Note also that we don't currently use webhooks to detect changes, which is why it is a periodic scan every 15 mins.

          [JENKINS-42000] GitHub organization job losing build history

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          pom.xml
          http://jenkins-ci.org/commit/github-branch-source-plugin/8b54a60c8ab2e980324af10dc9ed1b354f47f471
          Log:
          JENKINS-42000 Pick up SCM API release and update parent

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml http://jenkins-ci.org/commit/github-branch-source-plugin/8b54a60c8ab2e980324af10dc9ed1b354f47f471 Log: JENKINS-42000 Pick up SCM API release and update parent

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/2531b82542540ee6e804d8afa3bff08b4bd0293e
          Log:
          Merge pull request #119 from stephenc/jenkins-42000

          JENKINS-42000 Pick up SCM API update

          Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/85345b1c1ce0...2531b8254254

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java http://jenkins-ci.org/commit/github-branch-source-plugin/2531b82542540ee6e804d8afa3bff08b4bd0293e Log: Merge pull request #119 from stephenc/jenkins-42000 JENKINS-42000 Pick up SCM API update Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/85345b1c1ce0...2531b8254254

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/test/java/integration/EventsTest.java
          http://jenkins-ci.org/commit/branch-api-plugin/6570519345b9b6a78aa70818b07bfc7190f4e878
          Log:
          JENKINS-42000 Add test case to verify issue

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/test/java/integration/EventsTest.java http://jenkins-ci.org/commit/branch-api-plugin/6570519345b9b6a78aa70818b07bfc7190f4e878 Log: JENKINS-42000 Add test case to verify issue

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          pom.xml
          src/main/java/jenkins/branch/OrganizationFolder.java
          http://jenkins-ci.org/commit/branch-api-plugin/fef4a1490be35a31b9666006a5cec96de38d78ae
          Log:
          [FIXED JENKINS-42000] Fix the tests (and presumably the bug too)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml src/main/java/jenkins/branch/OrganizationFolder.java http://jenkins-ci.org/commit/branch-api-plugin/fef4a1490be35a31b9666006a5cec96de38d78ae Log: [FIXED JENKINS-42000] Fix the tests (and presumably the bug too)

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          pom.xml
          http://jenkins-ci.org/commit/branch-api-plugin/9e6a295c8172d713a2459c9bb35002f4325a5df3
          Log:
          JENKINS-42000 Pick up SCM API release and update parent

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml http://jenkins-ci.org/commit/branch-api-plugin/9e6a295c8172d713a2459c9bb35002f4325a5df3 Log: JENKINS-42000 Pick up SCM API release and update parent

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/test/java/integration/EventsTest.java
          http://jenkins-ci.org/commit/branch-api-plugin/02054676abef582d137c4a2d6288d0a37586f6de
          Log:
          JENKINS-42000 Note that tests were added to track this issue

          • Tests should have been part of original contract though

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/test/java/integration/EventsTest.java http://jenkins-ci.org/commit/branch-api-plugin/02054676abef582d137c4a2d6288d0a37586f6de Log: JENKINS-42000 Note that tests were added to track this issue Tests should have been part of original contract though

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          pom.xml
          src/main/java/jenkins/branch/OrganizationFolder.java
          src/test/java/integration/EventsTest.java
          http://jenkins-ci.org/commit/branch-api-plugin/76313ec24e6afc2fa7a7fb408a7d5753f8be5c99
          Log:
          Merge pull request #85 from stephenc/jenkins-42000

          JENKINS-42000 Communication errors in organization scanning should not delete all everything

          Compare: https://github.com/jenkinsci/branch-api-plugin/compare/0178b37da659...76313ec24e6a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml src/main/java/jenkins/branch/OrganizationFolder.java src/test/java/integration/EventsTest.java http://jenkins-ci.org/commit/branch-api-plugin/76313ec24e6afc2fa7a7fb408a7d5753f8be5c99 Log: Merge pull request #85 from stephenc/jenkins-42000 JENKINS-42000 Communication errors in organization scanning should not delete all everything Compare: https://github.com/jenkinsci/branch-api-plugin/compare/0178b37da659...76313ec24e6a

          Branch API 2.0.6 has the fix. (Well I claim it does)

          Stephen Connolly added a comment - Branch API 2.0.6 has the fix. (Well I claim it does)

          Ben Fortuna added a comment - - edited

          Awesome, thanks so much for the quick response. I'll confirm the fix once 2.0.6 is released.

          stephenconnolly a slight issue with installing 2.0.6 - it appears to have a dependency on scm-api 2.0.4, but the latest release is 2.0.3.

          Ben Fortuna added a comment - - edited Awesome, thanks so much for the quick response. I'll confirm the fix once 2.0.6 is released. stephenconnolly a slight issue with installing 2.0.6 - it appears to have a dependency on scm-api 2.0.4, but the latest release is 2.0.3.

          fortuna yes and scm-api 2.0.4 was released before branch-api 2.0.6... just that the OSS update center can have issues presenting a consistent set of releases when the releases were made in less than 4-8h of the update center being regenerated (and also the update center does not present a self-consistent set of plugins, e.g. JENKINS-23757 is one aspect. Another aspect is that if the update center does not have e.g. scm-api 2.0.4 then it should hold back branch-api 2.0.6 until it does have it - a feature of the CloudBees update center back-end code)

          In any case the releases should all be available now

          Stephen Connolly added a comment - fortuna yes and scm-api 2.0.4 was released before branch-api 2.0.6... just that the OSS update center can have issues presenting a consistent set of releases when the releases were made in less than 4-8h of the update center being regenerated (and also the update center does not present a self-consistent set of plugins, e.g. JENKINS-23757 is one aspect. Another aspect is that if the update center does not have e.g. scm-api 2.0.4 then it should hold back branch-api 2.0.6 until it does have it - a feature of the CloudBees update center back-end code) In any case the releases should all be available now

            stephenconnolly Stephen Connolly
            fortuna Ben Fortuna
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: