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

Ignore stage graph output while checking out #77

Merged
merged 1 commit into from
Feb 7, 2021

Conversation

XiongKezhi
Copy link
Contributor

A quick fix for https://issues.jenkins.io/browse/JENKINS-64813

checking out pipeline library will trigger our listener although there is no flow graph available, so an NEP occurs.

@XiongKezhi XiongKezhi added the bug Something isn't working label Feb 7, 2021
@XiongKezhi XiongKezhi requested a review from timja February 7, 2021 07:43
@codecov
Copy link

codecov bot commented Feb 7, 2021

Codecov Report

Merging #77 (95891f0) into master (4fd868c) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #77      +/-   ##
============================================
- Coverage     87.33%   87.31%   -0.03%     
  Complexity      139      139              
============================================
  Files            16       16              
  Lines           624      623       -1     
  Branches         47       47              
============================================
- Hits            545      544       -1     
  Misses           63       63              
  Partials         16       16              
Impacted Files Coverage Δ Complexity Δ
...gins/checks/status/BuildStatusChecksPublisher.java 82.19% <ø> (-0.25%) 14.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4fd868c...95891f0. Read the comment docs.

@@ -150,7 +150,7 @@ public void onCheckout(final Run<?, ?> run, final SCM scm, final FilePath worksp
final TaskListener listener, @CheckForNull final File changelogFile,
@CheckForNull final SCMRevisionState pollingBaseline) {
getChecksName(run).ifPresent(checksName -> publish(ChecksPublisherFactory.fromRun(run, listener),
ChecksStatus.IN_PROGRESS, ChecksConclusion.NONE, checksName, getOutput(run)));
ChecksStatus.IN_PROGRESS, ChecksConclusion.NONE, checksName, null));
Copy link
Member

Choose a reason for hiding this comment

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

won't we missing the title as well? have you tested this?

Copy link
Member

Choose a reason for hiding this comment

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

I've tested it and it seems fine, I can't find any issues with it.

I was also looking into this, and found 2 options:

  1. the same fix as you
  2. check the workspace on checkout and if it contains '@libs' we skip it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It solves the NPE and the title will simply be "in progress" which is automatically added by GitHub as before. And for pipeline users, the title of the check will be updated when a new stage/branch is triggered.

@XiongKezhi XiongKezhi merged commit 57bb131 into master Feb 7, 2021
@XiongKezhi XiongKezhi deleted the npe-in-checkout-pipeline-library branch February 7, 2021 08:13
@oleg-nenashev
Copy link
Member

Thanks for the fix!

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.

3 participants