-
Notifications
You must be signed in to change notification settings - Fork 1
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
clean(GH-881): Add Schema Diagram Generation to Github Pages #885
Conversation
WalkthroughThe pull request integrates schema diagram generation into the CI/CD process. A new job, Changes
Sequence Diagram(s)sequenceDiagram
participant Trigger as "Push (next branch)"
participant Combined as "Combined Workflow"
participant SchemaGen as "Generate Diagram Job"
participant Deploy as "Deploy to Pages Job"
Trigger->>Combined: Initiates workflow
Combined->>SchemaGen: Run generate-schema-diagrams job
SchemaGen->>SchemaGen: Process JSON schemas & generate diagrams
SchemaGen->>Deploy: Upload schema diagrams artifact
Deploy->>Deploy: Download artifact & update docs
Deploy->>Pages: Deploy updated pages
sequenceDiagram
participant Runner as "GitHub Runner"
participant Checkout as "Checkout Repo"
participant Setup as "Setup Python 3.12"
participant Install as "Install Dependencies"
participant Script as "Run convert_schema.py"
participant Upload as "Upload Artifact"
Runner->>Checkout: Checkout repository
Runner->>Setup: Configure Python environment
Runner->>Install: Install jsonschema & jinja2
Runner->>Script: Execute schema conversion script
Script->>Upload: Save diagrams & upload as artifact
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (5)
.github/workflows/combined-workflow-with-docs.yaml (1)
58-410
: Trailing Spaces Cleanup
YAMLlint has flagged several instances of trailing spaces (e.g., lines 58, 65, 72, 80, etc.). Please remove these extraneous spaces to ensure the file meets linting standards.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 104-104: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/deploy-pages.yaml (1)
176-193
: Redundant Artifact Download Steps
After creating the index page, the workflow re-downloads coverage reports, API docs, and security reports. Please confirm whether this repetition is intentional or if the earlier downloads can be reused to reduce redundancy..github/workflows/generate-schema-diagrams.yaml (3)
13-31
: Job Setup and Dependencies Installation
The job correctly checks out the repository, creates the output directory, sets up Python 3.12, and installs the required dependencies (jsonschema
andjinja2
). For reproducibility, consider pinning the dependency versions.
32-401
: Schema Converter Script Review
The inline Python script is comprehensive and well organized:
• It defines helper functions (e.g.,sanitize_name
,get_type_name
) and encapsulates schema loading and conversion logic.
• The conversion process covers property types, array handling, and nested objects.
• HTML generation via a Jinja2 template is clearly implemented.Suggestions:
– Consider adding error handling when loading and parsing JSON schema files to better manage malformed inputs.
– Pin dependency versions in the installation step for added reproducibility.Overall, the script adheres to good practices and effectively generates the desired diagrams.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 58-58: trailing spaces
(trailing-spaces)
[error] 65-65: trailing spaces
(trailing-spaces)
[error] 72-72: trailing spaces
(trailing-spaces)
[error] 80-80: trailing spaces
(trailing-spaces)
[error] 90-90: trailing spaces
(trailing-spaces)
[error] 94-94: trailing spaces
(trailing-spaces)
[error] 97-97: trailing spaces
(trailing-spaces)
[error] 101-101: trailing spaces
(trailing-spaces)
[error] 110-110: trailing spaces
(trailing-spaces)
[error] 120-120: trailing spaces
(trailing-spaces)
[error] 136-136: trailing spaces
(trailing-spaces)
[error] 154-154: trailing spaces
(trailing-spaces)
[error] 283-283: trailing spaces
(trailing-spaces)
[error] 290-290: trailing spaces
(trailing-spaces)
[error] 304-304: trailing spaces
(trailing-spaces)
[error] 308-308: trailing spaces
(trailing-spaces)
[error] 313-313: trailing spaces
(trailing-spaces)
[error] 318-318: trailing spaces
(trailing-spaces)
[error] 323-323: trailing spaces
(trailing-spaces)
[error] 330-330: trailing spaces
(trailing-spaces)
[error] 337-337: trailing spaces
(trailing-spaces)
[error] 344-344: trailing spaces
(trailing-spaces)
[error] 349-349: trailing spaces
(trailing-spaces)
[error] 355-355: trailing spaces
(trailing-spaces)
[error] 358-358: trailing spaces
(trailing-spaces)
[error] 364-364: trailing spaces
(trailing-spaces)
[error] 367-367: trailing spaces
(trailing-spaces)
[error] 379-379: trailing spaces
(trailing-spaces)
[error] 382-382: trailing spaces
(trailing-spaces)
[error] 387-387: trailing spaces
(trailing-spaces)
[error] 398-398: trailing spaces
(trailing-spaces)
58-410
: Trailing Spaces Cleanup
YAMLlint has identified multiple trailing space issues (e.g., lines 58, 65, 72, etc.) as well as a missing newline at the end of the file. Please remove these formatting issues to keep the file clean and compliant with linting guidelines.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 58-58: trailing spaces
(trailing-spaces)
[error] 65-65: trailing spaces
(trailing-spaces)
[error] 72-72: trailing spaces
(trailing-spaces)
[error] 80-80: trailing spaces
(trailing-spaces)
[error] 90-90: trailing spaces
(trailing-spaces)
[error] 94-94: trailing spaces
(trailing-spaces)
[error] 97-97: trailing spaces
(trailing-spaces)
[error] 101-101: trailing spaces
(trailing-spaces)
[error] 110-110: trailing spaces
(trailing-spaces)
[error] 120-120: trailing spaces
(trailing-spaces)
[error] 136-136: trailing spaces
(trailing-spaces)
[error] 154-154: trailing spaces
(trailing-spaces)
[error] 283-283: trailing spaces
(trailing-spaces)
[error] 290-290: trailing spaces
(trailing-spaces)
[error] 304-304: trailing spaces
(trailing-spaces)
[error] 308-308: trailing spaces
(trailing-spaces)
[error] 313-313: trailing spaces
(trailing-spaces)
[error] 318-318: trailing spaces
(trailing-spaces)
[error] 323-323: trailing spaces
(trailing-spaces)
[error] 330-330: trailing spaces
(trailing-spaces)
[error] 337-337: trailing spaces
(trailing-spaces)
[error] 344-344: trailing spaces
(trailing-spaces)
[error] 349-349: trailing spaces
(trailing-spaces)
[error] 355-355: trailing spaces
(trailing-spaces)
[error] 358-358: trailing spaces
(trailing-spaces)
[error] 364-364: trailing spaces
(trailing-spaces)
[error] 367-367: trailing spaces
(trailing-spaces)
[error] 379-379: trailing spaces
(trailing-spaces)
[error] 382-382: trailing spaces
(trailing-spaces)
[error] 387-387: trailing spaces
(trailing-spaces)
[error] 398-398: trailing spaces
(trailing-spaces)
[error] 410-410: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/combined-workflow-with-docs.yaml
(1 hunks).github/workflows/deploy-pages.yaml
(4 hunks).github/workflows/generate-schema-diagrams.yaml
(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/generate-schema-diagrams.yaml
[error] 58-58: trailing spaces
(trailing-spaces)
[error] 65-65: trailing spaces
(trailing-spaces)
[error] 72-72: trailing spaces
(trailing-spaces)
[error] 80-80: trailing spaces
(trailing-spaces)
[error] 90-90: trailing spaces
(trailing-spaces)
[error] 94-94: trailing spaces
(trailing-spaces)
[error] 97-97: trailing spaces
(trailing-spaces)
[error] 101-101: trailing spaces
(trailing-spaces)
[error] 110-110: trailing spaces
(trailing-spaces)
[error] 120-120: trailing spaces
(trailing-spaces)
[error] 136-136: trailing spaces
(trailing-spaces)
[error] 154-154: trailing spaces
(trailing-spaces)
[error] 283-283: trailing spaces
(trailing-spaces)
[error] 290-290: trailing spaces
(trailing-spaces)
[error] 304-304: trailing spaces
(trailing-spaces)
[error] 308-308: trailing spaces
(trailing-spaces)
[error] 313-313: trailing spaces
(trailing-spaces)
[error] 318-318: trailing spaces
(trailing-spaces)
[error] 323-323: trailing spaces
(trailing-spaces)
[error] 330-330: trailing spaces
(trailing-spaces)
[error] 337-337: trailing spaces
(trailing-spaces)
[error] 344-344: trailing spaces
(trailing-spaces)
[error] 349-349: trailing spaces
(trailing-spaces)
[error] 355-355: trailing spaces
(trailing-spaces)
[error] 358-358: trailing spaces
(trailing-spaces)
[error] 364-364: trailing spaces
(trailing-spaces)
[error] 367-367: trailing spaces
(trailing-spaces)
[error] 379-379: trailing spaces
(trailing-spaces)
[error] 382-382: trailing spaces
(trailing-spaces)
[error] 387-387: trailing spaces
(trailing-spaces)
[error] 398-398: trailing spaces
(trailing-spaces)
[error] 410-410: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: call-owasp-security-checks / security-scan (zmsclient, 8.0)
- GitHub Check: call-owasp-security-checks / security-scan (zmsdb, 8.0)
- GitHub Check: call-php-unit-tests / zmsapi-test
- GitHub Check: call-owasp-security-checks / security-scan (zmsdldb, 8.0)
- GitHub Check: call-owasp-security-checks / security-scan (zmsmessaging, 8.0)
- GitHub Check: call-owasp-security-checks / security-scan (zmscitizenapi, 8.0)
- GitHub Check: call-owasp-security-checks / security-scan (zmscalldisplay, 8.0)
- GitHub Check: call-owasp-security-checks / security-scan (zmsapi, 8.0)
- GitHub Check: call-owasp-security-checks / security-scan (zmsadmin, 8.0)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (7)
.github/workflows/combined-workflow-with-docs.yaml (2)
83-84
: Schema Diagram Generation Job Added
The newgenerate-schema-diagrams
job is correctly integrated by referencing its dedicated workflow file. This modular design improves maintainability.
87-91
: Deploy-to-Pages Dependency Update
Addinggenerate-schema-diagrams
into theneeds
array and checking its result in theif
condition ensures that deployment occurs only after successful diagram generation. Please verify that the external workflow reliably reports its status..github/workflows/deploy-pages.yaml (2)
23-26
: Updated Permissions
The addition ofcontents: read
to the permissions block is appropriate for accessing repository contents during deployment.
41-46
: Download Schema Diagrams Step
The newly added step to download theschema-diagrams
artifact and place it inpublic/diagrams
is well integrated. This ensures that the generated diagrams become part of the deployed assets..github/workflows/generate-schema-diagrams.yaml (3)
1-9
: New Workflow for Schema Diagram Generation
This workflow neatly encapsulates the schema diagram generation logic. The use ofworkflow_call
with an output (diagrams_artifact
) enhances reusability and integrates well with downstream deployment jobs.
10-12
: Permissions Setup
Grantingcontents: read
permission is essential for accessing and processing the JSON schema files. The permission configuration is appropriately minimal and secure.
402-410
: Artifact Upload and Workflow Finalization
Executing the schema conversion script and uploading the resulting diagrams artifact (with a retention of one day) is implemented correctly. Ensure that downstream workflows properly utilize this artifact.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 410-410: no new line character at the end of file
(new-line-at-end-of-file)
Pull Request Checklist (Feature Branch to
next
):next
Branch in meinen Feature-Branch gemergt.Summary by CodeRabbit
New Features
Documentation