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

[JEP-234] Customizable header #5909

Merged
merged 33 commits into from
Nov 26, 2021
Merged

Conversation

imonteroperez
Copy link
Contributor

@imonteroperez imonteroperez commented Nov 11, 2021

See JEP-234

Proposed changelog entries

  • New extension point Header as an interface that provides capabilities to render a specific header and a default implementation of that, named JenkinsHeader that is enabled by default.

Proposed upgrade guidelines

N/A

Submitter checklist

  • (If applicable) Jira issue is well described
  • Changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developer, depending on the change). Examples
    • Fill-in the Proposed changelog entries section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
  • Appropriate autotests or explanation to why this change has no tests
  • For dependency updates: links to external changelogs and, if possible, full diffs

Desired reviewers

@MarkEWaite @jglick @fcojfernandez @raul-arabaolaza @EstherAF @Wadeck @timja @batmat

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least 2 approvals for the pull request and no outstanding requests for change
  • Conversations in the pull request are over OR it is explicit that a reviewer does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are correct
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@imonteroperez imonteroperez changed the title Header revamp proposal [JEP-401] Customizable header proposal Nov 11, 2021
@imonteroperez imonteroperez force-pushed the header-revamp branch 2 times, most recently from e563e55 to bcea455 Compare November 11, 2021 11:38
@timja timja added rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted developer Changes which impact plugin developers labels Nov 11, 2021
@timja
Copy link
Member

timja commented Nov 11, 2021

Can you write a proper changelog entry rather than a developer guide please, our changelog isn't setup for something that complex.

This should be probably be documented on jenkins.io too?

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.

I do not think this is a correct approach for such a change. As @timja mentioned, this makes maintenance more complicated. And it is not an extension point in classic means, it is just an override logic. It might be helpful for some parties if they want to replace the header alltogether bit it complicates further maintenance. As long as there is no reference implementation justifying it, I am not ready to support such design.

core/src/main/java/jenkins/views/Header.java Outdated Show resolved Hide resolved
core/src/main/java/jenkins/views/Header.java Outdated Show resolved Hide resolved
@imonteroperez imonteroperez force-pushed the header-revamp branch 2 times, most recently from 10007e6 to 6989c25 Compare November 11, 2021 12:31
@imonteroperez imonteroperez changed the title [JEP-401] Customizable header proposal [JEP-234] Customizable header proposal Nov 11, 2021
@imonteroperez
Copy link
Contributor Author

I do not think this is a correct approach for such a change. As @timja mentioned, this makes maintenance more complicated. And it is not an extension point in classic means, it is just an override logic. It might be helpful for some parties if they want to replace the header alltogether bit it complicates further maintenance. As long as there is no reference implementation justifying it, I am not ready to support such design.

@oleg-nenashev in JEP-234 there is a reference implementation. Not sure if this is enough or not, but as mentioned in JEP, current alternatives make no possible (or a hacky/hell/nightmare-frankenstein-thing) to have a customized header (not only in UI terms)

@timja
Copy link
Member

timja commented Nov 11, 2021

I do not think this is a correct approach for such a change. As @timja mentioned, this makes maintenance more complicated. And it is not an extension point in classic means, it is just an override logic. It might be helpful for some parties if they want to replace the header alltogether bit it complicates further maintenance. As long as there is no reference implementation justifying it, I am not ready to support such design.

@oleg-nenashev in JEP-234 there is a reference implementation. Not sure if this is enough or not, but as mentioned in JEP, current alternatives make no possible (or a hacky/hell/nightmare-frankenstein-thing) to have a customized header (not only in UI terms)

This is exactly what I was concerned with:

https://github.com/imonteroperez/custom-header-plugin/blob/main/src/main/resources/org/jenkinsci/plugins/custom/header/CustomHeader/headerContent.jelly

a narrower API would be preferred I think

@imonteroperez
Copy link
Contributor Author

I do not think this is a correct approach for such a change. As @timja mentioned, this makes maintenance more complicated. And it is not an extension point in classic means, it is just an override logic. It might be helpful for some parties if they want to replace the header alltogether bit it complicates further maintenance. As long as there is no reference implementation justifying it, I am not ready to support such design.

@oleg-nenashev in JEP-234 there is a reference implementation. Not sure if this is enough or not, but as mentioned in JEP, current alternatives make no possible (or a hacky/hell/nightmare-frankenstein-thing) to have a customized header (not only in UI terms)

This is exactly what I was concerned with:

https://github.com/imonteroperez/custom-header-plugin/blob/main/src/main/resources/org/jenkinsci/plugins/custom/header/CustomHeader/headerContent.jelly

a narrower API would be preferred I think

No strong opinion on to setup API endpoints for each part of the header content (logo, searchbar, etc.) to make it more modular, but not part of the scope of the JEP proposed here. JEP aims to have capabilities to include/update parts/all the header beyond styles and static content. I guess I get your point and I see that as a follow up of this in order to apply KISS :-)

@timja
Copy link
Member

timja commented Nov 11, 2021

Again as Oleg and I have said this isn't extending this is replacing.

This does not explain backwards compatibility for Jenkins core in terms of the header:
https://github.com/imonteroperez/jep/blob/jep-401-header/jep/234/README.adoc#backwards-compatibility

If we refactor the header what happens to your custom header, could be completely broken.
If you want to continue down this path it needs to be clearly documented as a non stable API as this sort of API could never be stable imo.

we could change CSS and adapt the header but your custom one would not be adapted at all.

@imonteroperez
Copy link
Contributor Author

imonteroperez commented Nov 12, 2021

Again as Oleg and I have said this isn't extending this is replacing.

I'm fine with that statement. I have not mentioned at all it is about extending. Actually, as you mentioned, the JEP proposal aims to make it feasible to customize by a replacement of the pageHeader.jelly that should look like:

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:i="jelly:fmt" xmlns:x="jelly:xml">
	<j:invokeStatic var="header" className="jenkins.views.JenkinsHeader" method="get"/>
	<st:include it="${header}" page="headerContent.jelly"/>
</j:jelly>

And each plugin that provides a Header implementation can replace the headerContent. The main benefit here is that this open the door to have capabilities in Jenkins to customize the header beyond UI and static content (like CSS), so we would be able to do things like:

<j:invokeStatic var="label" className="org.jenkinsci.plugins.custom.header.CustomHeader" method="getHeaderLabel"/>
<span class="hidden-xs hidden-sm">${label} - ${userName}</span>

Captura de pantalla de 2021-11-12 10-05-00

where label can be something that is configured/updated dynamically through a field on Global Configuration (or whatever) - delegating to Java to programmatically retrieve things to be rendered in the header or to add new business logic there.

This does not explain backwards compatibility for Jenkins core in terms of the header: https://github.com/imonteroperez/jep/blob/jep-401-header/jep/234/README.adoc#backwards-compatibility

If we refactor the header what happens to your custom header, could be completely broken. If you want to continue down this path it needs to be clearly documented as a non stable API as this sort of API could never be stable imo.

we could change CSS and adapt the header but your custom one would not be adapted at all.

Well, I guess this is the same issue that could happen with other approaches like simple-theme-plugin. For example: if we decide tomorrow to modify the id of the search-box on the header: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/resources/lib/layout/pageHeader.jelly#L53, this will probably affect a lot of themes using that customization tooling (i.e: https://github.com/djonsson/jenkins-atlassian-theme/blob/master/src/style.css#L95)

IOW (and setting expectations) as mentioned before I'm ok with having a narrowed API that could help here to fix the mentioned issues, but that was not the proposal that is on the JEP. The proposal of the JEP aims to have capabilities to include/update parts/all the header beyond styles and static content.

@batmat
Copy link
Member

batmat commented Nov 21, 2021

I do not think this is a correct approach for such a change. As @timja mentioned, this makes maintenance more complicated

@oleg-nenashev I think your feedback has been addressed. Also given Tim approved this PR in the meantime, care to re-review?
Thanks!


Apart from the comment above, it looks like we're close to ready for merge. I think it would be cleaner however to officially merge the JEP PR before merging the core PR here.

@imonteroperez there has been comments by Jesse & Mark on the JEP, can you please make sure they're all addressed and marked as resolved so we can move towards merging there and here? Thanks for the great work!

@imonteroperez
Copy link
Contributor Author

@imonteroperez there has been comments by Jesse & Mark on the JEP, can you please make sure they're all addressed and marked as resolved so we can move towards merging there and here? Thanks for the great work!

@batmat all comments addressed and marked as resolved. Not able to merge the JEP PR (restricted to authorized users)

Co-authored-by: Vincent Latombe <vincent@latombe.net>
@batmat
Copy link
Member

batmat commented Nov 23, 2021

@oleg-nenashev I think your feedback was addressed, so I'm dismissing your past review FYI. Feel free to tell us whether you still have comments or requests on the current implementation.

@batmat batmat dismissed oleg-nenashev’s stale review November 23, 2021 10:56

Stale and deemed addressed.

@batmat batmat requested a review from jglick November 23, 2021 10:56
@batmat
Copy link
Member

batmat commented Nov 23, 2021

Given the 6 approvals, I am marking this PR ready-for-merge.

However, I'd like to condition the merge here to be after jenkinsci/jep#380 has been merged as Draft JEP and assigned an official JEP number.

In other words, this means I plan to merge here 24 hours from now, provided the JEP PR has been merged in the meantime.

Please tell us if you disagree with this stance. Thanks all.

@batmat batmat added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Nov 23, 2021
@oleg-nenashev oleg-nenashev added needs-more-reviews Complex change, which would benefit from more eyes and removed ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback labels Nov 23, 2021
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.

Sorry @batmat but I am against merging in the current state. I would like to review it, and AFAICT there was no review requested from me. Sorry, I missed the previous comments but we expect to request reviews in this repository.

The Tuesday weekly ship has sailed, so there is no problem with keeping the pull request open until the JEP is properly integrated. I will handle that and do the review

@batmat batmat requested a review from oleg-nenashev November 23, 2021 11:22
@imonteroperez
Copy link
Contributor Author

Sorry @batmat but I am against merging in the current state. I would like to review it, and AFAICT there was no review requested from me. Sorry, I missed the previous comments but we expect to request reviews in this repository.

It was requested 12 days ago, see: #5909 (comment)

@oleg-nenashev
Copy link
Member

I might be missing something. As far as I can tell it wasn't on my review dashboard. If it was requested through the comment, I can assure you I missed that.

Back to the subject matter, would it be possible to summarize the current review state in the developer mailing list thread? It would be particularly useful to know whether it was presented to the user experience group like it was announced there, and what is the consensus built in the UX SIG.

For the record I do not intend to block the change further. What I wanted is to ensure that we follow the JEP process as much as possible since it was taken for this pull request. We have one week before the next weekly, so it makes no sense to rush now and to risk creating leftovers

I will follow up on my proposal to add all officers and board members to JEP editors. Apparently even the recent changes are not enough

@imonteroperez
Copy link
Contributor Author

imonteroperez commented Nov 23, 2021

Back to the subject matter, would it be possible to summarize the current review state in the developer mailing list thread? It would be particularly useful to know whether it was presented to the user experience group like it was announced there, and what is the consensus built in the UX SIG.

I will summarize all in the dev ML thread tomorrow after the UX SIG meeting

@batmat
Copy link
Member

batmat commented Nov 23, 2021

For the record, the associated JEP for this change here is now officially JEP-234.

@imonteroperez
Copy link
Contributor Author

Back to the subject matter, would it be possible to summarize the current review state in the developer mailing list thread? It would be particularly useful to know whether it was presented to the user experience group like it was announced there, and what is the consensus built in the UX SIG.

I will summarize all in the dev ML thread tomorrow after the UX SIG meeting

FTR I shared JEP-234 in the Jenkins UX SIG meeting. Meeting notes are available here

Also shared with them the implementation details from this PR

Feedback obtained from the group was positive and they did not see any issue with this approach. 

Shared this also on the jenkins-dev ML: https://groups.google.com/g/jenkinsci-dev/c/1tDvSioCaF0

cc/ @oleg-nenashev

@imonteroperez
Copy link
Contributor Author

Any pending action here before merging this PR? @oleg-nenashev @batmat

@timja timja added needs-more-reviews Complex change, which would benefit from more eyes ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback and removed needs-more-reviews Complex change, which would benefit from more eyes labels Nov 25, 2021
@timja
Copy link
Member

timja commented Nov 25, 2021

This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@imonteroperez
Copy link
Contributor Author

This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@timja Can we merge this? No negative feedback was obtained in 24h.

@timja timja merged commit cc19663 into jenkinsci:master Nov 26, 2021
@timja
Copy link
Member

timja commented Nov 26, 2021

This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.
Thanks!

@timja Can we merge this? No negative feedback was obtained in 24h.

generally we batch merge before weekly 😄 so no need to worry if its more than 24h

@jglick jglick changed the title [JEP-234] Customizable header proposal [JEP-234] Customizable header Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer Changes which impact plugin developers needs-more-reviews Complex change, which would benefit from more eyes ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted squash-merge-me Unclean or useless commit history, should be merged only with squash-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.