mrok 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mrok-0.4.3/.github/actions/setup-python-env/action.yml +30 -0
- mrok-0.4.3/.github/workflows/assets/turing_team_pr_bot.png +0 -0
- mrok-0.4.3/.github/workflows/notify-pr-closed.yaml +41 -0
- mrok-0.4.3/.github/workflows/notify-pr-reviewed.yml +33 -0
- mrok-0.4.3/.github/workflows/pr-build-merge.yaml +147 -0
- mrok-0.4.3/.github/workflows/release.yml +112 -0
- mrok-0.4.3/.gitignore +192 -0
- mrok-0.4.3/.pre-commit-config.yaml +29 -0
- mrok-0.4.3/.python-version +1 -0
- mrok-0.4.3/LICENSE.txt +201 -0
- mrok-0.4.3/PKG-INFO +254 -0
- mrok-0.4.3/README.md +21 -0
- mrok-0.4.3/dev.Dockerfile +50 -0
- mrok-0.4.3/docker-compose.yaml +82 -0
- mrok-0.4.3/entrypoint.sh +5 -0
- mrok-0.4.3/mrok/__init__.py +6 -0
- mrok-0.4.3/mrok/agent/__init__.py +0 -0
- mrok-0.4.3/mrok/agent/devtools/__init__.py +0 -0
- mrok-0.4.3/mrok/agent/devtools/__main__.py +34 -0
- mrok-0.4.3/mrok/agent/devtools/inspector/__init__.py +0 -0
- mrok-0.4.3/mrok/agent/devtools/inspector/__main__.py +25 -0
- mrok-0.4.3/mrok/agent/devtools/inspector/app.py +556 -0
- mrok-0.4.3/mrok/agent/devtools/inspector/server.py +18 -0
- mrok-0.4.3/mrok/agent/sidecar/__init__.py +3 -0
- mrok-0.4.3/mrok/agent/sidecar/app.py +29 -0
- mrok-0.4.3/mrok/agent/sidecar/main.py +46 -0
- mrok-0.4.3/mrok/agent/ziticorn.py +38 -0
- mrok-0.4.3/mrok/cli/__init__.py +3 -0
- mrok-0.4.3/mrok/cli/commands/__init__.py +8 -0
- mrok-0.4.3/mrok/cli/commands/admin/__init__.py +12 -0
- mrok-0.4.3/mrok/cli/commands/admin/bootstrap.py +58 -0
- mrok-0.4.3/mrok/cli/commands/admin/list/__init__.py +8 -0
- mrok-0.4.3/mrok/cli/commands/admin/list/extensions.py +144 -0
- mrok-0.4.3/mrok/cli/commands/admin/list/instances.py +187 -0
- mrok-0.4.3/mrok/cli/commands/admin/register/__init__.py +8 -0
- mrok-0.4.3/mrok/cli/commands/admin/register/extensions.py +46 -0
- mrok-0.4.3/mrok/cli/commands/admin/register/instances.py +60 -0
- mrok-0.4.3/mrok/cli/commands/admin/unregister/__init__.py +8 -0
- mrok-0.4.3/mrok/cli/commands/admin/unregister/extensions.py +33 -0
- mrok-0.4.3/mrok/cli/commands/admin/unregister/instances.py +34 -0
- mrok-0.4.3/mrok/cli/commands/admin/utils.py +49 -0
- mrok-0.4.3/mrok/cli/commands/agent/__init__.py +8 -0
- mrok-0.4.3/mrok/cli/commands/agent/dev/__init__.py +7 -0
- mrok-0.4.3/mrok/cli/commands/agent/dev/console.py +25 -0
- mrok-0.4.3/mrok/cli/commands/agent/dev/web.py +37 -0
- mrok-0.4.3/mrok/cli/commands/agent/run/__init__.py +7 -0
- mrok-0.4.3/mrok/cli/commands/agent/run/asgi.py +68 -0
- mrok-0.4.3/mrok/cli/commands/agent/run/sidecar.py +70 -0
- mrok-0.4.3/mrok/cli/commands/agent/utils.py +5 -0
- mrok-0.4.3/mrok/cli/commands/controller/__init__.py +7 -0
- mrok-0.4.3/mrok/cli/commands/controller/openapi.py +47 -0
- mrok-0.4.3/mrok/cli/commands/controller/run.py +83 -0
- mrok-0.4.3/mrok/cli/commands/proxy/__init__.py +6 -0
- mrok-0.4.3/mrok/cli/commands/proxy/run.py +49 -0
- mrok-0.4.3/mrok/cli/main.py +97 -0
- mrok-0.4.3/mrok/cli/rich.py +18 -0
- mrok-0.4.3/mrok/cli/utils.py +5 -0
- mrok-0.4.3/mrok/conf.py +38 -0
- mrok-0.4.3/mrok/controller/__init__.py +0 -0
- mrok-0.4.3/mrok/controller/app.py +70 -0
- mrok-0.4.3/mrok/controller/auth.py +87 -0
- mrok-0.4.3/mrok/controller/dependencies/__init__.py +4 -0
- mrok-0.4.3/mrok/controller/dependencies/conf.py +7 -0
- mrok-0.4.3/mrok/controller/dependencies/ziti.py +27 -0
- mrok-0.4.3/mrok/controller/openapi/__init__.py +3 -0
- mrok-0.4.3/mrok/controller/openapi/examples.py +44 -0
- mrok-0.4.3/mrok/controller/openapi/utils.py +35 -0
- mrok-0.4.3/mrok/controller/pagination.py +79 -0
- mrok-0.4.3/mrok/controller/routes/__init__.py +0 -0
- mrok-0.4.3/mrok/controller/routes/extensions.py +310 -0
- mrok-0.4.3/mrok/controller/routes/instances.py +75 -0
- mrok-0.4.3/mrok/controller/schemas.py +79 -0
- mrok-0.4.3/mrok/datastructures.py +159 -0
- mrok-0.4.3/mrok/errors.py +2 -0
- mrok-0.4.3/mrok/http/__init__.py +0 -0
- mrok-0.4.3/mrok/http/config.py +62 -0
- mrok-0.4.3/mrok/http/constants.py +22 -0
- mrok-0.4.3/mrok/http/forwarder.py +338 -0
- mrok-0.4.3/mrok/http/lifespan.py +39 -0
- mrok-0.4.3/mrok/http/middlewares.py +143 -0
- mrok-0.4.3/mrok/http/protocol.py +11 -0
- mrok-0.4.3/mrok/http/server.py +14 -0
- mrok-0.4.3/mrok/http/types.py +43 -0
- mrok-0.4.3/mrok/http/utils.py +90 -0
- mrok-0.4.3/mrok/logging.py +98 -0
- mrok-0.4.3/mrok/master.py +272 -0
- mrok-0.4.3/mrok/metrics.py +139 -0
- mrok-0.4.3/mrok/proxy/__init__.py +3 -0
- mrok-0.4.3/mrok/proxy/app.py +64 -0
- mrok-0.4.3/mrok/proxy/main.py +58 -0
- mrok-0.4.3/mrok/proxy/ziti.py +103 -0
- mrok-0.4.3/mrok/ziti/__init__.py +15 -0
- mrok-0.4.3/mrok/ziti/api.py +484 -0
- mrok-0.4.3/mrok/ziti/bootstrap.py +76 -0
- mrok-0.4.3/mrok/ziti/constants.py +9 -0
- mrok-0.4.3/mrok/ziti/errors.py +25 -0
- mrok-0.4.3/mrok/ziti/identities.py +199 -0
- mrok-0.4.3/mrok/ziti/pki.py +57 -0
- mrok-0.4.3/mrok/ziti/services.py +87 -0
- mrok-0.4.3/prod.Dockerfile +50 -0
- mrok-0.4.3/pyproject.toml +135 -0
- mrok-0.4.3/scripts/ziti.sh +62 -0
- mrok-0.4.3/settings.yaml +27 -0
- mrok-0.4.3/snapshot_report.html +807 -0
- mrok-0.4.3/sonar-project.properties +14 -0
- mrok-0.4.3/tests/__init__.py +0 -0
- mrok-0.4.3/tests/agent/__init__.py +0 -0
- mrok-0.4.3/tests/agent/sidecar/__init__.py +0 -0
- mrok-0.4.3/tests/agent/sidecar/__snapshots__/test_inspector/test_inspector_app.svg +200 -0
- mrok-0.4.3/tests/agent/sidecar/__snapshots__/test_inspector/test_inspector_app_empty_card.svg +208 -0
- mrok-0.4.3/tests/agent/sidecar/__snapshots__/test_inspector/test_inspector_app_filed_store_connection.svg +201 -0
- mrok-0.4.3/tests/agent/sidecar/__snapshots__/test_inspector/test_inspector_app_open_card.svg +211 -0
- mrok-0.4.3/tests/agent/sidecar/test_app.py +114 -0
- mrok-0.4.3/tests/agent/sidecar/test_main.py +46 -0
- mrok-0.4.3/tests/agent/test_ziticorn.py +44 -0
- mrok-0.4.3/tests/cli/__init__.py +0 -0
- mrok-0.4.3/tests/cli/admin/__init__.py +0 -0
- mrok-0.4.3/tests/cli/admin/test_bootstrap.py +80 -0
- mrok-0.4.3/tests/cli/admin/test_list.py +304 -0
- mrok-0.4.3/tests/cli/admin/test_register.py +205 -0
- mrok-0.4.3/tests/cli/admin/test_unregister.py +157 -0
- mrok-0.4.3/tests/cli/admin/test_utils.py +25 -0
- mrok-0.4.3/tests/cli/agent/__init__.py +0 -0
- mrok-0.4.3/tests/cli/agent/test_run.py +62 -0
- mrok-0.4.3/tests/cli/controller/__init__.py +0 -0
- mrok-0.4.3/tests/cli/controller/test_openapi.py +39 -0
- mrok-0.4.3/tests/cli/controller/test_run.py +59 -0
- mrok-0.4.3/tests/cli/proxy/__init__.py +0 -0
- mrok-0.4.3/tests/cli/proxy/test_run.py +47 -0
- mrok-0.4.3/tests/cli/test_main.py +35 -0
- mrok-0.4.3/tests/conftest.py +233 -0
- mrok-0.4.3/tests/controller/__init__.py +0 -0
- mrok-0.4.3/tests/controller/test_auth.py +171 -0
- mrok-0.4.3/tests/controller/test_extensions.py +550 -0
- mrok-0.4.3/tests/controller/test_instances.py +165 -0
- mrok-0.4.3/tests/controller/test_openapi.py +22 -0
- mrok-0.4.3/tests/http/__init__.py +0 -0
- mrok-0.4.3/tests/http/test_config.py +76 -0
- mrok-0.4.3/tests/http/test_forwarder.py +675 -0
- mrok-0.4.3/tests/http/test_lifespan.py +11 -0
- mrok-0.4.3/tests/http/test_master.py +166 -0
- mrok-0.4.3/tests/http/test_protocol.py +12 -0
- mrok-0.4.3/tests/http/test_server.py +44 -0
- mrok-0.4.3/tests/proxy/__init__.py +0 -0
- mrok-0.4.3/tests/proxy/test_app.py +114 -0
- mrok-0.4.3/tests/proxy/test_ziti.py +528 -0
- mrok-0.4.3/tests/proxy/test_ziti_branches.py +154 -0
- mrok-0.4.3/tests/types.py +16 -0
- mrok-0.4.3/tests/ziti/__init__.py +0 -0
- mrok-0.4.3/tests/ziti/test_api.py +591 -0
- mrok-0.4.3/tests/ziti/test_bootstrap.py +182 -0
- mrok-0.4.3/tests/ziti/test_identities.py +558 -0
- mrok-0.4.3/tests/ziti/test_pki.py +63 -0
- mrok-0.4.3/tests/ziti/test_services.py +326 -0
- mrok-0.4.3/uv.lock +3033 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: "Setup Python Environment"
|
|
2
|
+
description: "Set up Python environment for the given Python version"
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
python-version:
|
|
6
|
+
description: "Python version to use"
|
|
7
|
+
required: true
|
|
8
|
+
default: "3.12"
|
|
9
|
+
uv-version:
|
|
10
|
+
description: "uv version to use"
|
|
11
|
+
required: true
|
|
12
|
+
default: "0.6.2"
|
|
13
|
+
|
|
14
|
+
runs:
|
|
15
|
+
using: "composite"
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ inputs.python-version }}
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v2
|
|
23
|
+
with:
|
|
24
|
+
version: ${{ inputs.uv-version }}
|
|
25
|
+
enable-cache: 'true'
|
|
26
|
+
cache-suffix: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install Python dependencies
|
|
29
|
+
run: uv sync --frozen
|
|
30
|
+
shell: bash
|
|
Binary file
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Notify Teams on PR
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [closed]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
notify-teams:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
with:
|
|
13
|
+
fetch-depth: 0
|
|
14
|
+
- name: Compute added/removed lines for notification
|
|
15
|
+
id: diff
|
|
16
|
+
run: |
|
|
17
|
+
PR_DATA=$(gh pr view "${{ github.event.pull_request.number }}" --json additions,deletions -q '.')
|
|
18
|
+
ADDITIONS=$(echo "$PR_DATA" | jq '.additions')
|
|
19
|
+
DELETIONS=$(echo "$PR_DATA" | jq '.deletions')
|
|
20
|
+
echo "additions=$ADDITIONS" >> $GITHUB_OUTPUT
|
|
21
|
+
echo "deletions=$DELETIONS" >> $GITHUB_OUTPUT
|
|
22
|
+
env:
|
|
23
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
24
|
+
- name: Notify Microsoft Teams
|
|
25
|
+
uses: softwareone-platform/notify-pr-teams-action@v4
|
|
26
|
+
with:
|
|
27
|
+
webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }}
|
|
28
|
+
bot_image_url: https://raw.githubusercontent.com/softwareone-platform/mrok/main/.github/workflows/assets/turing_team_pr_bot.png
|
|
29
|
+
repo: ${{ github.repository }}
|
|
30
|
+
pr_url: ${{ github.event.pull_request.html_url }}
|
|
31
|
+
pr_title: ${{ github.event.pull_request.title }}
|
|
32
|
+
pr_author: ${{ github.event.pull_request.user.login }}
|
|
33
|
+
head_ref: ${{ github.event.pull_request.head.ref }}
|
|
34
|
+
base_ref: ${{ github.event.pull_request.base.ref }}
|
|
35
|
+
commits: ${{ github.event.pull_request.commits }}
|
|
36
|
+
changed_files: ${{ github.event.pull_request.changed_files }}
|
|
37
|
+
additions: ${{ steps.diff.outputs.additions }}
|
|
38
|
+
deletions: ${{ steps.diff.outputs.deletions }}
|
|
39
|
+
pr_number: ${{ github.event.pull_request.number }}
|
|
40
|
+
pr_status: ${{ github.event.pull_request.state }}
|
|
41
|
+
is_merged: ${{ github.event.pull_request.merged }}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: PR Review Notification
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_review:
|
|
5
|
+
types: [submitted, edited, dismissed]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
notify-teams:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- name: Get Review Comments Count
|
|
12
|
+
id: comments
|
|
13
|
+
run: |
|
|
14
|
+
COMMENTS_COUNT=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
15
|
+
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews/${{ github.event.review.id }}/comments" | jq 'length')
|
|
16
|
+
echo "count=$COMMENTS_COUNT" >> $GITHUB_OUTPUT
|
|
17
|
+
|
|
18
|
+
- name: Notify Teams
|
|
19
|
+
uses: softwareone-platform/notify-pr-reviews-teams-action@v2
|
|
20
|
+
with:
|
|
21
|
+
webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }}
|
|
22
|
+
bot_image_url: https://raw.githubusercontent.com/softwareone-platform/mrok/main/.github/workflows/assets/turing_team_pr_bot.png
|
|
23
|
+
repo: ${{ github.repository }}
|
|
24
|
+
pr_number: ${{ github.event.pull_request.number }}
|
|
25
|
+
pr_title: ${{ github.event.pull_request.title }}
|
|
26
|
+
reviewer: ${{ github.event.review.user.login }}
|
|
27
|
+
review_state: ${{ github.event.review.state }}
|
|
28
|
+
global_comment: ${{ github.event.review.body || 'No comment provided' }}
|
|
29
|
+
comments_count: ${{ steps.comments.outputs.count }}
|
|
30
|
+
head_ref: ${{ github.event.pull_request.head.ref }}
|
|
31
|
+
base_ref: ${{ github.event.pull_request.base.ref }}
|
|
32
|
+
event: ${{ github.event.action }}
|
|
33
|
+
pr_url: ${{ github.event.pull_request.html_url }}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
name: PR build and merge
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened]
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
9
|
+
- release/*
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
timeout-minutes: 10
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
python-version: [ "3.12", "3.13", "3.14" ]
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Install libprotobuf-c1
|
|
28
|
+
run: sudo apt install -y libprotobuf-c1
|
|
29
|
+
|
|
30
|
+
- name: Install uv and set up its cache
|
|
31
|
+
uses: astral-sh/setup-uv@v4
|
|
32
|
+
with:
|
|
33
|
+
enable-cache: true
|
|
34
|
+
cache-dependency-glob: "uv.lock"
|
|
35
|
+
|
|
36
|
+
- name: Install Python ${{ matrix.python-version }}
|
|
37
|
+
uses: actions/setup-python@v5
|
|
38
|
+
with:
|
|
39
|
+
python-version: ${{ matrix.python-version }}
|
|
40
|
+
|
|
41
|
+
- name: Install the project dependencies
|
|
42
|
+
run: uv sync --all-extras --dev
|
|
43
|
+
|
|
44
|
+
- name: Run formatting checks
|
|
45
|
+
run: uv run ruff format --check --diff .
|
|
46
|
+
|
|
47
|
+
- name: Run linting
|
|
48
|
+
run: uv run ruff check .
|
|
49
|
+
|
|
50
|
+
- name: Run security checks
|
|
51
|
+
run: uv run bandit -c pyproject.toml -r . -f json -o bandit.json
|
|
52
|
+
|
|
53
|
+
- name: Run tests
|
|
54
|
+
run: uv run pytest
|
|
55
|
+
|
|
56
|
+
build:
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
timeout-minutes: 10
|
|
59
|
+
needs: test
|
|
60
|
+
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
with:
|
|
64
|
+
fetch-depth: 0
|
|
65
|
+
|
|
66
|
+
- name: Install libprotobuf-c1
|
|
67
|
+
run: sudo apt install -y libprotobuf-c1
|
|
68
|
+
|
|
69
|
+
- name: Install uv and set up its cache
|
|
70
|
+
uses: astral-sh/setup-uv@v4
|
|
71
|
+
with:
|
|
72
|
+
enable-cache: true
|
|
73
|
+
cache-dependency-glob: "uv.lock"
|
|
74
|
+
|
|
75
|
+
- name: Install Python
|
|
76
|
+
uses: actions/setup-python@v5
|
|
77
|
+
with:
|
|
78
|
+
python-version-file: ".python-version"
|
|
79
|
+
|
|
80
|
+
- name: Install the project dependencies
|
|
81
|
+
run: uv sync --all-extras --dev
|
|
82
|
+
|
|
83
|
+
- name: Run tests
|
|
84
|
+
run: uv run pytest
|
|
85
|
+
|
|
86
|
+
- name: Compute added/removed lines for notification
|
|
87
|
+
if: ${{ github.event_name == 'pull_request' }}
|
|
88
|
+
id: diff
|
|
89
|
+
run: |
|
|
90
|
+
PR_DATA=$(gh pr view "${{ github.event.pull_request.number }}" --json additions,deletions -q '.')
|
|
91
|
+
ADDITIONS=$(echo "$PR_DATA" | jq '.additions')
|
|
92
|
+
DELETIONS=$(echo "$PR_DATA" | jq '.deletions')
|
|
93
|
+
echo "additions=$ADDITIONS" >> $GITHUB_OUTPUT
|
|
94
|
+
echo "deletions=$DELETIONS" >> $GITHUB_OUTPUT
|
|
95
|
+
env:
|
|
96
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
97
|
+
|
|
98
|
+
- name: Notify Microsoft Teams
|
|
99
|
+
if: ${{ github.event_name == 'pull_request' }}
|
|
100
|
+
uses: softwareone-platform/notify-pr-teams-action@v4
|
|
101
|
+
with:
|
|
102
|
+
webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }}
|
|
103
|
+
bot_image_url: https://raw.githubusercontent.com/softwareone-platform/mrok/main/.github/workflows/assets/turing_team_pr_bot.png
|
|
104
|
+
repo: ${{ github.repository }}
|
|
105
|
+
pr_url: ${{ github.event.pull_request.html_url }}
|
|
106
|
+
pr_title: ${{ github.event.pull_request.title }}
|
|
107
|
+
pr_author: ${{ github.event.pull_request.user.login }}
|
|
108
|
+
head_ref: ${{ github.event.pull_request.head.ref }}
|
|
109
|
+
base_ref: ${{ github.event.pull_request.base.ref }}
|
|
110
|
+
commits: ${{ github.event.pull_request.commits }}
|
|
111
|
+
changed_files: ${{ github.event.pull_request.changed_files }}
|
|
112
|
+
additions: ${{ steps.diff.outputs.additions }}
|
|
113
|
+
deletions: ${{ steps.diff.outputs.deletions }}
|
|
114
|
+
pr_number: ${{ github.event.pull_request.number }}
|
|
115
|
+
pr_status: ${{ github.event.pull_request.state }}
|
|
116
|
+
is_merged: ${{ github.event.pull_request.merged }}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
- name: SonarQube Scan
|
|
120
|
+
uses: sonarsource/sonarqube-scan-action@v6
|
|
121
|
+
env:
|
|
122
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
123
|
+
|
|
124
|
+
- name: SonarQube Quality Gate check
|
|
125
|
+
id: sonarqube-quality-gate-check
|
|
126
|
+
uses: sonarsource/sonarqube-quality-gate-action@master
|
|
127
|
+
with:
|
|
128
|
+
pollingTimeoutSec: 600
|
|
129
|
+
env:
|
|
130
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
131
|
+
|
|
132
|
+
- name: Save code coverage report in the artefacts
|
|
133
|
+
uses: actions/upload-artifact@v4
|
|
134
|
+
with:
|
|
135
|
+
name: coverage-report
|
|
136
|
+
path: htmlcov
|
|
137
|
+
retention-days: 10
|
|
138
|
+
|
|
139
|
+
- name: Generate openapi.json
|
|
140
|
+
run: uv run mrok controller openapi -f json -o openapi.json
|
|
141
|
+
|
|
142
|
+
- name: Save openapi.json the artefacts
|
|
143
|
+
uses: actions/upload-artifact@v4
|
|
144
|
+
with:
|
|
145
|
+
name: openapi-spec
|
|
146
|
+
path: openapi.json
|
|
147
|
+
retention-days: 10
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
id-token: write # for OIDC
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
docker-image:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 10
|
|
15
|
+
needs: [ set-version ]
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v5
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Download updated pyproject.toml
|
|
23
|
+
uses: actions/download-artifact@v4
|
|
24
|
+
with:
|
|
25
|
+
name: pyproject-toml
|
|
26
|
+
|
|
27
|
+
- name: 'Get the version'
|
|
28
|
+
id: get_version
|
|
29
|
+
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"
|
|
30
|
+
|
|
31
|
+
- name: 'Login to ACR'
|
|
32
|
+
uses: docker/login-action@v3
|
|
33
|
+
with:
|
|
34
|
+
registry: ${{ vars.REGISTRY_LOGIN_SERVER }}
|
|
35
|
+
username: ${{ vars.REGISTRY_USERNAME }}
|
|
36
|
+
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
37
|
+
- name: Docker meta
|
|
38
|
+
id: meta
|
|
39
|
+
uses: docker/metadata-action@v4
|
|
40
|
+
with:
|
|
41
|
+
images: ${{ vars.REGISTRY_LOGIN_SERVER }}/gha/mrok
|
|
42
|
+
tags: |
|
|
43
|
+
type=semver,pattern={{major}}.{{minor}}.{{patch}},value=${{ steps.get_version.outputs.VERSION }}
|
|
44
|
+
type=semver,pattern={{major}}.{{minor}},value=${{ steps.get_version.outputs.VERSION }}
|
|
45
|
+
type=semver,pattern={{major}},value=${{ steps.get_version.outputs.VERSION }}
|
|
46
|
+
flavor: |
|
|
47
|
+
latest=false
|
|
48
|
+
- name: Build and push docker image
|
|
49
|
+
id: docker_build
|
|
50
|
+
uses: docker/build-push-action@v3
|
|
51
|
+
with:
|
|
52
|
+
context: .
|
|
53
|
+
file: prod.Dockerfile
|
|
54
|
+
push: true
|
|
55
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
56
|
+
- name: Docker image digest
|
|
57
|
+
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
58
|
+
|
|
59
|
+
dtrack:
|
|
60
|
+
uses: softwareone-platform/ops-template/.github/workflows/dependency-track-python-uv.yml@v1
|
|
61
|
+
with:
|
|
62
|
+
projectName: 'mrok'
|
|
63
|
+
secrets:
|
|
64
|
+
DEPENDENCYTRACK_APIKEY: ${{ secrets.DEPENDENCYTRACK_APIKEY }}
|
|
65
|
+
|
|
66
|
+
set-version:
|
|
67
|
+
runs-on: ubuntu-24.04
|
|
68
|
+
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Export tag
|
|
73
|
+
id: vars
|
|
74
|
+
run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
|
|
75
|
+
if: ${{ github.event_name == 'release' }}
|
|
76
|
+
|
|
77
|
+
- name: Update project version
|
|
78
|
+
run: |
|
|
79
|
+
sed -i "s/^version = \".*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml
|
|
80
|
+
env:
|
|
81
|
+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
|
|
82
|
+
if: ${{ github.event_name == 'release' }}
|
|
83
|
+
|
|
84
|
+
- name: Upload updated pyproject.toml
|
|
85
|
+
uses: actions/upload-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: pyproject-toml
|
|
88
|
+
path: pyproject.toml
|
|
89
|
+
|
|
90
|
+
publish:
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
|
|
93
|
+
needs: [ set-version ]
|
|
94
|
+
steps:
|
|
95
|
+
- name: Check out
|
|
96
|
+
uses: actions/checkout@v4
|
|
97
|
+
|
|
98
|
+
- name: Set up the environment
|
|
99
|
+
uses: ./.github/actions/setup-python-env
|
|
100
|
+
|
|
101
|
+
- name: Download updated pyproject.toml
|
|
102
|
+
uses: actions/download-artifact@v4
|
|
103
|
+
with:
|
|
104
|
+
name: pyproject-toml
|
|
105
|
+
|
|
106
|
+
- name: Build package
|
|
107
|
+
run: uv build
|
|
108
|
+
|
|
109
|
+
- name: Publish to PyPI
|
|
110
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
111
|
+
with:
|
|
112
|
+
repository-url: https://upload.pypi.org/legacy/
|
mrok-0.4.3/.gitignore
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
charges_file_folder
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
#Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# poetry
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
103
|
+
#poetry.lock
|
|
104
|
+
|
|
105
|
+
# pdm
|
|
106
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
107
|
+
#pdm.lock
|
|
108
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
109
|
+
# in version control.
|
|
110
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
111
|
+
.pdm.toml
|
|
112
|
+
.pdm-python
|
|
113
|
+
.pdm-build/
|
|
114
|
+
|
|
115
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
116
|
+
__pypackages__/
|
|
117
|
+
|
|
118
|
+
# Celery stuff
|
|
119
|
+
celerybeat-schedule
|
|
120
|
+
celerybeat.pid
|
|
121
|
+
|
|
122
|
+
# SageMath parsed files
|
|
123
|
+
*.sage.py
|
|
124
|
+
|
|
125
|
+
# Environments
|
|
126
|
+
.env
|
|
127
|
+
.env.*
|
|
128
|
+
.venv
|
|
129
|
+
env/
|
|
130
|
+
venv/
|
|
131
|
+
ENV/
|
|
132
|
+
env.bak/
|
|
133
|
+
venv.bak/
|
|
134
|
+
|
|
135
|
+
# Spyder project settings
|
|
136
|
+
.spyderproject
|
|
137
|
+
.spyproject
|
|
138
|
+
|
|
139
|
+
# Rope project settings
|
|
140
|
+
.ropeproject
|
|
141
|
+
|
|
142
|
+
# mkdocs documentation
|
|
143
|
+
/site
|
|
144
|
+
|
|
145
|
+
# mypy
|
|
146
|
+
.mypy_cache/
|
|
147
|
+
.dmypy.json
|
|
148
|
+
dmypy.json
|
|
149
|
+
|
|
150
|
+
# Pyre type checker
|
|
151
|
+
.pyre/
|
|
152
|
+
|
|
153
|
+
# pytype static type analyzer
|
|
154
|
+
.pytype/
|
|
155
|
+
|
|
156
|
+
# Cython debug symbols
|
|
157
|
+
cython_debug/
|
|
158
|
+
|
|
159
|
+
# unified cache dir
|
|
160
|
+
.cache/
|
|
161
|
+
|
|
162
|
+
# bandit report
|
|
163
|
+
bandit.json
|
|
164
|
+
|
|
165
|
+
# PyCharm
|
|
166
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
167
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
168
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
169
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
170
|
+
.idea/
|
|
171
|
+
|
|
172
|
+
# vscode
|
|
173
|
+
.devcontainer/
|
|
174
|
+
|
|
175
|
+
# Postgres data
|
|
176
|
+
pg_data/
|
|
177
|
+
test_pg_data/
|
|
178
|
+
|
|
179
|
+
# Default OpenAPI spec file
|
|
180
|
+
ffc_operations_openapi_spec.yml
|
|
181
|
+
|
|
182
|
+
# local dev tools configs
|
|
183
|
+
taplo.toml
|
|
184
|
+
|
|
185
|
+
# MacOS
|
|
186
|
+
.DS_Store
|
|
187
|
+
|
|
188
|
+
.identity
|
|
189
|
+
.ziti-home
|
|
190
|
+
|
|
191
|
+
# Ignore dynaconf secret files
|
|
192
|
+
.secrets.*
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
default_language_version:
|
|
2
|
+
python: python3.12
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v5.0.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: check-added-large-files
|
|
8
|
+
- id: check-toml
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
args:
|
|
11
|
+
- --unsafe
|
|
12
|
+
- id: end-of-file-fixer
|
|
13
|
+
- id: trailing-whitespace
|
|
14
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
15
|
+
rev: v0.10.0
|
|
16
|
+
hooks:
|
|
17
|
+
- id: ruff
|
|
18
|
+
args:
|
|
19
|
+
- --fix
|
|
20
|
+
- id: ruff-format
|
|
21
|
+
- repo: https://github.com/PyCQA/bandit
|
|
22
|
+
rev: "1.8.0"
|
|
23
|
+
hooks:
|
|
24
|
+
- id: bandit
|
|
25
|
+
args:
|
|
26
|
+
- -c
|
|
27
|
+
- pyproject.toml
|
|
28
|
+
- -r
|
|
29
|
+
- .
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|