Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-64800] Recursively check previous builds for changes during polling #185

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stuartrowe
Copy link
Contributor

Fix for https://issues.jenkins.io/browse/JENKINS-64800.

My team recently ran into this issue because of problems with authentication against our company's LDAP servers.

In our case a run would fail at the p4 checkout stage because of the authentication issues. Subsequent polling tasks for the job would fail to find new changes because the last run didn't have an associated TagAction.

As suggested in one of the comments on JENKINS-64800, our fix iterates through earlier builds in an attempt to find a baseline for polling.

Testing done

There aren't currently any unit tests related to polling. Instead my team created a manual test with the following steps:

  1. Temporarily swap a valid credential with an invalid one
  2. Run a job using that credential and note that it fails during checkout
  3. Restore the valid credential
  4. Submit a change to trigger polling and confirm that polling is successful

We confirmed that this test failed with p4-plugin 1.14.1 and succeeded with the fix.

Submitter checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
    Options
  2. Ensure that the pull request title represents the desired changelog entry
    Options
  3. Please describe what you did
    Options
  4. Link to relevant issues in GitHub or Jira
    Options
  5. Link to relevant pull requests, esp. upstream and downstream changes
    Options
  6. Ensure you have provided tests - that demonstrates feature works or fixes the issue
    Options

@stuartrowe
Copy link
Contributor Author

@p4paul could you please review this when you have a chance?

@stuartrowe
Copy link
Contributor Author

Close + Reopen to re-trigger CI.

@stuartrowe stuartrowe closed this Sep 15, 2023
@stuartrowe stuartrowe reopened this Sep 15, 2023
@stuartrowe
Copy link
Contributor Author

@p4paul @skumar7322 are either of you available to review this?

@skumar7322
Copy link
Contributor

Thanks, @stuartrowe for initiating this pull request. This change will throw the NPE when lastRun is null. Because of this, there are test failures in PollingTest, PerforceSCMSourceTest suit.
Please execute these test suites for your proposed changes. Also given our planned workload, we intend to address JENKINS-64800 in our upcoming releases.

@stuartrowe
Copy link
Contributor Author

@skumar7322 thanks for pointing that out, I had overlooked it somehow. Should be addressed now 🤞.

@stuartrowe
Copy link
Contributor Author

@skumar7322 there seems to be an issue with org.jenkinsci.plugins.p4.SimpleTestServer that is affecting other PRs too.

@stuartrowe
Copy link
Contributor Author

@skumar7322 is there any update on the next planned release and a fix for JENKINS-64800? If not, can this PR please be revisited?

@skumar7322
Copy link
Contributor

Hi @stuartrowe this change looks good to me. I will run the tests on this and merge it once all is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants