Skip to content

Commit

Permalink
Merge branch 'console-widget-experiment' into new-details-widget
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jan 7, 2025
2 parents 233ca86 + f2e73fa commit 9112949
Show file tree
Hide file tree
Showing 16 changed files with 300 additions and 157 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/label-conflicting-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Label conflicting PRs
uses: eps1lon/[email protected].2
uses: eps1lon/[email protected].3
with:
dirtyLabel: "unresolved-merge-conflict"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
1 change: 0 additions & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {
],
},
],
"color-function-notation": "legacy",
"alpha-value-notation": "number",
"number-max-precision": 5,
"function-no-unknown": null,
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ THE SOFTWARE.
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.17.1</version>
<version>1.17.2</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* The MIT License
*
* Copyright (c) 2025, Jan Faracik
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package jenkins.model.experimentalflags;

import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.Extension;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

@Extension
@Restricted(NoExternalUse.class)
public class NewBuildPageUserExperimentalFlag extends BooleanUserExperimentalFlag {
public NewBuildPageUserExperimentalFlag() {
super("new-build-page.flag");
}

@Override
public String getDisplayName() {
return "New build page";
}

@Nullable
@Override
public String getShortDescription() {
return "Enables a revamped build page. This feature is still a work in progress, so some things might not work perfectly yet.";
}
}
104 changes: 48 additions & 56 deletions core/src/main/resources/hudson/model/Run/index.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -24,71 +24,63 @@ THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:t="/lib/hudson">
<l:layout title="${it.fullDisplayName}">
<st:include page="sidepanel.jelly" />
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:i="jelly:fmt">
<l:userExperimentalFlag var="newBuildPage" flagClassName="jenkins.model.experimentalflags.NewBuildPageUserExperimentalFlag" />

<!-- no need for additional breadcrumb here as we're on an index page already including breadcrumb -->
<l:main-panel>
<script src="${resURL}/jsbundles/pages/job.js" type="text/javascript" defer="true" />
<j:choose>
<j:when test="${newBuildPage}">
<st:include page="new-build-page.jelly" />
</j:when>
<j:otherwise>
<l:layout title="${it.fullDisplayName}">
<st:include page="sidepanel.jelly" />

<j:set var="controls">
<t:editDescriptionButton permission="${it.UPDATE}"/>
<l:hasPermission permission="${it.UPDATE}">
<st:include page="logKeep.jelly" />
</l:hasPermission>
</j:set>
<!-- no need for additional breadcrumb here as we're on an index page already including breadcrumb -->
<l:main-panel>
<j:set var="controls">
<t:editDescriptionButton permission="${it.UPDATE}"/>
<l:hasPermission permission="${it.UPDATE}">
<st:include page="logKeep.jelly" />
</l:hasPermission>
</j:set>

<t:buildCaption controls="${controls}">${it.displayName}</t:buildCaption>
<t:buildCaption controls="${controls}">${it.displayName} (<i:formatDate value="${it.timestamp.time}" type="both" dateStyle="medium" timeStyle="medium"/>)</t:buildCaption>

<div>
<t:editableDescription permission="${it.UPDATE}" hideButton="true"/>
</div>

<div class="build-grid">
<l:userExperimentalFlag var="showConsoleWidget" flagClassName="jenkins.model.experimentalflags.ConsoleWidgetUserExperimentalFlag" />
<j:if test="${showConsoleWidget}">
<st:include page="console.jelly" from="${h.getConsoleProviderFor(it)}" optional="true" />
</j:if>
<div>
<t:editableDescription permission="${it.UPDATE}" hideButton="true"/>
</div>

<l:card title="${%Details}">
<div class="jenkins-card__details">
<j:forEach var="group" items="${h.getDetailsFor(it)}" indexVar="index">
<j:if test="${index gt 0}">
<hr />
<div style="float:right; z-index: 1; position:relative; margin-left: 1em">
<div style="margin-top:1em">
${%startedAgo(it.timestampString)}
</div>
<div>
<j:if test="${it.building}">
${%beingExecuted(it.executor.timestampString)}
</j:if>
<j:forEach var="detail" items="${group.value}">
<st:include page="detail.jelly" from="${detail}" optional="true">
<div class="jenkins-card__details__item">
<div class="jenkins-card__details__item__icon">
<l:icon src="${detail.iconFileName}" />
</div>
${detail.displayName}
</div>
</st:include>
</j:forEach>
</j:forEach>
<j:if test="${!it.building}">
${%Took} <a href="${rootURL}/${it.parent.url}buildTimeTrend">${it.durationString}</a>
</j:if>
<st:include page="details.jelly" optional="true" />
</div>
</div>
</l:card>

<l:card title="Summary">
<div>
<table>
<t:artifactList build="${it}" caption="${%Build Artifacts}"
permission="${it.ARTIFACTS}" />

<!-- give actions a chance to contribute summary item -->
<j:forEach var="a" items="${it.allActions}">
<st:include page="summary.jelly" from="${a}" optional="true" it="${a}" />
</j:forEach>
<table>
<t:artifactList build="${it}" caption="${%Build Artifacts}"
permission="${it.ARTIFACTS}" />

<!-- give actions a chance to contribute summary item -->
<j:forEach var="a" items="${it.allActions}">
<st:include page="summary.jelly" from="${a}" optional="true" it="${a}" />
</j:forEach>

<st:include page="summary.jelly" optional="true" />
</table>
<st:include page="summary.jelly" optional="true" />
</table>

<st:include page="main.jelly" optional="true" />
</div>
</l:card>
</div>
</l:main-panel>
</l:layout>
<st:include page="main.jelly" optional="true" />
</l:main-panel>
</l:layout>
</j:otherwise>
</j:choose>
</j:jelly>
78 changes: 78 additions & 0 deletions core/src/main/resources/hudson/model/Run/new-build-page.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Matthew R. Harrah,
Tom Huybrechts, id:cactusman, Romain Seguy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:i="jelly:fmt">
<l:layout title="${it.fullDisplayName}">
<st:include page="sidepanel.jelly" />

<!-- no need for additional breadcrumb here as we're on an index page already including breadcrumb -->
<l:main-panel>
<j:set var="controls">
<t:editDescriptionButton permission="${it.UPDATE}"/>
<l:hasPermission permission="${it.UPDATE}">
<st:include page="logKeep.jelly" />
</l:hasPermission>
</j:set>

<t:buildCaption controls="${controls}">${it.displayName} (<i:formatDate value="${it.timestamp.time}" type="both" dateStyle="medium" timeStyle="medium"/>)</t:buildCaption>

<div>
<t:editableDescription permission="${it.UPDATE}" hideButton="true"/>
</div>

<st:include page="console.jelly" from="${h.getConsoleProviderFor(it)}" optional="true" />

<div style="float:right; z-index: 1; position:relative; margin-left: 1em">
<div style="margin-top:1em">
${%startedAgo(it.timestampString)}
</div>
<div>
<j:if test="${it.building}">
${%beingExecuted(it.executor.timestampString)}
</j:if>
<j:if test="${!it.building}">
${%Took} <a href="${rootURL}/${it.parent.url}buildTimeTrend">${it.durationString}</a>
</j:if>
<st:include page="details.jelly" optional="true" />
</div>
</div>

<table>
<t:artifactList build="${it}" caption="${%Build Artifacts}"
permission="${it.ARTIFACTS}" />

<!-- give actions a chance to contribute summary item -->
<j:forEach var="a" items="${it.allActions}">
<st:include page="summary.jelly" from="${a}" optional="true" it="${a}" />
</j:forEach>

<st:include page="summary.jelly" optional="true" />
</table>

<st:include page="main.jelly" optional="true" />
</l:main-panel>
</l:layout>
</j:jelly>
Loading

0 comments on commit 9112949

Please sign in to comment.