jenkinsci / pipeline-graph-view-plugin

https://plugins.jenkins.io/pipeline-graph-view/
Other
107 stars 55 forks source link

Add link to agent a stage is running on to stage summary #495

Open Hammie opened 3 weeks ago

Hammie commented 3 weeks ago

Adds a line to the console view stage summary, showing which agent the stage is running on.

Fixes #426

Testing done

Ran the plugin on a Jenkins instance with multi-stage pipelines, and so far everything seems to work.

jenkins_pipeline_agent

Submitter checklist

KalleOlaviNiemitalo commented 3 weeks ago

What does this render if the pipeline has agent none and there is no agent for the stage either? We have some pipelines like that, where an agentless stage sets job properties conditionally before the job starts waiting for an available agent.

timja commented 3 weeks ago

What does this render if the pipeline has agent none and there is no agent for the stage either? We have some pipelines like that, where an agentless stage sets job properties conditionally before the job starts waiting for an available agent.

Good find, there's a bug it always displays the text when it should only do it if the agent is running on a stage:

image
Hammie commented 3 weeks ago

I've also been testing it on our production instance, and there are some more edge cases where it is not quite working as expected.

I'll try and fix these and also write some tests for them so we can have some confidence in it working well.

But I'm not an experienced Java dev, so we'll see how that goes...

Hammie commented 1 week ago

I've added some tests and fixed the known issues.

Not really happy with the actual agent lookup code, but I don't think I can really do it better.

At the very least the tests should make it easier if someone wants to try and rewrite it.