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

Refresh the design of the 'Changelogs' pages #7479

Merged
merged 19 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/_ext/changelog_releases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def execute(site)
page = site.engine.load_page(entry_template)
page.output_path = "/#{@changelog_path}/#{changelog_entry.version}/index.html"
page.release = changelog_entry
page.type = @limit_version_key
page.title = page.title + " for " + changelog_entry.version
page.uneditable = true
site.pages << page
Expand Down
38 changes: 12 additions & 26 deletions content/_layouts/changelog.html.haml
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
---
layout: simplepage
title: Changelog
notitle: true
tight: true
---

%link{:href => "/css/changelog.css", :rel => "stylesheet", :type => "text/css"}/
%div.app-app-bar
%div.app-app-bar__content
%h1
= page.title
%div.app-app-bar__controls
= page.actions
- if page.has_rss
%a{:class => "app-button app-button--tertiary app-mobile-hide", :href => "rss.xml", :"aria-label" => "RSS"}
= File.read("content/images/symbols/rss.svg")

- if page.show_ratings
#head
%script{:src => "/files/rate.js", :type => "text/javascript"}
#ratings
%script{:src => "/files/rate.js", :type => "text/javascript"}

.w-100.text-right
.iconlegend
Legend:
%ul.image
%li.security security fix
%li.major.bug major bug fix
%li.bug bug fix
%li.major.rfe major enhancement
%li.rfe enhancement
.w-100.text-right{:style => "margin: 10px 0;"}
.iconlegend
Community feedback:
%ul.feedback
%li.sunny no major issues
%li.cloudy notable issues
%li.storm required rollback
- if page.has_rss
.w-100.text-right{:style => "margin: 10px 0;"}
%a{:href => "rss.xml", :class => "app-button app-button--tertiary"}
= File.read("content/images/symbols/rss.svg")
RSS

- if page.show_ratings
:javascript
$(document).ready(function() {
loaddata(this);
Expand Down
52 changes: 37 additions & 15 deletions content/_layouts/changelog_entry.html.haml
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
---
layout: changelog
show_ratings: true
has_rss: false
layout: simplepage
title: Changelog
notitle: true
tight: true
backlink:
label: Back to changelogs
url: ../
---

= partial('release-header.html.haml', :release => page.release)
-if page.release.changes and page.release.lts_changes and page.release.lts_baseline
%div
%strong
-# TODO figure out how to get rid of this
= "Changes since #{page.release.lts_baseline}:"
%ul.image
= partial('release-header.html.haml', :release => page.release, :entry => true)

- if page.type == 'stable'
%a{:class => "app-button app-button--primary app-releases__upgrade-guide", :href => "/doc/upgrade-guide/" + page.release.version.rpartition('.').first + "#upgrading-to-jenkins-lts-" + page.release.version.to_s.tr_s(".", "-")}
%ion-icon{:name => "arrow-up-circle-outline"}
.app-releases__upgrade-guide__title
Looking to upgrade?
.app-releases__upgrade-guide__description
= "Check the Upgrade Guide for assistance"

#head
%script{:src => "/files/rate.js", :type => "text/javascript"}

:javascript
$(document).ready(function() {
loaddata(this);
});

- if page.release.changes and page.release.lts_changes and page.release.lts_baseline
.app-releases__notable-changes
-# TODO figure out how to get rid of this
= "Changes since #{page.release.lts_baseline}"

%div.app-releases__list__items
= partial('changelog-changes.html.haml', :changes => page.release.changes)
-if page.release.changes and page.release.lts_changes
%div
%strong
= "Notable changes since #{page.release.lts_predecessor}:"
%ul.image

- if page.release.changes and page.release.lts_changes
.app-releases__notable-changes
= "Notable changes since #{page.release.lts_predecessor}"

%div.app-releases__list__items
= partial('changelog-changes.html.haml', :changes => page.release.lts_changes)
6 changes: 5 additions & 1 deletion content/_layouts/simplepage.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ layout: default
- unless page.noanchors
= partial("anchors.html.haml", :selector => '.app-container')

.app-container
.app-container{:class => "#{page.tight ? 'app-container--compact' : ''}"}
- if page.backlink
%div{:class => "app-!-display-flex", :style => "margin-bottom: 20px"}
%a{:href => page.backlink.url, :class => "app-back-link"}
= page.backlink.label
- unless page.notitle
%h1
= page.title
Expand Down
72 changes: 39 additions & 33 deletions content/_partials/changelog-changes.html.haml
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
:ruby
tags = {
'security' => 'Security',
'rfe' => 'Enhancement',
'majorrfe' => 'Major enhancement',
'bug' => 'Bug fix',
'majorbug' => 'Major bug fix'
}

- if page.changes.empty?
%em
No notable changes in this release.
- page.changes.each do | change |
%li{:class => change.type }
= change.message
- if change.references
- change.references.each_with_index do | reference, index |
- if index == 0
(
- else
,&nbsp;
- if reference.issue
%a{:href => "https://issues.jenkins.io/browse/JENKINS-#{reference.issue}" }<>
= "issue #{reference.issue}"
- if reference.pull
%a{:href => "https://github.com/jenkinsci/jenkins/pull/#{reference.pull}" }<>
= "pull #{reference.pull}"
- else
%a{:href => reference.url }<>
- if reference.title
= reference.title
- else
= reference.url
- if index == change.references.count - 1
)
- elsif change.issue
(
%a{:href => "https://issues.jenkins.io/browse/JENKINS-#{change.issue}" }<>
= "issue #{change.issue}"
)
- elsif change.pull
(
%a{:href => "https://github.com/jenkinsci/jenkins/pull/#{change.pull}" }<>
= "pull #{change.pull}"
)
- page.changes.group_by { |message| message["type"] }.each do | type, logs |
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend that at least the same grouping be done for the RSS/Atom changelog feed. I do not expect changelog authors to regularly look at that, so will likely miss if the experience there deteriorates (less grouping of entries in the data file).

%div{:class => 'app-releases__tag app-releases__tag--' + type.gsub(' ', '')}
= tags[type.gsub(' ', '')]
%ul.app-releases__list{:class => 'app-releases__list--' + type.gsub(' ', '')}
- logs.each do | change |
%li
= change.message
%span.app-releases__references
- if change.references
- change.references.each_with_index do | reference, index |
- if index != 0
,&nbsp;
- if reference.issue
%a{:href => "https://issues.jenkins.io/browse/JENKINS-#{reference.issue}" }<>
= "issue #{reference.issue}"
- if reference.pull
%a{:href => "https://github.com/jenkinsci/jenkins/pull/#{reference.pull}" }<>
= "pull #{reference.pull}"
- else
%a{:href => reference.url }<>
- if reference.title
= reference.title
- else
= reference.url
- elsif change.issue
%a{:href => "https://issues.jenkins.io/browse/JENKINS-#{change.issue}" }<>
= "issue #{change.issue}"
- elsif change.pull
%a{:href => "https://github.com/jenkinsci/jenkins/pull/#{change.pull}" }<>
= "pull #{change.pull}"
19 changes: 14 additions & 5 deletions content/_partials/release-header.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
%h3{:id => "v#{page.release.version}" }
= "What's new in #{page.release.version}"
- if page.release.date
= "(#{page.release.date})"
%div.app-releases__list__header
%div
- if page.entry
%h1{:id => "v#{page.release.version}", :class => 'app-releases__item__title', :'data-type' => 'release-header', :'data-version' => page.release.version}
= 'Changelog for ' + page.release.version
- else
%h3{:id => "v#{page.release.version}", :class => 'app-releases__item__title', :'data-type' => 'release-header', :'data-version' => page.release.version}
%a{:href => "/#{page.url}/#{page.release.version}/"}
= page.release.version
- if page.release.date
%div{:class => 'app-releases__item__date'}
= page.release.date.strftime('%B %-d, %Y')

- if page.release.banner
%div{:class => 'app-banner'}
= page.release.banner
= page.release.banner
11 changes: 3 additions & 8 deletions content/changelog-old/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ title: Changelog Archive
show_ratings: false
---

%div{:class => 'app-banner'}
%b
This is the changelog archive.
.app-banner{:style => 'margin: 0 0 2rem 0'}
This is the changelog archive.
Recent changelogs can be found
%a{:href => '/changelog/'}
here.
Expand All @@ -15,11 +14,7 @@ show_ratings: false
- # source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml
- site.changelogs[:weekly].reverse.select { |release| Gem::Version.new(release.version) <= Gem::Version.new(site.jenkins.latest) }[30..-1].each do | release |
= partial('release-header.html.haml', :release => release)
%p
%small
%a{:href => "/changelog/#{release.version}/" }
permalink to this entry
%ul.image
%div.app-releases__list__items
= partial('changelog-changes.html.haml', :changes => release.changes)

= partial('changelog-old.html')
3 changes: 1 addition & 2 deletions content/changelog-preview/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ has_rss: true
- counter = 0
- site.changelogs[:weekly].reverse.select { |release| Gem::Version.new(release.version) > Gem::Version.new(site.jenkins.latest) }[0..29].each do | release |
= partial('release-header.html.haml', :release => release)
%ul.image
= partial('changelog-changes.html.haml', :changes => release.changes)
= partial('changelog-changes.html.haml', :changes => release.changes)
48 changes: 19 additions & 29 deletions content/changelog-stable/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,30 @@ layout: changelog
title: LTS Changelog
show_ratings: true
has_rss: true
actions:
<a class="app-button app-button--primary app-mobile-hide" href="/doc/upgrade-guide">
<ion-icon name="arrow-up-circle-outline"></ion-icon>
Upgrade Guide
</a>
---

%div{:class => 'app-banner'}
See the
%a{:href => '/doc/upgrade-guide/'}
LTS upgrade guide
for advice on upgrading Jenkins.

%div{:class => 'app-banner'}
See the
%a{:href => '/download/lts'}
LTS Release Line
for more information on Jenkins LTS.

.ratings
- # source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/lts.yml
- site.changelogs[:lts].reverse_each do | release |
- if Gem::Version.new(release.version) <= Gem::Version.new(site.jenkins.stable)
= partial('release-header.html.haml', :release => release)
%p
%small
%a{:href => "/changelog-stable/#{release.version}/" }
permalink to this entry
-if release.changes and release.lts_changes and release.lts_baseline
%div
%strong
%div
Copy link
Member

Choose a reason for hiding this comment

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

If you go back to 2.19.4 its still using the old design. FWIW I think we could archive going back a certain amount of time we don't need to keep growing this page infinitely

image

Copy link
Contributor

@daniel-beck daniel-beck Aug 30, 2024

Choose a reason for hiding this comment

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

its still using the old design

That's from the HTML archive, when we didn't use YAML yet:

<!-- this document archives change logs of LTS releases 2.19.4 and earlier in HTML. It has since been replaced by YAML based changelogs. -->

I think this difference is acceptable and we don't need to rewrite ancient HTML for the new format.

It seems that all we're losing with this PR is the old changelog votes for 2.19.4 and earlier, that seems OK. (For weekly changelog, we didn't have votes in changelog-old already anyway.)

Copy link
Member

Choose a reason for hiding this comment

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

Do we need to keep displaying it on the page or could we archive it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should delete changelogs, but if we do, we should start with historical weekly changelogs.

Copy link
Member

Choose a reason for hiding this comment

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

Weekly only displays x number already,

The oldest one is:
https://www.jenkins.io/changelog/#v2.445

(29 weeks)

Not saying delete them, we could have an archive page for older than a reasonable period.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense, I read your suggestion as completely removing. I'd keep at least 2 years of changelogs around though for LTS.

Copy link
Member

Choose a reason for hiding this comment

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

Created an issue to track: #7502

= partial('release-header.html.haml', :release => release, :url => 'changelog-stable')
- if release.changes and release.lts_changes and release.lts_baseline
.app-releases__notable-changes{:style => "margin-top: 15px"}
-# TODO figure out how to get rid of this
= "Changes since #{release.lts_baseline}:"
%ul.image
= partial('changelog-changes.html.haml', :changes => release.changes)
-if release.changes and release.lts_changes
%div
%strong
= "Notable changes since #{release.lts_predecessor}:"
%ul.image
= partial('changelog-changes.html.haml', :changes => release.lts_changes)
= "Changes since #{release.lts_baseline}"
%div.app-releases__list__items
= partial('changelog-changes.html.haml', :changes => release.changes)

- if release.changes and release.lts_changes
.app-releases__notable-changes
= "Notable changes since #{release.lts_predecessor}"
%div.app-releases__list__items
= partial('changelog-changes.html.haml', :changes => release.lts_changes)
Comment on lines +26 to +30
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not indented far enough, so https://www.jenkins.io/changelog-stable/ currently has "Notable changes" for an unreleased version of Jenkins.

Copy link
Contributor

Choose a reason for hiding this comment

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


= partial('changelog-stable.html')
18 changes: 6 additions & 12 deletions content/changelog/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ has_rss: true
.ratings
- # source: https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml
- site.changelogs[:weekly].reverse.select { |release| Gem::Version.new(release.version) <= Gem::Version.new(site.jenkins.latest) }[0..29].each do | release |
= partial('release-header.html.haml', :release => release)
%p
%small
%a{:href => "/changelog/#{release.version}/" }
permalink to this entry
%ul.image
= partial('release-header.html.haml', :release => release, :url => 'changelog')
%div.app-releases__list__items
= partial('changelog-changes.html.haml', :changes => release.changes)


%p
%b
Changelogs of historical releases can be found
%a{:href => '/changelog-old/'}
in the changelog archive.
.app-banner
Changelogs of historical releases can be found
%a{:href => '/changelog-old/'}
in the changelog archive.
Loading