-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Add support for tabs for the experimental run page #11141
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
Merged
Merged
Changes from 42 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
16d813f
Init
janfaracik d37f669
Squashed commit of the following:
janfaracik 2e58ded
Refine description
janfaracik de9753e
Refine
janfaracik c178d9a
Update _cards.scss
janfaracik 24ced46
Merge branch 'master' into new-experimental-run-page
janfaracik fc0fc74
Update new-build-page.jelly
janfaracik 3902855
Push
janfaracik 1e28bc0
Update new-build-page.jelly
janfaracik a732ec1
Fix description merge
janfaracik af726c0
Merge branch 'fix-description-merge' into move-run-sidepanel-to-overflow
janfaracik ea99b2e
Refine
janfaracik b15b2eb
Merge branch 'move-run-sidepanel-to-overflow' into new-experimental-r…
janfaracik a5283a2
Push
janfaracik bbfa7a9
Merge branch 'master' into move-run-sidepanel-to-overflow
janfaracik 8600476
Merge branch 'master' into new-experimental-run-page
janfaracik 01ce059
Merge branch 'move-run-sidepanel-to-overflow' into new-experimental-r…
janfaracik 736e8f1
Update run-host.jelly
janfaracik 78c325b
Refine
janfaracik 298bd15
Update dir.jelly
janfaracik 53b0a0e
Push
janfaracik 14b777d
Refine
janfaracik 550bf9b
Merge branch 'master' into new-experimental-run-page
janfaracik 43b6981
Update Run.java
janfaracik fda054d
Update dir.jelly
janfaracik 798b8c4
Refine
janfaracik 20b83aa
Improve in mobile
janfaracik 1b50a77
Use normal grid
janfaracik d70e3b1
Checkstyle
timja c572ec0
Some refinement
janfaracik f5f38f2
Refine
janfaracik a85eeeb
Refine
janfaracik 89649b0
Run prettier
timja f3d9e81
Refine classes
janfaracik a41a974
Tidy up
janfaracik bff6e73
Rename run-host to run-subpage
janfaracik f867f6b
Merge branch 'master' into new-experimental-run-page
janfaracik 8dea20e
Update changes.jelly
janfaracik 66926b1
Merge branch 'master' into new-experimental-run-page
timja 691f72a
Fix licence, rename tabs class
janfaracik 897a015
Add licence header
janfaracik e2bd2a1
Update Run.java
janfaracik 9894dbf
Update Run.java
janfaracik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
janfaracik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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 { | ||
janfaracik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * 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; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
janfaracik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { | ||
janfaracik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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"; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
janfaracik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice to have: This isn't active when the page is This is a pre-existing issue so not a blocker. |
||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.