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-26100] Switch buildEnvVars and others to Run #492

Merged
merged 12 commits into from Jun 21, 2017

Conversation

Projects
None yet
5 participants
@abayer
Copy link
Member

commented May 1, 2017

@reviewbybees

This comment has been minimized.

Copy link

commented May 1, 2017

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@jglick

jglick approved these changes May 1, 2017

Copy link
Member

left a comment

OK except for requested buildEnvVars rename.

pom.xml Outdated
@@ -24,7 +24,8 @@
<inceptionYear>2007</inceptionYear>

<properties>
<jenkins.version>1.625.3</jenkins.version>
<jenkins-core.version>2.58-20170501.171905-3</jenkins-core.version> <!-- TODO: Switch to release once https://github.com/jenkinsci/jenkins/pull/2730 is merged and released -->
<jenkins-war.version>2.58-20170501.171927-3</jenkins-war.version> <!-- TODO: Switch to release once https://github.com/jenkinsci/jenkins/pull/2730 is merged and released -->
<java.level>7</java.level>

This comment has been minimized.

Copy link
@jglick
@@ -470,7 +470,7 @@ protected String getCacheEntry() {
}

protected static File getCacheDir(String cacheEntry) {
Jenkins jenkins = Jenkins.getInstance();
Jenkins jenkins = Jenkins.getInstanceOrNull();

This comment has been minimized.

Copy link
@jglick

jglick May 1, 2017

Member

Most of these should actually be getInstance() with no null check, but good enough for now.

This comment has been minimized.

Copy link
@abayer

abayer May 1, 2017

Author Member

I went for the most stupidly non-logic-altering Findbugs fix I could. =) Wasn't 100% sure there weren't some cases where they might be expecting the existing behavior with a possibly null jenkins instance, so hey, better safe than sorry.

@jglick

This comment has been minimized.

Copy link
Member

commented May 3, 2017

Hudson Parameterized Trigger plugin v2.4 failed to load.
 - subversion v1.7 is missing. To fix, install v1.7 or later.

Not your fault, just a sign that this plugin’s Jenkinsfile is missing the usual idiom to verify that its tests run against Jenkins 2.12+, e.g.:

buildPlugin(jenkinsVersions: [null, '2.32.3'])
@jglick

jglick approved these changes May 3, 2017

@MarkEWaite

This comment has been minimized.

Copy link

commented May 3, 2017

Last time I enabled the plugin compat tests, it failed because the combination of tests and compilation took more than an hour to complete. The ci.jenkins.io jobs (correctly) limit themselves to not more than an hour elapsed time for the total job.

Plugin compat testing is enabled again, and we'll see if it performs better now.

@jglick

This comment has been minimized.

Copy link
Member

commented May 3, 2017

But jenkinsVersions will be run in parallel, and the timeout is wall clock time, so why would it matter?

@MarkEWaite

This comment has been minimized.

Copy link

commented May 4, 2017

With plugin compat enabled, it now does not timeout (maybe a false recollection on my part). It reports findbugs warnings on the 2.46.1 build which it does not report on other builds. Unfortunately, my first attempts to duplicate that result locally have failed. My findbugs is silent, even when I set jenkins.version=2.46.1.

My second attempt shows how to duplicate the problem. I mistakenly used -DskipTests, forgetting that it excludes findbugs runs for speed. If I run with at least one test, or with -Dtest=xyzzy -DfailIfNoTests=false, then I can see the findbugs output when compiling with 2.46.1.

I suspect I won't have time to explore fixes until after the end of the working day today.

Short term, I've stopped failing on findbugs warning messages. See daf202d

@jglick

This comment has been minimized.

Copy link
Member

commented May 4, 2017

The most common introduced FB error is due to @stephenc’s messing around with Jenkins.getInstance. Either switch to getActiveInstance, if appropriate, or leave the getInstance call with a null check and add

@SuppressFBWarnings(value="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification="TODO 1.653+ switch to Jenkins.getInstanceOrNull")

Yes this is obnoxious which is why I asked him to leave existing methods alone, and rely on deprecations if necessary, but he insisted…

@jglick

This comment has been minimized.

Copy link
Member

commented May 4, 2017

FTR my NetBeans action binding for checking FindBugs:

mvn -DskipTests=false clean compile findbugs:check
@MarkEWaite

This comment has been minimized.

Copy link

commented May 4, 2017

I'm not sure that action binding will work with the git plugin's current pom. As far as I can tell, once -DskipTests=false is passed as an argument, then findbugs:check is a no-op. I think that is reasonable (if you're skipping tests, you probably don't want to run findbugs), but it surprised me in this case.

My solution was -Dtest=CGitTest findbugs:check findbugs:gui. Runs a fast test, and reports findbugs results.

@jglick

This comment has been minimized.

Copy link
Member

commented May 4, 2017

This works in other plugins. FindBugs is skipped only if -DskipTests or -DskipTests=true is used. Omitting, or passing -DskipTests=false, runs FindBugs.

@MarkEWaite

This comment has been minimized.

Copy link

commented May 4, 2017

Thanks for the education! Inattentional blindness problem on my part. I saw the -DskipTests= in your action binding and didn't look at the false value. Nice technique.

pom.xml Outdated
<jenkins.version>1.625.3</jenkins.version>
<java.level>7</java.level>
<jenkins-core.version>2.58-20170502.192524-8</jenkins-core.version> <!-- TODO: Switch to release once https://github.com/jenkinsci/jenkins/pull/2730 is merged and released -->
<jenkins-war.version>2.58-20170502.192544-8</jenkins-war.version> <!-- TODO: Switch to release once https://github.com/jenkinsci/jenkins/pull/2730 is merged and released -->

This comment has been minimized.

Copy link
@jglick

This comment has been minimized.

Copy link
@jglick

jglick May 16, 2017

Member

2.60 I meant.

@abayer abayer changed the title NOT READY FOR MERGE [JENKINS-26100] Switch buildEnvVars and others to Run [JENKINS-26100] Switch buildEnvVars and others to Run May 18, 2017

@jglick

jglick approved these changes May 18, 2017

Hudson hudson = Hudson.getInstance();
if (hudson == null) {
Jenkins jenkins = Jenkins.getInstance();
if (jenkins == null) {

This comment has been minimized.

Copy link
@jglick

jglick May 18, 2017

Member

Maybe just revert changes in this file?

This comment has been minimized.

Copy link
@abayer

abayer May 19, 2017

Author Member

'k

buildEnvironment(build, env);
}

public void buildEnvironment(Run<?, ?> build, java.util.Map<String, String> env) {

This comment has been minimized.

Copy link
@jglick

jglick May 18, 2017

Member

Put in the usual TODOs.

This comment has been minimized.

Copy link
@abayer

abayer May 19, 2017

Author Member

'k

abayer added some commits May 19, 2017

@jglick

jglick approved these changes May 19, 2017

@Letty-Liang

This comment has been minimized.

Copy link

commented May 24, 2017

looking forward to be published soon

====
With this pr, it seems that we still can't get git properties in env while using pipeline jobs.

@abayer

This comment has been minimized.

Copy link
Member Author

commented Jun 6, 2017

@reviewbybees done

@MarkEWaite Can I persuade you to merge this? =)

@MarkEWaite

This comment has been minimized.

Copy link

commented Jun 6, 2017

It will be several days (at least) before I have a chance to review it. Can the merge wait until next week? What if it needs to wait another week beyond that?

@abayer

This comment has been minimized.

Copy link
Member Author

commented Jun 6, 2017

@MarkEWaite No rush at all - just wanted to make sure this wasn't lost.

pom.xml Outdated
<optional>true</optional>
<<<<<<< HEAD
</dependency>
=======

This comment has been minimized.

Copy link
@jglick

jglick Jun 16, 2017

Member

Bad merge conflict resolution!

abayer added some commits Jun 16, 2017

@jglick

jglick approved these changes Jun 16, 2017

Copy link
Member

left a comment

:shipit:

@abayer

This comment has been minimized.

Copy link
Member Author

commented Jun 20, 2017

@MarkEWaite Any news? =)

@MarkEWaite

This comment has been minimized.

Copy link

commented Jun 20, 2017

@abayer, sorry, but no progress on this pull request yet. Is it urgent, or blocking other work that I should place it ahead of other things in my queue (like the submodule checkout regression or the credential exclusion issue)?

@MarkEWaite MarkEWaite merged commit 907253d into jenkinsci:master Jun 21, 2017

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.