-
Notifications
You must be signed in to change notification settings - Fork 28
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
Ability to reuse/update checks #45
Comments
would it make sense if I expose the Since we don't have the mechanism to track the status of a check unless we request GitHub through project name, PR, and check name which is bad IMO. |
Steps cannot take closures with arguments. (Even if they could, such a syntax would be incompatible with Declarative Pipeline.) You can add either an environment variable or a custom contextual object that other steps can look for: withCheck('My Check Name') {
sh 'test --output output.xml'
junit 'output.xml'
} |
Ah yes, sorry - spent too much time on shared libraries - where what I've written is roughly what I implemented before I realised it woudln't really work without more plugin support. A contextual checks object would make a lot of things easier. |
If interested, check Javadoc. |
Yes, that wouldn't be ideal! Can we not add the |
There is no need for a special API. You just submit a check with the same name and different details. |
Ah, does that work? I tried to find details of what happens in the github docs and it wasn't clear. I note that github-api does explicitly call the |
That's how our status checks work. |
I believe you, I just wish the documentation was a bit clearer :) For instance I wonder what it does to existing annotations? |
After reading so many conversations about the custom names for JUnit checks, I'm still a little confused at some points. You create this issue here just want us to provide the ability to update the checks, which you can actually do by publishing checks with the same name as long as you call the And about the |
So I did initially try just creating a checks with the same name, however, this didn't work as I would hope as, because every time time the checks api posts a new check to github it clobbers the started at time: For almost every other field this doesn't matter, as it's the last value that matters (title, status, details, finished at etc etc) but for started at the only thing that knows it is the first check I post. The junit plugin (currently) has no way of knowing what time the check was started, and unless I'm missing something undocumented in the github docs, when we post a new check it entirely replaces the old check. |
the suggestion is that adding a new object that contains checks context information would allow other implementations to resolve the name from that object rather than using a default. i.e.:
and junit would report 'my junit' which woud mean there would be a standard way to provide a checks name (although a default would still be required) and yes ah Bill mentioned it would allow publishing the in progress check as well |
Well, not sure if the |
Or if for architectural reasons it is impossible for Jenkins to keep track of this information (the earlier check was posted by a different plugin, for example), |
I'm figuring out a way to update the checks. We need an public void update(ChecksDetails addedDetails); or public void update(CheckDetails originDetails, ChecksDetails addedDetails); since the dependent github-api library doesn't support updating the checks either (which always POST instead PATCH as github documented for updating a check), we just append things (started at time, annotations) in And another problem is, where we define this method, in checks-api, github-check, or just in the |
I've opened a PR against |
This was fixed by #49 |
Coming from jenkinsci/junit-plugin#210...
We're making extensive use of the checks API now, and so far it's absolutely fantastic. The final missing piece of the jigsaw is the ability to update and reuse checks.
We have moved from reusing statuses, where we would ping a 'queued', 'in progress', and 'success'/'failure' message as appropriate, as tests progressed.
With checks, we are unable to do this (properly) via the provided API, and so results only get reported when a task is complete. We could publish a new check with the same name, but then we lose things like duration.
My ideal API would look something like:
and, for use with another plugin
where the implementation of withCheck is (in psuedo code) something like
The text was updated successfully, but these errors were encountered: