jenkins icon indicating copy to clipboard operation
jenkins copied to clipboard

Move `AbstractBuild/index.jelly` to `Run/index.jelly`

Open janfaracik opened this issue 1 year ago • 13 comments

Would be good to have some discussion over this.

This PR/discussion proposes moving the build page from AbstractBuild to its parent Run, this is so that plugins that extend Run can use the page rather than having to reimplement it (e.g. like workflow-job-plugin).

It would be preferable to have plugins extend pages rather than to reimplement them to make changes in core easier and more consistent. This will be important with upcoming works on the Jenkins user experience, such as introducing app bars, new widgets and adjusting the sidebar.

For AbstractBuild I've split out Changesets/Upstream and downstream relationships into separate files, one called summary.jelly for use in the summary list, the other into main.jelly.

Searched for classes that extend Run with https://github.com/search?q=org%3Ajenkinsci+%22class%22+%22extends+Run%3C%22&type=code

From that search the following plugins extend Run:

  • https://github.com/jenkinsci/workflow-job-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/workflow/job/WorkflowRun/index.jelly (opened a PR here)
  • https://github.com/jenkinsci/external-monitor-job-plugin/tree/master/src/main/resources/hudson/model/ExternalRun (replaces index.jelly with console.jelly - probably fine to leave as is)
  • https://github.com/jenkinsci/template-workflows-plugin/blob/ede8b144fa8e4091acca4f75eb234a937e10c595/src/main/java/org/jenkins/plugin/templateWorkflows/TemplateswWorkflowRun.java#L3 (no replacement for index.jelly)

Happy to hear thoughts on the matter (and alternatives if I'm misunderstanding how everything works).

Testing done

  • The AbstractBuild page works as before/looks identical to before.

Proposed changelog entries

  • N/A

Proposed upgrade guidelines

N/A

Submitter checklist

  • [ ] The Jira issue, if it exists, is well-described.
  • [ ] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples).
    • Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • [ ] There is automated testing or an explanation as to why this change has no tests.
  • [ ] New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • [ ] New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • [ ] New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • [ ] For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@jenkinsci/sig-ux

Maintainer checklist

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

  • [ ] There are at least two (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 is not blocking the change.
  • [ ] Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • [ ] Proper changelog labels are set so that the changelog can be generated automatically.
  • [ ] If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see 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).

janfaracik avatar Jun 08 '23 22:06 janfaracik

@jglick any issues with this? it sounds like a good idea to me

timja avatar Jun 09 '23 07:06 timja

@janfaracik can you file a downstream PR to workflow-job removing it's copy after checking to see if there's any differences?

timja avatar Jun 09 '23 07:06 timja

@janfaracik can you file a downstream PR to workflow-job removing it's copy after checking to see if there's any differences?

Opened https://github.com/jenkinsci/workflow-job-plugin/pull/364

janfaracik avatar Jun 09 '23 09:06 janfaracik

index.jelly lists changesets, something available for AbstractBuild but not Run. Same with upstream/downstream relationships.

Therefore most of index.jelly by lines makes no sense for Run. There might be a basic implementation listing actions, but just moving doesn't seem like a clean change.

daniel-beck avatar Jun 09 '23 10:06 daniel-beck

index.jelly lists changesets, something available for AbstractBuild but not Run. Same with upstream/downstream relationships.

Therefore of index.jelly by lines makes no sense for Run. There might be a basic implementation listing actions, but just moving doesn't seem like a clean change.

In this case it would make sense to split the index.jelly into a "frame" jelly page and multiple local parts, that can be implemented or overwritten for specific types. Would that be feasible? @janfaracik did you try to make a diff of both files? Are there other known implementations?

uhafner avatar Jun 09 '23 11:06 uhafner

Would that be feasible?

Yeah. End goal would be a widget system where Jenkins/plugins can plug their own widgets into the page.

@janfaracik did you try to make a diff of both files?

Yeah I went through and I believe the summary components were the only differences.

Are there other known implementations?

I need to have a look around.

janfaracik avatar Jun 09 '23 12:06 janfaracik

Please take a moment and address the merge conflicts of your pull request. Thanks!

github-actions[bot] avatar Jul 17 '23 07:07 github-actions[bot]

Have you checked all the changes now @janfaracik ?

timja avatar Aug 19 '23 16:08 timja

Have you checked all the changes now @janfaracik ?

These are the checks I've done. Had to make a couple of tweaks regarding AbstractBuild to maintain compatibility but all seems alright.

image

janfaracik avatar Aug 20 '23 09:08 janfaracik

Please take a moment and address the merge conflicts of your pull request. Thanks!

github-actions[bot] avatar Nov 18 '23 21:11 github-actions[bot]

Any thoughts on moving this forward?

janfaracik avatar Nov 20 '23 21:11 janfaracik

Please take a moment and address the merge conflicts of your pull request. Thanks!

github-actions[bot] avatar Nov 28 '23 00:11 github-actions[bot]

@jenkinsci/core-pr-reviewers would someone mind taking a look please?

timja avatar Dec 16 '23 17:12 timja

/label ready-for-merge


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

Thanks!

timja avatar Mar 30 '24 20:03 timja

Caused https://github.com/jenkinsci/acceptance-test-harness/issues/1544.

basil avatar May 14 '24 16:05 basil

Caused JENKINS-73168.

basil avatar May 14 '24 18:05 basil

I have added an ATH workaround in https://github.com/jenkinsci/acceptance-test-harness/issues/1545. https://github.com/jenkinsci/acceptance-test-harness/issues/1548 tracks the removal of this workaround as part of fixing JENKINS-73168.

basil avatar May 14 '24 19:05 basil