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

[FIX JENKINS-42784] Fix creation optimization and empty repo #916

Closed
wants to merge 8 commits into from
Closed

[FIX JENKINS-42784] Fix creation optimization and empty repo #916

wants to merge 8 commits into from

Conversation

kzantow
Copy link
Collaborator

@kzantow kzantow commented Mar 21, 2017

Description

See JENKINS-42784.

To test this, use cases where no Jenkinsfile exists, or creating from a completely empty repo.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Appropriate unit or acceptance tests or explanation to why this change has no tests
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.
  • Ran Acceptance Test Harness against PR changes.

Reviewer checklist

  • Run the changes and verified the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

vivek and others added 5 commits March 16, 2017 19:53
These tests were passing by luck. Fixed to refer to existing repo inside
jenkinsci repo.
Fixes issue where credentials attached to the org folder was not
discovered by github scm source during github api calls.

Makes simpleOrgTest to work only with github access token to avoid
flackyness related to github api rate limit and subsequent read time
outs.
@michaelneale
Copy link
Member

🐝 especially if ATH is happy

@michaelneale
Copy link
Member

@cliffmeyers @vivek able to give your blessing?

@kzantow
Copy link
Collaborator Author

kzantow commented Mar 22, 2017

@vivek @cliffmeyers I would love if you could give this a look, but probably important to get it in quickly

Copy link
Contributor

@cliffmeyers cliffmeyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Couple minor comments. Will let @vivek have final say as he's way more knowledgeable on Java side.


StringBuilder sb = new StringBuilder();
if (gitHubSCMNavigator != null) {
Matcher matcher = Pattern.compile("\\((.*?)\\\\b\\)\\?").matcher(gitHubSCMNavigator.getPattern());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might benefit from a comment - it's clear to me because I'm familiar w/ how the repo names are put in the regexp, but others might be confused by this.

}
if (sb.length() > 0) {
gitHubSCMNavigator.setPattern(sb.toString());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general maybe some of this regexp handling code would benefit from method extraction but that's just a style thing, no biggie.

@michaelneale
Copy link
Member

🐝

@kzantow
Copy link
Collaborator Author

kzantow commented Mar 22, 2017

Already included by #919

@kzantow kzantow closed this Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants