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

Output pipeline summary #66

Merged
merged 31 commits into from
Feb 5, 2021
Merged

Conversation

mrginglymus
Copy link
Contributor

@mrginglymus mrginglymus commented Dec 30, 2020

Relating to jenkinsci/github-checks-plugin#89

Very much a draft, as I've bent a lot of plumbing to get this working, which I'll fix if it's felt this is something worth pursuing.

This piggy-backs on the logic from the FlowGraphTable to generate a simple textual representation of the pipeline graph.

It produces an output that looks something like:


In progress


Complete

  • Simple Stage (61 ms)
  • In parallel (0.25 sec)
    • p1 (10 ms)
      • p1s1 (43 ms)
        Unstable: something went wrong
      • p1s2 (17 ms)
    • p2 (44 ms)
  • Fails (41 ms)
    Error: hudson.AbortException: something went very wrong

Note that I've removed the checkout listener, as that will now be handled by the graph listener.

@mrginglymus
Copy link
Contributor Author

I've just realised those URLs are API urls - I'll work out where the display urls are hidden.

Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

Looks good, need to test out myself, not sure if using blueoceans internals is the best

@mrginglymus
Copy link
Contributor Author

mrginglymus commented Dec 30, 2020

I've removed links for now, until we can work out how to make them useful, as there doesn't appear to be a way to easily deep link to a flow node.

@timja
Copy link
Member

timja commented Dec 30, 2020

I've removed links for now, until we can work out how to make them useful, as there doesn't appear to be a way to easily deep link to a flow node.

Tests failure example here:
https://github.com/timja-org/junit-attachments-test/pull/4/checks?check_run_id=1627758985

Compilation failure:
https://github.com/timja-org/junit-attachments-test/pull/7/checks?check_run_id=1627774960

Example for inspiration of how the CloudBees SCM reporter shows failures:
https://github.com/cloudbees-sticky-dev/dow/pull/2/checks?check_run_id=925770699

image

it would be good if we could get the script that caused the failure in there

@mrginglymus
Copy link
Contributor Author

Should be easy enough, will have a play tomorrow.

Even bumping to 1.3.0, revapi is unhappy about removal of a public class (which was only public because @Extension) and reduction of ctor visibility (because checkstyle/spotbugs/someone told me to).

Not that the version fettling particularly matters right now, but it'd be nice to get something green.

@timja
Copy link
Member

timja commented Dec 30, 2020

Should be easy enough, will have a play tomorrow.

Even bumping to 1.3.0, revapi is unhappy about removal of a public class (which was only public because @Extension) and reduction of ctor visibility (because checkstyle/spotbugs/someone told me to).

Not that the version fettling particularly matters right now, but it'd be nice to get something green.

I think you can add an exclusion for that

@XiongKezhi XiongKezhi added the enhancement New feature or request label Dec 31, 2020
@XiongKezhi
Copy link
Contributor

For the table view, maybe you'll need: https://github.github.com/gfm/#tables-extension-

@timja
Copy link
Member

timja commented Dec 31, 2020

To be honest I’m not sure the Graph is terrible interesting, in larger pipelines it will be huge, aren’t we just interested in failed steps? And the input and output of those steps. Along with the stage / branch it failed on

@mrginglymus
Copy link
Contributor Author

This new design will push the full tree view into ChecksOutput text, and summarise results in the summary:

Summary

In parallel / p1 / p1s1 / Set stage result to unstable

Warning in unstable step, with arguments something went wrong.

something went wrong

Fails / Archive the artifacts

Error in archiveArtifacts step.

No artifacts found that match the file pattern "oh dear". Configuration error?
Stack trace
hudson.AbortException: No artifacts found that match the file pattern "oh dear". Configuration error?
	at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:258)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Text

  • Simple Stage (50 ms)
  • In parallel (0.25 sec)
    • p1 (5 ms)
      • p1s1 (44 ms)
        Unstable: something went wrong
      • p1s2 (18 ms)
    • p2 (45 ms)
  • Fails (0.28 sec)
    Error: No artifacts found that match the file pattern "oh dear". Configuration error?

I'll need to check limits on output sizes...

@mrginglymus
Copy link
Contributor Author

Once again, thwarted by revapi :(

@timja
Copy link
Member

timja commented Dec 31, 2020

Junit has some code around limiting the output if you check it’s publisher

@uhafner
Copy link
Member

uhafner commented Dec 31, 2020

Once again, thwarted by revapi :(

When you are developing a new feature you should increase the minor version in pom.xml. Patch versions are reserved for bug fixes that do not change the API.

@mrginglymus
Copy link
Contributor Author

Once again, thwarted by revapi :(

When you are developing a new feature you should increase the minor version in pom.xml. Patch versions are reserved for bug fixes that do not change the API.

👍

That’s fine, but my frustration is that revapi passes locally!

@mrginglymus
Copy link
Contributor Author

revapi still not happy :(

@timja
Copy link
Member

timja commented Jan 31, 2021

Any other planned work? I'll try test it out soon

@mrginglymus
Copy link
Contributor Author

Nothing planned for now

@timja
Copy link
Member

timja commented Jan 31, 2021

New lines don't seem to be working for the build log / some issue:

https://github.com/timja-org/junit-attachments-test/pull/7/checks?sha=b438cc8ff4005d214221edeaf94474572d44c165

image

also see what happens with ansi colours:

https://github.com/timja-org/junit-attachments-test/pull/7/checks?check_run_id=1801300909

tbh I think it might just be a spacing issue with the markdown needing another new line

@mrginglymus
Copy link
Contributor Author

Yep, missing a trailing newline...I think just that...

@timja
Copy link
Member

timja commented Jan 31, 2021

@timja
Copy link
Member

timja commented Jan 31, 2021

Fixed with another new line:
https://github.com/timja-org/junit-attachments-test/pull/7/checks?check_run_id=1801505585

Possible enhancement would be to strip ansi colour code's before sending
https://github.com/timja-org/junit-attachments-test/runs/1801514492

@timja
Copy link
Member

timja commented Jan 31, 2021

Could we set a better message on the failure reason on the check?

image

failed in 'stage' or sh step failed in 'stage' ?

or another suggestion

@timja
Copy link
Member

timja commented Jan 31, 2021

If you prefer we ship we can do that and create a new issue for the above ^^

@mrginglymus
Copy link
Contributor Author

Ahh the mysteries of GitHub flavoured markdown

@timja
Copy link
Member

timja commented Jan 31, 2021

@mrginglymus #66 (comment) ?

Copy link
Contributor

@XiongKezhi XiongKezhi left a comment

Choose a reason for hiding this comment

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

An amazing feature, huge thanks!!!

@XiongKezhi
Copy link
Contributor

XiongKezhi commented Feb 3, 2021

Could we set a better message on the failure reason on the check?

image

failed in 'stage' or sh step failed in 'stage' ?

or another suggestion

include both stage and step name would be great

@justinmchase
Copy link

Successful build! 🚀

I'm looking forward to updating this plugin in Jenkins.

Co-authored-by: Kezhi Xiong <august.xkz@gmail.com>
@timja timja merged commit 22f6a7c into jenkinsci:master Feb 5, 2021
@jglick
Copy link
Member

jglick commented Feb 8, 2021

I'll need to check limits on output sizes

FYI https://github.community/t/undocumented-65535-character-limit-on-requests/117564/5?u=jglick

@timja
Copy link
Member

timja commented Feb 8, 2021

I'll need to check limits on output sizes

FYI github.community/t/undocumented-65535-character-limit-on-requests/117564/5?u=jglick

ended up being implemented here btw: jenkinsci/github-checks-plugin#101

and API side: #68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants