-
Notifications
You must be signed in to change notification settings - Fork 64
Add link to agent a stage is running on to stage summary #495
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 all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b514377
Show node/agent a pipeline stage is running on in console summary
Hammie aff5972
Use computer icon for agent
Hammie ac25515
Extract agent code into a separate function
Hammie 887b4a6
Move stage node link into a separate component
Hammie 2f164a3
Fix tests
Hammie c7f9d45
Use DepthFirstScanner to find child Stage node
Hammie da743f6
Merge branch 'jenkinsci:main' into feature/stage-agent-info
Hammie a1839fc
Fix only the agent for the first stage in a pipeline being set
Hammie e8643ca
mvn spotless:apply
timja f3f22cf
Add tests and fix agent lookup for parallel pipelines
Hammie 47a814e
Only show agent info if it is available
Hammie 3ae5b58
Take root url into account for agent links
Hammie fb0bd65
Fix stage node link capitalization
Hammie 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
22 changes: 22 additions & 0 deletions
22
src/main/frontend/pipeline-console-view/pipeline-console/main/StageNodeLink.tsx
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,22 @@ | ||
import React from "react"; | ||
|
||
export interface StageNodeLinkProps { | ||
agent: string; | ||
} | ||
|
||
function getAgentUrl(name: string) { | ||
// Wrap built-in in brackets | ||
const id = name == "built-in" ? "(built-in)" : name; | ||
const rootPath = document.head.dataset.rooturl | ||
return `${rootPath}/computer/${id}/`; | ||
} | ||
|
||
const StageNodeLink = ({agent}: StageNodeLinkProps) => { | ||
const agentName = agent == "built-in" ? "Jenkins" : agent; | ||
const href = getAgentUrl(agent); | ||
return <> | ||
Running on <a href={href}>{agentName}</a> | ||
</> | ||
}; | ||
|
||
export default StageNodeLink; |
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
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
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
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
21 changes: 21 additions & 0 deletions
21
.../io/jenkins/plugins/pipelinegraphview/utils/parallelPipelineWithExternalAgent.jenkinsfile
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,21 @@ | ||
pipeline { | ||
agent none | ||
stages { | ||
stage('Parallel') { | ||
parallel { | ||
stage('Builtin') { | ||
agent { label 'built-in' } | ||
steps { | ||
echo "Hello, from home" | ||
} | ||
} | ||
stage('External') { | ||
agent { label 'external' } | ||
steps { | ||
echo "Hello, from far away" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to be working the agent name is coming through as
jenkins
and notJenkins
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess
jenkins
is also fine. What does the link say?(built-in)
or alsojenkins
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem was the
capitalize
css class applied to it.