Add support for rendering readme in terraform package details page
What does this MR do and why?
Integrate Terraform module metadata into fronte... (!154567 - merged) added readme data to the terraform registry template
This MR renders the readme in terraform package details page
The Readme is added as 3rd tab which renders only when the package contains readme data.
Found a component ee/vulnerabilities/components/generic_report/types/report_type_markdown.vue
which uses markdown API to render the markdown.
Moved this component to vue_shared/markdown/markdown_content.vue
(Better name suggestions are welcome)
The MR also includes:
- Adding a new
hcl
language extension to the content editor's HighlightJS language loader - Implementing a new
terraform.js
syntax highlighting module for HCL - Updating tests
Changelog: added
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
Before | After |
---|---|
How to set up and validate locally
- Enable the feature flag in rails console:
Feature.enable(:index_terraform_module_archive)
- On HashiCorp Terraform registry, choose any module to test with, then go to its source code on GitHub and download it as a zip file.
- From your terminal, use cURL to publish the module you just downloaded: https://docs.gitlab.com/ee/user/packages/terraform_module_registry/#using-the-api
curl --location --header "PRIVATE-TOKEN: <your_PAT>" --upload-file <module_zip_file> "http://gdk.test:3000/api/v4/projects/<project_id>/packages/terraform/modules/my-module/my-system/0.0.1/file"
- Visit
Project|Group > Operate > Terraform modules
- Visit the details page & check Readme is rendered in a tab.
Related to #438060 (closed)