Skip to content

Commit

Permalink
Auto-generate mermaid diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 11, 2024
0 parents commit 4fd865a
Show file tree
Hide file tree
Showing 80 changed files with 14,276 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .devcontainer/file/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "File",
"image": "mcr.microsoft.com/devcontainers/python:3.11",
"postCreateCommand": "sudo apt install jq && pip install -r requirements.txt",
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"redhat.vscode-yaml"
],
"settings": {
"yaml.schemas": {
"schemas/base.schema.json": [
"decision-tree-compressed-new.yaml",
"decision-tree.yaml"
]
}
}
}
}
}
40 changes: 40 additions & 0 deletions .devcontainer/frontend/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "Frontend",
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",
"forwardPorts": [
5173
],
"postCreateCommand": "cd frontend; npm install",
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"streetsidesoftware.code-spell-checker",
"mhutchie.git-graph",
"ms-vsliveshare.vsliveshare",
"Vue.volar",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
],
"settings": {
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.renderWhitespace": "boundary",
"files.trimTrailingWhitespace": true,
"terminal.integrated.inheritEnv": true,
"debug.toolBarLocation": "commandCenter",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
}
}
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.devcontainer/
.github/
.venv/
.vscode/
*.md
!README.md
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
line_length = 120
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
indent_size = 4
11 changes: 11 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* @MinBZK/ai-validation-team

decision-tree.yaml @ruthkoole
categories.yaml @ruthkoole

# excluded files so github actions bot can auto update dependencies
# see https://github.com/orgs/community/discussions/23064
.github/workflows/*
.devcontainer/devcontainer.json
.pre-commit-config.yaml
frontend/package.json
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Bug Report
description: Let us know about an unexpected error, a crash, or an incorrect behavior.
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: |
# Thank you for opening an issue.
## Filing a bug report
To fix problems, we need clear reproduction cases. Please fill in the bug report as exact as possible to help us resolve the issue.
- type: textarea
id: version
attributes:
label: Version
description: Specify the version of the software that you use
placeholder: 0.1.0
value:
validations:
required: false

- type: textarea
id: expected
attributes:
label: Expected Behavior
description: What should have happened?
placeholder: What should have happened?
value:
validations:
required: true

- type: textarea
id: actual
attributes:
label: Actual Behavior
description: What actually happened?
placeholder: What actually happened?
value:
validations:
required: true

- type: textarea
id: context
attributes:
label: Additional Context
description: |
Are there anything atypical about your situation that we should know?
placeholder: Additional context...
value:
validations:
required: false

- type: markdown
attributes:
value: |
**Note:** If the submit button is disabled and you have filled out all required fields, please check that you did not forget a **Title** for the issue.
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Feature Request
description: Suggest a new feature or other enhancement.
labels: ["enhancement", "triage"]
body:
- type: markdown
attributes:
value: |
# Thank you for opening a feature request.
- type: textarea
id: version
attributes:
label: Version
description: Specify the version of the software that you use
placeholder: 0.1.0
value:
validations:
required: false

- type: textarea
id: use-case
attributes:
label: Use Cases
description: |
In order to properly evaluate a feature request, it is necessary to understand the use cases for it.
Please describe below the _end goal_ you are trying to achieve that has led you to request this feature.
Please keep this section focused on the problem and not on the suggested solution. We'll get to that in a moment, below!
placeholder:
value:
validations:
required: true

- type: textarea
id: proposal
attributes:
label: Proposal
description: |
If you have an idea for a way to address the problem via a change to our product features, please describe it below.
If you're not sure of some details, don't worry! When we evaluate the feature request we may suggest modifications as necessary to work within the design constraints of OpenTofu Core.
placeholder:
value:
validations:
required: false

- type: markdown
attributes:
value: |
**Note:** If the submit button is disabled and you have filled out all required fields, please check that you did not forget a **Title** for the issue.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly

- package-ecosystem: "npm"
directory: "/frontend/"
schedule:
interval: weekly
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Description

Describe in detail the changes you are proposing, and the rationale.

Link all GitHub issues fixed by this PR.
Make sure to first open an issue, get community approval and only then create Pull Request to resolve it.
All Pull Requests must have an issue attached to them

Resolves #
67 changes: 67 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: build

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: "minbzk/ai-act-beslisboom"

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
actions: read
steps:
- uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: pip3 install -r requirements.txt

- name: Build decision-tree.yaml
run: python script/inject_definitions_in_decision_tree.py

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
platforms: linux/amd64,linux/arm64
90 changes: 90 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: deploy

on:
workflow_run:
workflows: ["build"]
types:
- completed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Get GHCR package hash
id: get_package_hash
run: |
container_id=$(gh api --paginate -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /orgs/MinBZK/packages/container/ai-act-beslisboom/versions | jq -r '.[] | select(.metadata.container.tags | contains(["main"])) | .name')
echo "container_id=$container_id" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: check correct name
run: |
if [ -z "${{steps.get_package_hash.outputs.container_id}}" ]; then
echo "Variable is empty. Failing the workflow."
exit 1
fi
- uses: actions/checkout@v4
with:
repository: 'minbzk/ai-validation-infra'
ref: main
token: ${{ secrets.GH_PAT }}

- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Make changes to the file
run: |
sed -i 's/newTag: .*$/newTag: main@${{ steps.get_package_hash.outputs.container_id }}/g' apps/ai-act-beslisboom/sandbox/kustomization.yaml
sed -i 's|minbzk.github.io/version: .*$|minbzk.github.io/version: main|g' apps/ai-act-beslisboom/sandbox/kustomization.yaml
git add apps/ai-act-beslisboom/sandbox/kustomization.yaml
- name: show changes
run: git diff --staged

- name: push changes
run: |
git commit -m "Update ai-act-beslisboom sandbox tag ${{ steps.get_package_hash.outputs.container_id }}"
git push --force-with-lease
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
deploy_github_pages:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Configure Git Identity
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Install requirements.txt
run: pip install -r 'requirements.txt'

- name: Make a folder for the diagrams
run: mkdir mermaid_graphs

- name: Generate mermaid diagrams
run: ./script/gen_mermaid.py

- name: Commit to deployment branch
run: |
git fetch
git checkout --orphan deployment
git add mermaid_graphs
git commit -m 'Auto-generate mermaid diagrams'
git push --force origin deployment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 4fd865a

Please sign in to comment.