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-41457] Use BUILD_NOW_TEXT for parameterised jobs #2735

Merged
merged 2 commits into from
Feb 8, 2017

Conversation

alvarolobato
Copy link
Member

https://issues.jenkins-ci.org/browse/JENKINS-41757

@reviewbybees @jenkinsci/code-reviewers

@recampbell
Copy link
Member

Asking @jglick to take a look

String pageText = j.createWebClient().getPage(p).asText();
assertThat(pageText, containsString("newschool:aaa"));

Impl.oldschool = true;
Copy link
Member

Choose a reason for hiding this comment

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

use a try-finally block

Copy link
Member Author

Choose a reason for hiding this comment

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

@jglick sorry but I don't know what the try-finally is for

/**
* Makes sure that {@link AlternativeUiTextProvider} actually works with a parameterized Job.
*/
@Test
Copy link
Member

Choose a reason for hiding this comment

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

@Issue("JENKINS-41757")

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah... forgot it.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@@ -278,7 +278,8 @@ public static final CauseAction getBuildCause(ParameterizedJob job, StaplerReque
* Uses {@link #BUILD_NOW_TEXT}.
*/
public final String getBuildNowText() {
return isParameterized() ? Messages.ParameterizedJobMixIn_build_with_parameters() : AlternativeUiTextProvider.get(BUILD_NOW_TEXT, asJob(), Messages.ParameterizedJobMixIn_build_now());
return isParameterized() ? AlternativeUiTextProvider.get(BUILD_NOW_TEXT, asJob(), Messages.ParameterizedJobMixIn_build_with_parameters())
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this rather have a new variant BUILD_WITH_PARAMETERS_TEXT? The difference IIUC is that "Build Now" indicates an immediate action, while the other does not (like when in many applications some actions have a trailing and others don't).

Copy link
Member Author

Choose a reason for hiding this comment

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

Not needed, BUILD_NOW_TEXT is the AlternativeUiTextProvider inside it you can check if the job has parameters and decide what text you want to display.

Copy link
Member

Choose a reason for hiding this comment

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

Have a thumbs up then: 👍

@oleg-nenashev
Copy link
Member

@reviewbybees done

@oleg-nenashev oleg-nenashev added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Feb 7, 2017
@daniel-beck daniel-beck merged commit d655893 into jenkinsci:master Feb 8, 2017
daniel-beck added a commit that referenced this pull request Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants