Skip to content
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

Return root stages if they have child steps. #377

Merged
merged 3 commits into from
Apr 4, 2024
Merged

Conversation

timbrown5
Copy link
Contributor

Return stages root if they have a child step - we cannot move those to a parent.

Fix for #357, fork of #363.

Testing done

Tested manually

Screenshot from 2024-04-02 17-37-59

Submitter checklist

Preview Give feedback

@timbrown5 timbrown5 requested a review from a team as a code owner April 3, 2024 07:47
@timbrown5
Copy link
Contributor Author

timbrown5 commented Apr 3, 2024

Doesn't fix the graph not showing the stage:
Screenshot from 2024-04-03 11-05-53

@timja timja added the bug Something isn't working label Apr 3, 2024
if (errorAction != null) {
// If this is a Jenkins failure exception, then we don't need to add a new node
// - it will come from an existing step if there is a stage for the step to be part of.
if (hasStage && PipelineNodeUtil.isJenkinsFailureException(errorAction.getError())) {
Copy link
Member

Choose a reason for hiding this comment

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

I think this will fix it for no stages, but does this fix withCredentials in a stage? I think that's where I got stuck because its a block scoped step, it wasn't handled.

@timbrown5
Copy link
Contributor Author

No, the step blocks aren't returned.
We can create a method just for the Console View that returns them, but I'm not sure how they should be handled - I worry they might need to treated like a stage and (If they have an InvocationAction) as a step - assuming that means they have their own output.

This does fix the problem of the root Pipeline Start node being filtered out regardless of it it has a step (or exception).

@timja timja merged commit db73d64 into jenkinsci:main Apr 4, 2024
14 checks passed
@timja
Copy link
Member

timja commented Apr 4, 2024

Makes sense I had a similar fix but stopped because of the above but this makes it a bit better so may as well proceed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants