Comments (11)
Hi
It looks like when requesting /projects/ID/commits/SHA-1/status.json , the response you should get is:
{"id":5,"sha":"c3202889d89d8d7ab70cd2c5adf9b721bcec85b6","status":"failed","coverage":42.0}
It seems it's just a matter of adding the additional "coverage" to the json response.
I think it's fair to assume that if we add here https://github.com/DABSquared/gitlab-plugin/blob/8a9468afebda30d668f437810b2e3067861b5872/src/main/java/com/dabsquared/gitlabjenkins/GitLabWebHook.java#L225 object.put("coverage", the_float_percentage)
we will get that code coverage number.
I don't know how to get this "percentage" though =) Gitlab CI gives them a regular expression to extract this value, which they'll pass as a float.
from gitlab-plugin.
Hmm it would seem we would need to calculate the percentage of successful builds correct?
from gitlab-plugin.
I think this "coverage" is for the "code coverage results".
I just installed Cobertura and I have these values in jenkins: "Packages 83% Files 24% Classes 25% Methods 28% Lines 27% Conditionals 28%"
Problem is how to get these results and what result should be considered. For me I could use the percentage of "Lines", but I'm guessing the user should be able to specify which "code coverage" percentage (s)he wants to use.
from gitlab-plugin.
Just to be clear, this is related to "code coverage for the unit tests".
In GitLab we now see:
That "coverage" value comes from gitlab ci. We can see it here:
And this was fed from a regexp that the user needs to build, against the whole output of the command that was run.
You specify it in the settings of gitlab ci:
Then you'll get the "code coverage" value shown in the first screenshot...
from gitlab-plugin.
This feature would be a major enhancement to the plugin. With jenkins, the cobertura plugin give some good metrics.
I will take a look tomorrow to see if I find a way to get these metrics via the API.
from gitlab-plugin.
We should also see what other metric plugins this could be used for or develop our own. For instance most of my projects are Obj-C?/Swift and and PHP
from gitlab-plugin.
If you hover the "health report", in the healthReportDetails we have lines that represent the various values of stability. They all have a global percentage.
We could have an option in the gitlab-plugin specifying which plugin name to get this percentage and publish it in the coverage number. I'm guessing via this way you would support any plugin.
Is this possible? Unfortunately I have no idea on how to do this =)
from gitlab-plugin.
I'm probably completely out of my depth here, but this seems to work: zipleen@0621f9a
There's a lot of "health reports" so we need to specify which build report we want, mine is "CoberturaBuildAction". Can you add this as a settings per project? Is this acceptable ?
from gitlab-plugin.
I don't see a good way to support this feature, if it even still exists in GitLab. It requires an optional dependency on other Jenkins plugins which can provide code coverage, and we'd have to code various methods to extract that result from them and return it to GitLab.
from gitlab-plugin.
Will be some movement in this direction? Some groovy function like updateGitlabCommitStatus?
from gitlab-plugin.
I think we should split the concerns. Providing a means to set the coverage is different than automatically calculating the coverage. For many, the first option would be more relevant because this would allow independent calculations of which coverage is relevant for them.
from gitlab-plugin.
Related Issues (20)
- badges are not applied because 'current' repository detection is wrong when loading library dynamically HOT 1
- gitlab status is inconsistent
- create MR while running branch pipe creates mixed status with never ending branch status HOT 1
- GitLab Plugin doesn't allow rebuild on comment.
- Disabling the option "Enable authentication for '/project' end-point" in Jenkins
- webhook return 404
- acceptGitlabMR doesn`t throw exception in case of merge failure HOT 1
- Authentication in Jenkins does not work HOT 2
- updateGitlabCommitStatus is not working with Jenkins Merge Request jobs HOT 2
- The test connection button on Jenkins' configure page throws Client error: CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES HOT 6
- HTTP 403 Forbidden not treated as an error for step: updateGitlabCommitStatus
- Add pull_request_template.md for standardized format to submit changes
- with version 1.8.0 gitlab plugin, no build is queued in jenkins after MR is raised in gitlab HOT 1
- Add git merge request variables to parameter of jenkins build (not only to environment)
- Webhook firing although configuration doesn't match
- Gitlab with context path /gitlab - Commit url - 404 HOT 2
- Error 403 anonymous is missing the Tarea/Build permission on multibranch project when executing webhook push
- Webhook trigger handler does not process new commit trigger on open merge requests: GitLab plugin 1.8.0 HOT 1
- CasC issue with gitLabConnectionConfig : empty connection created
- UpdateGitlabCommitStatus in Jenkins not Displaying Stages in GitLab UI after Upgrading HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitlab-plugin.