Skip to content

Conversation

@Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Dec 20, 2024

I have observed in some cases that despite a valid stage name is specified, I don't get the corresponding logs being displayed (Found stage ..., No stage ...), indicating that there may be an issue during the resolution of FlowExecution.
For now, adding more diagnostics so that on next occurrence I can pinpoint the issue better.

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@Vlatombe Vlatombe requested a review from a team as a code owner December 20, 2024 17:05
@Vlatombe Vlatombe requested a review from jglick December 20, 2024 17:06
Comment on lines +137 to +138
Run<?,?> run = tr.getRun();
if (stageName != null) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Run<?,?> run = tr.getRun();
if (stageName != null) {
if (stageName != null) {
Run<?,?> run = tr.getRun();

FlowNode stageId = new DepthFirstScanner().findFirstMatch(execution, new StageNamePredicate(stageName));
if (stageId != null) {
listener.getLogger().println("Found stage \"" + stageName + "\" in " + run.getFullDisplayName());
tr = ((hudson.tasks.junit.TestResult) tr).getResultForPipelineBlock(stageId.getId());
Copy link
Member

Choose a reason for hiding this comment

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

Does this cast need to be checked?

Comment on lines +158 to +159
if (prevRun instanceof FlowExecutionOwner.Executable) {
FlowExecutionOwner owner = ((FlowExecutionOwner.Executable) prevRun).asFlowExecutionOwner();
Copy link
Member

Choose a reason for hiding this comment

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

(reminder to do #310)

Comment on lines +206 to 207
if (targetBranch instanceof Job) {
result = getTestResult(project, ((Job<?, ?>) targetBranch).getLastBuild(), listener);
Copy link
Member

Choose a reason for hiding this comment

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

here too

@jglick jglick merged commit fe4fd4a into jenkinsci:master Dec 20, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants