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

Anonymous scan credentials causes checkout to fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins 1.625.3, GitHub Branch Source Plugin 1.2, GitHub Enterprise

      I am getting an error when I have my credentials set to none or anonymous. The branch indexing works properly and automatically finds new PR's when they are created, but the builds themselves fail because the checkout command doesn't seem to be willing to run without specific credentials.

      No scan credentials, skipping
      ERROR: Could not determine exact tip revision of PR-5; falling back to nondeterministic checkout
       > C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from 2 remote Git repositories
       > C:\Program Files\Git\bin\git.exe config remote.origin.url https://<github enterprise server>/<org>/<project>.git # timeout=10
      Fetching upstream changes from https://<github enterprise server>/<org>/<project>.git
       > C:\Program Files\Git\bin\git.exe --version # timeout=10
       > C:\Program Files\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://<github enterprise server>/<org>/<project>.git +refs/heads/*:refs/remotes/origin/*
       > C:\Program Files\Git\bin\git.exe config remote.origin1.url https://<github enterprise server>/<org>/<project>.git # timeout=10
      Fetching upstream changes from https://<github enterprise server>/<org>/<project>.git
       > C:\Program Files\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://<github enterprise server>/<org>/<project>.git +refs/pull/*/merge:refs/remotes/origin/pr/*
      Seen branch in repository origin/master
      Seen branch in repository origin/pr/1
      Seen branch in repository origin/pr/2
      Seen branch in repository origin/pr/5
      Seen 4 remote branches
      ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
      Finished: FAILURE
      

      Based on reading some other issues, it appears to me that anonymous access was intentionally left unusable due to concerns with API rate limiting. There also appeared to be a comment that the rate limiting doesn't apply to a Github Enterprise Server, which is what I'm using here. I understand discouraging people from using anonymous access, but right now it appears to work correctly for indexing and then break during checkout. Can similar logic to what happens during indexing be added to the checkout to allow anonymous to get the revision to checkout?

      From reading the code it appears that the function retrieve(SCMHead, TaskListener) needs to have functionality closer to that of retrieve(SCMHeadObserver, TaskListener) Also, should retrieve(SCMHead, TaskListener) be using the checkout credentials instead of the scan credentials? Either way, I think it should allow anonymous credentials to be used.

            andne Andy Neebel
            andne Andy Neebel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: