Change rss feed build name #2845

Merged
merged 1 commit into from Apr 29, 2017

Conversation

3 participants
@tequillaz
Contributor

tequillaz commented Apr 17, 2017

We are always show default build name as build name in rss feed. Currently default build name is a build number. This is incorrect becouse we can change build display name during build process and it will be changed in build history list but not in rss feed.

This patch is change rss feed build name from build number to display name.

Proposed Changelog Entry

  • Use build display names in RSS feed titles
@@ -2410,7 +2410,7 @@ public String getEntryID(Run e) {
private static class DefaultFeedAdapter implements FeedAdapter<Run> {
public String getEntryTitle(Run entry) {
- return entry+" ("+entry.getBuildStatusSummary().message+")";
+ return entry.getDisplayName()+" ("+entry.getBuildStatusSummary().message+")";

This comment has been minimized.

@oleg-nenashev

oleg-nenashev Apr 20, 2017

Member

this name is localizable. I am not sure it is safe in this case

@oleg-nenashev

oleg-nenashev Apr 20, 2017

Member

this name is localizable. I am not sure it is safe in this case

This comment has been minimized.

@tequillaz

tequillaz Apr 24, 2017

Contributor

entry.getDisplayName() is not localizable. It just a build number or something else user set itself for example by 'currentBuild.displayName' from a pipeline.

From hudson/models/Run.java

    @Exported
    public String getDisplayName() {
        return displayName!=null ? displayName : "#"+number;
    }

    public boolean hasCustomDisplayName() {
        return displayName!=null;
    }

    /**
     * @param value
     *      Set to null to revert back to the default "#NNN".
     */
    public void setDisplayName(String value) throws IOException {
        checkPermission(UPDATE);
        this.displayName = value;
        save();
    }
@tequillaz

tequillaz Apr 24, 2017

Contributor

entry.getDisplayName() is not localizable. It just a build number or something else user set itself for example by 'currentBuild.displayName' from a pipeline.

From hudson/models/Run.java

    @Exported
    public String getDisplayName() {
        return displayName!=null ? displayName : "#"+number;
    }

    public boolean hasCustomDisplayName() {
        return displayName!=null;
    }

    /**
     * @param value
     *      Set to null to revert back to the default "#NNN".
     */
    public void setDisplayName(String value) throws IOException {
        checkPermission(UPDATE);
        this.displayName = value;
        save();
    }
@oleg-nenashev

My bad. if there is no localization here in overrides (seems so after the quick search), it is fine

@oleg-nenashev oleg-nenashev merged commit 461940f into jenkinsci:master Apr 29, 2017

1 of 2 checks passed

continuous-integration/jenkins/pr-head This commit has test failures
Details
Jenkins This pull request looks good
Details
@oleg-nenashev

This comment has been minimized.

Show comment
Hide comment
@oleg-nenashev

oleg-nenashev May 8, 2017

Member

@tequillaz Hi, there is a regression report, which is most likely related to this PR: https://issues.jenkins-ci.org/browse/JENKINS-44117

Member

oleg-nenashev commented May 8, 2017

@tequillaz Hi, there is a regression report, which is most likely related to this PR: https://issues.jenkins-ci.org/browse/JENKINS-44117

@daniel-beck

This comment has been minimized.

Show comment
Hide comment
@daniel-beck

daniel-beck May 8, 2017

Member

This should have been getFullDisplayName(). @tequillaz will you take care of it this week, or want us to fix it?

Member

daniel-beck commented May 8, 2017

This should have been getFullDisplayName(). @tequillaz will you take care of it this week, or want us to fix it?

ragaller added a commit to ragaller/jenkins that referenced this pull request May 8, 2017

Change rss feed build name
With jenkinsci#2845 (released with Jenkins
2.58), if no display name is explicitly set the feed title contains only
the build number, which is not very useful for non project specific feeds
like the global /rssFailed feed.

This commit restores the old behaviour and honours the new behaviour of
pull request 2845.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment