Feat(Blob): Add graph render support for Blob Viewer
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
Feat(Blob): Add graph render support for Blob Viewer
Adds a rich view for graph files when the integration is enabled.
Supported extensions:
- mermaid
- plantuml
- pu
- puml
- iuml
- d2
- dot
- gv
- noml
- vg
- vl
Changelog: added
References
- solves #17325 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Enable the PlantUML integration (https://docs.gitlab.com/ee/administration/integration/plantuml.html#enable-plantuml-integration)
- Create a
.puml
file in a repository with example content from documentation - view the file in blob viewer
Merge request reports
Activity
mentioned in issue #17325 (closed)
added Leading Organization label
added pipelinetier-1 label
Thanks for your contribution to GitLab @schurzi!
- If you need help, page a coach by clicking here or come say hi on Discord.
- When you're ready, request a review by clicking here.
- We welcome AI-generated contributions and offer complimentary access to GitLab Duo!
- To add labels to your merge request, comment
@gitlab-bot label ~"label1" ~"label2"
.
This message was generated automatically. Improve it or delete it.
added Community contribution workflowin dev labels
assigned to @schurzi
This merge request will be counted as part of the running Hackathon!
Find yourself in the Hackathon Leaderboard or check out the Hackathon page for more information!
This message was generated automatically. Improve it or delete it.
added Hackathon label
added 1 commit
- 5a300354 - Feat(Blob): Add PlantUML render support for Blob Viewer
added linked-issue label
- Resolved by Brett Walker
- Resolved by Martin Schurz
3 Warnings 4c75253b: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines. bf3604ba: The commit subject must start with a capital letter. For more information, take a look at our Commit message guidelines. featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.
For more information, see:
- The Handbook page on merge request types.
- The definition of done documentation.
Reviewer roulette
Category Reviewer Maintainer backend @minahilnichols
(UTC-5)
@alipniagov
(UTC+1)
frontend @vvempati
(UTC+13)
@bsandlin
(UTC-6)
UX @pedroms
(UTC+0)
Maintainer review is optional for UX Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
DangerEdited by Danger Bot- Resolved by Brett Walker
@gitlab-bot ready @syasonik @ramistry
added workflowready for review label and removed workflowin dev label
@syasonik @ramistry, this Community contribution is ready for review.
- Do you have capacity and domain expertise to review this? If not, find one or more reviewers and assign to them.
- If you've reviewed it, add the workflowin dev label if these changes need more work before the next review.
- Please ensure the group's Product Manager has validated the linked issue.
This message was generated automatically. Improve it or delete it.
mentioned in issue gitlab-org/quality/triage-reports#22003 (closed)
- Resolved by Brett Walker
changed milestone to %17.9
added backend featureaddition frontend typefeature labels
requested review from @pskorupa
added pipeline:mr-approved label
added pipelinetier-2 label and removed pipelinetier-1 label
Before you set this MR to auto-merge
This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3.
Before you set this MR to auto-merge, please check the following:
- You are the last maintainer of this merge request
- The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
- This pipeline is recent enough (created in the last 8 hours)
If all the criteria above apply, please set auto-merge for this merge request.
See pipeline tiers and merging a merge request for more details.
added groupsource code label
added Category:Source Code Management devopscreate sectiondev labels
requested review from @tristan.read and removed review request for @ramistry
requested review from @digitalmoksha and removed review request for @pskorupa
added UX label
- Resolved by Brett Walker
Thanks for helping us improve the UX of GitLab. Your contribution is appreciated! We have pinged our UX team, so stay tuned for their feedback.
This message was generated automatically. Improve it or delete it.
added pipelinetier-3 pipeline:run-e2e-omnibus-once labels and removed pipelinetier-2 label
- Resolved by Brett Walker
Hey @schurzi, it's great that you're tackling this!
There are a couple things we need to think about.
One is that PlantUML rendering is actually supported by two services - the PlantUML server, or the Kroki server. Both can render PlantUML graphs. If the PLantUML server is not enabled, and Kroki is, then it handles the rendering. If the PlantUML server is enabled, then it handles it, even if Kroki is enabled. So we really need to handle both scenarios. And of course there are different calls based on which server is being used.
The other is I'm a little skittish about using different Asciidoc PlantUML calls from our usage in the
plantuml_filter.rb
Asciidoctor::PlantUml::Processor.plantuml_content(node.content, {})
There are some security considerations and it's better not to tangle with those right now.
Here's what I propose:
Our markdown pipeline deftly handles rendering PlantUML, as well as all of our other graphs. All that is required is that the graph code is surrounded by the proper code block. So we could take
@startuml Alicex -> Bob: Authentication Request Bob --> Alicex: Authentication Response Alicex -> Bob: Another authentication Request Alicex <-- Bob: Another authentication Response @enduml
and embed it in a code block like
```plantuml @startuml Alicex -> Bob: Authentication Request Bob --> Alicex: Authentication Response Alicex -> Bob: Another authentication Request Alicex <-- Bob: Another authentication Response @enduml ```
Besides handling PlantUML properly no matter what combination of services is enabled, but would also easily be the gateway into support ALL the graphs we support. We would just have to detect the file extension and put the proper code block header on it.
I think we could maybe rename
plantuml.rb
tograph.rb
for the viewer, and make it initially focused on the PlantUML extensions. Do the wrapping, and then have the partial operate similarly to the_markup.html.haml
. It would make sense to have our own_graph.html.haml
file, but it would be very similar to the markup one.What do you think? I know it's a bit of a change, but I don't think it should be too big. And it really sets us up to supporting all graph types.
Just for reference, the files that process PlantUML and Kroki are
added 1 commit
- 4c75253b - Generalize implementation to support multiple graph types
reset approvals from @tristan.read by pushing to the branch
- Resolved by Brett Walker
- Resolved by Brett Walker
mentioned in issue gitlab-org/quality/triage-reports#22185 (closed)
- Resolved by Brett Walker
3 Warnings 4c75253b: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines. bf3604ba: The commit subject must start with a capital letter. For more information, take a look at our Commit message guidelines. featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.
For more information, see:
- The Handbook page on merge request types.
- The definition of done documentation.
Reviewer roulette
Category Reviewer Maintainer backend @missy-gitlab
(UTC+1)
@alipniagov
(UTC+1)
frontend @vvempati
(UTC+13)
@bsandlin
(UTC-6)
UX @pedroms
(UTC+0)
Maintainer review is optional for UX Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangeradded workflowin review label and removed workflowready for review label
E2E Test Result Summary
allure-report-publisher
generated test report!e2e-test-on-cng:
test report for 4c75253bexpand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Govern | 84 | 0 | 10 | 0 | 94 | ✅ | | Create | 140 | 0 | 22 | 0 | 162 | ✅ | | Monitor | 8 | 0 | 12 | 0 | 20 | ✅ | | Verify | 52 | 0 | 20 | 0 | 72 | ✅ | | Data Stores | 33 | 0 | 10 | 0 | 43 | ✅ | | Plan | 86 | 0 | 8 | 0 | 94 | ✅ | | Package | 29 | 0 | 15 | 0 | 44 | ✅ | | Analytics | 2 | 0 | 0 | 0 | 2 | ✅ | | Configure | 0 | 0 | 3 | 0 | 3 | ➖ | | Growth | 0 | 0 | 2 | 0 | 2 | ➖ | | Fulfillment | 2 | 0 | 7 | 0 | 9 | ✅ | | ModelOps | 0 | 0 | 1 | 0 | 1 | ➖ | | Secure | 2 | 0 | 5 | 0 | 7 | ✅ | | Ai-powered | 0 | 0 | 2 | 0 | 2 | ➖ | | Manage | 1 | 0 | 9 | 0 | 10 | ✅ | | Release | 5 | 0 | 1 | 0 | 6 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 444 | 0 | 127 | 0 | 571 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
e2e-test-on-gdk:
test report for 4c75253bexpand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Govern | 53 | 0 | 2 | 0 | 55 | ✅ | | Create | 105 | 0 | 3 | 0 | 108 | ✅ | | Plan | 34 | 0 | 0 | 0 | 34 | ✅ | | Verify | 46 | 0 | 2 | 0 | 48 | ✅ | | Release | 4 | 0 | 0 | 0 | 4 | ✅ | | Package | 24 | 0 | 0 | 0 | 24 | ✅ | | Data Stores | 16 | 0 | 0 | 0 | 16 | ✅ | | Manage | 1 | 0 | 0 | 0 | 1 | ✅ | | Secure | 4 | 0 | 0 | 0 | 4 | ✅ | | Fulfillment | 1 | 0 | 0 | 0 | 1 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 288 | 0 | 7 | 0 | 295 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
Edited by ****added this merge request to the merge train at position 2
Hi @schurzi
See where you rank! Check your spot on the contributor leaderboard and unlock rewards.
How was your code review experience with this merge request? Please tell us how we can continue to iterate and improve:
- React with a
or a on this comment to describe your experience. - Create a new comment starting with
@gitlab-bot feedback
below, and leave any additional feedback you have for us in the comment.
As a benefit of being a GitLab Community Contributor, you have access to GitLab Duo, our AI-powered features. With Code Suggestions, Chat, Root Cause Analysis and more AI-powered features, GitLab Duo helps to boost your efficiency and effectiveness by reducing the time required to write and understand code and pipelines. Visit the GitLab Duo documentation to learn more about the benefits.
Thanks for your help!
This message was generated automatically. Improve it or delete it.
- React with a
mentioned in commit 019c8677
@mmacfarlane might be another one for a release post...
added workflowstaging-canary label and removed workflowin review label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label