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

Documentation for GitLab integration? #398

Open
jaskij opened this issue Nov 25, 2024 · 4 comments
Open

Documentation for GitLab integration? #398

jaskij opened this issue Nov 25, 2024 · 4 comments
Labels
C-documentation Category: related to documentation.

Comments

@jaskij
Copy link

jaskij commented Nov 25, 2024

I will probably be working on integrating cargo-llvm-cov later this week (since it seems all the pieces are in place), would you be open to a PR documenting that? If so, is the README the right place? From my initial look, this should be straightforward and even shorter than GitHub Actions upload to Codecov.

While I'm at it, here are the limitations mentioned in GitLab docs, do you foresee any issues?

A limit of 100 nodes for Cobertura format XML files applies. If your Cobertura report exceeds 100 nodes, there can be mismatches or no matches in the merge request diff view.

A single Cobertura XML file can be no more than 10 MiB. For large projects, split the Cobertura XML into smaller files. See this issue for more details. When submitting many files, it can take a few minutes for coverage to show on a merge request.

@taiki-e
Copy link
Owner

taiki-e commented Dec 4, 2024

I would accept a PR to add example to readme.


While I'm at it, here are the limitations mentioned in GitLab docs, do you foresee any issues?

A limit of 100 nodes for Cobertura format XML files applies. If your Cobertura report exceeds 100 nodes, there can be mismatches or no matches in the merge request diff view.
A single Cobertura XML file can be no more than 10 MiB. For large projects, split the Cobertura XML into smaller files. See this issue for more details. When submitting many files, it can take a few minutes for coverage to show on a merge request.

cc @mike-kfed Any thoughts on this?

@taiki-e taiki-e added the C-documentation Category: related to documentation. label Dec 4, 2024
@mike-kfed
Copy link
Contributor

I know about those limitations. My project also has a tool to split up the big xml files into 9.5MiB chunked files. This tool is not part of cargo-llvm-cov. Not sure you @taiki-e want to have that functionality in your tool? If you like I can make a PR to add that feature though, with an additional cmd line argument.

It could automagically number the output xml filename based on the initial one. Then the output would be the big xml and the chunked one's, then gitlab-ci script could only upload the numbered one's. (this implies that a small xml would also be "split" into one xml with the postfix -001.xml or similar)

tldr; if you want that feature, we should likely discuss that in a separate issue - right now the gitlab-ci could use my tool as part of it's script to split the large xml, i.e. be part of the proposed documentation.

@jaskij
Copy link
Author

jaskij commented Dec 6, 2024

To be honest, I was not planning on doing the splitting - I'm certainly not generating reports large enough for that to be an issue. I'm hesitant to document things I can not test myself.

For now, I will do the basic setup, without splitting, and someone can go on from there.


Another issue is the image used. When it comes to GitLab CI, running cargo install as part of your job is an antipattern without an extensive caching config which would be out of scope. Examples with antipatterns are something I'd loathe to do. My normal procedure is just to use my own docker image which includes the tools I want.

Perhaps just a snippet, showing how to run cargo-llvm-cov and how to upload the artifacts would be enough? With a short paragraph explaining it?

@mike-kfed
Copy link
Contributor

I like your plan, it's sufficient to document it without the splitting. To generate >10MiB worth of cobertura xml, your codebase has to be huge. Whoever runs into this situation can add update the documentation on how to deal with this later.

However these are just my 2 cents, Taiki is the maintainer of this project, ultimately his opinion counts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-documentation Category: related to documentation.
Projects
None yet
Development

No branches or pull requests

3 participants