Skip to content
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
16d813f
Init
janfaracik Sep 26, 2025
d37f669
Squashed commit of the following:
janfaracik Sep 26, 2025
2e58ded
Refine description
janfaracik Sep 27, 2025
de9753e
Refine
janfaracik Sep 28, 2025
c178d9a
Update _cards.scss
janfaracik Sep 28, 2025
24ced46
Merge branch 'master' into new-experimental-run-page
janfaracik Sep 29, 2025
fc0fc74
Update new-build-page.jelly
janfaracik Sep 26, 2025
3902855
Push
janfaracik Sep 26, 2025
1e28bc0
Update new-build-page.jelly
janfaracik Sep 29, 2025
a732ec1
Fix description merge
janfaracik Sep 29, 2025
af726c0
Merge branch 'fix-description-merge' into move-run-sidepanel-to-overflow
janfaracik Sep 29, 2025
ea99b2e
Refine
janfaracik Sep 29, 2025
b15b2eb
Merge branch 'move-run-sidepanel-to-overflow' into new-experimental-r…
janfaracik Sep 29, 2025
a5283a2
Push
janfaracik Sep 29, 2025
bbfa7a9
Merge branch 'master' into move-run-sidepanel-to-overflow
janfaracik Sep 30, 2025
8600476
Merge branch 'master' into new-experimental-run-page
janfaracik Sep 30, 2025
01ce059
Merge branch 'move-run-sidepanel-to-overflow' into new-experimental-r…
janfaracik Sep 30, 2025
736e8f1
Update run-host.jelly
janfaracik Sep 30, 2025
78c325b
Refine
janfaracik Sep 30, 2025
298bd15
Update dir.jelly
janfaracik Sep 30, 2025
53b0a0e
Push
janfaracik Sep 30, 2025
14b777d
Refine
janfaracik Sep 30, 2025
550bf9b
Merge branch 'master' into new-experimental-run-page
janfaracik Oct 1, 2025
43b6981
Update Run.java
janfaracik Oct 1, 2025
fda054d
Update dir.jelly
janfaracik Oct 1, 2025
798b8c4
Refine
janfaracik Oct 1, 2025
20b83aa
Improve in mobile
janfaracik Oct 1, 2025
1b50a77
Use normal grid
janfaracik Oct 1, 2025
d70e3b1
Checkstyle
timja Oct 2, 2025
c572ec0
Some refinement
janfaracik Oct 6, 2025
f5f38f2
Refine
janfaracik Oct 6, 2025
a85eeeb
Refine
janfaracik Oct 6, 2025
89649b0
Run prettier
timja Oct 7, 2025
f3d9e81
Refine classes
janfaracik Oct 7, 2025
a41a974
Tidy up
janfaracik Oct 7, 2025
bff6e73
Rename run-host to run-subpage
janfaracik Oct 7, 2025
f867f6b
Merge branch 'master' into new-experimental-run-page
janfaracik Oct 7, 2025
8dea20e
Update changes.jelly
janfaracik Oct 7, 2025
66926b1
Merge branch 'master' into new-experimental-run-page
timja Oct 7, 2025
691f72a
Fix licence, rename tabs class
janfaracik Oct 7, 2025
897a015
Add licence header
janfaracik Oct 7, 2025
e2bd2a1
Update Run.java
janfaracik Oct 7, 2025
9894dbf
Update Run.java
janfaracik Oct 7, 2025
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
9 changes: 9 additions & 0 deletions core/src/main/java/hudson/model/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
import jenkins.model.JenkinsLocationConfiguration;
import jenkins.model.RunAction2;
import jenkins.model.StandardArtifactManager;
import jenkins.model.Tab;
import jenkins.model.details.CauseDetail;
import jenkins.model.details.Detail;
import jenkins.model.details.DetailFactory;
Expand Down Expand Up @@ -2710,4 +2711,12 @@ public Class<Run> type() {
return List.of(new CauseDetail(target), new TimestampDetail(target), new DurationDetail(target));
}
}

/**
* Retrieves the tabs for a given run
*/
@Restricted(NoExternalUse.class)
public List<Tab> getRunTabs() {
return Collections.unmodifiableList(Util.filter(getAllActions(), Tab.class));
}
}
51 changes: 51 additions & 0 deletions core/src/main/java/jenkins/model/Badgeable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* 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;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import jenkins.management.Badge;

/**
* Represents an entity that can display a {@link Badge}.
* <p>
* Implementations of this interface may provide a badge
* to be shown on an associated action or UI element.
* If no badge is provided, {@code null} may be returned.
* </p>
*
* @since TODO
*/
public interface Badgeable {

/**
* A {@link Badge} shown on the action.
*
* @return badge or {@code null} if no badge should be shown.
* @since TODO
*/
default @CheckForNull Badge getBadge() {
return null;
}
}
55 changes: 55 additions & 0 deletions core/src/main/java/jenkins/model/Tab.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* 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;

import hudson.model.Action;
import hudson.model.Actionable;

/**
* Represents a tab element shown on {@link Actionable} views.
* <p>
* A {@code Tab} is an {@link Action} that can be attached to an {@link Actionable} object
* (such as a job or build) and displayed as a separate tab in the UI.
* </p>
*
* <p>
* Tabs may also implement {@link Badgeable} to display a visual badge associated
* with the tab’s action
* </p>
*
* @since TODO
*/
public abstract class Tab implements Action, Badgeable {

protected Actionable object;

public Tab(Actionable object) {
this.object = object;
}

public Actionable getObject() {
return object;
}
}
50 changes: 50 additions & 0 deletions core/src/main/java/jenkins/run/ChangesTab.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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.run;

import hudson.model.Actionable;
import jenkins.model.Tab;

public class ChangesTab extends Tab {

public ChangesTab(Actionable object) {
super(object);
}

@Override
public String getIconFileName() {
return "symbol-changes";
}

@Override
public String getDisplayName() {
return "Changes";
}

@Override
public String getUrlName() {
return "changes";
}
}
63 changes: 63 additions & 0 deletions core/src/main/java/jenkins/run/ChangesTabFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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.run;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Run;
import java.util.Collection;
import java.util.Collections;
import jenkins.model.Tab;
import jenkins.model.TransientActionFactory;
import jenkins.model.experimentalflags.NewBuildPageUserExperimentalFlag;
import jenkins.scm.RunWithSCM;

@Extension(ordinal = Integer.MAX_VALUE - 2)
public class ChangesTabFactory extends TransientActionFactory<Run> {

@Override
public Class<Run> type() {
return Run.class;
}

@NonNull
@Override
public Collection<? extends Tab> createFor(@NonNull Run target) {
boolean isExperimentalUiEnabled = new NewBuildPageUserExperimentalFlag().getFlagValue();

if (!isExperimentalUiEnabled) {
return Collections.emptySet();
}

if (target instanceof RunWithSCM<?, ?> targetWithSCM) {
var hasChangeSet = !targetWithSCM.getChangeSets().isEmpty();
if (hasChangeSet) {
return Collections.singleton(new ChangesTab(target));
}
}

return Collections.emptySet();
}
}
50 changes: 50 additions & 0 deletions core/src/main/java/jenkins/run/ConsoleTab.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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.run;

import hudson.model.Actionable;
import jenkins.model.Tab;

public class ConsoleTab extends Tab {

public ConsoleTab(Actionable object) {
super(object);
}

@Override
public String getIconFileName() {
return "symbol-terminal";
}

@Override
public String getDisplayName() {
return "Console";
}

@Override
public String getUrlName() {
return "console";
Copy link
Member

@timja timja Oct 7, 2025

Choose a reason for hiding this comment

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

Nice to have: This isn't active when the page is consoleFull, i.e. when viewing a large log.

This is a pre-existing issue so not a blocker.

}
}
58 changes: 58 additions & 0 deletions core/src/main/java/jenkins/run/ConsoleTabFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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.run;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.Functions;
import hudson.model.Run;
import java.util.Collection;
import java.util.Collections;
import jenkins.console.DefaultConsoleUrlProvider;
import jenkins.model.Tab;
import jenkins.model.TransientActionFactory;
import jenkins.model.experimentalflags.NewBuildPageUserExperimentalFlag;

@Extension(ordinal = Integer.MAX_VALUE - 1)
public class ConsoleTabFactory extends TransientActionFactory<Run> {

@Override
public Class<Run> type() {
return Run.class;
}

@NonNull
@Override
public Collection<? extends Tab> createFor(@NonNull Run target) {
var consoleProvider = Functions.getConsoleProviderFor(target);
boolean isExperimentalUiEnabled = new NewBuildPageUserExperimentalFlag().getFlagValue();

if (!consoleProvider.getClass().equals(DefaultConsoleUrlProvider.class) || !isExperimentalUiEnabled) {
return Collections.emptySet();
}

return Collections.singleton(new ConsoleTab(target));
}
}
Loading