Skip to content

Commit ea49573

Browse files
committed
feat: initial metric client implementation
1 parent 4c0cf41 commit ea49573

46 files changed

Lines changed: 1776 additions & 42 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "mgo-metric-service",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.11",
4+
"containerEnv": {
5+
"PYTHONUNBUFFERED": "1",
6+
"UV_CACHE_DIR": "/home/vscode/.cache/uv",
7+
"PYTHONDONTWRITEBYTECODE": "1",
8+
"UV_LINK_MODE": "copy",
9+
"UV_PROJECT_ENVIRONMENT": "/home/vscode/.venv",
10+
"UV_COMPILE_BYTECODE": "1"
11+
},
12+
"features": {
13+
"ghcr.io/va-h/devcontainers-features/uv:1": {
14+
"shellAutocompletion": true
15+
},
16+
"ghcr.io/jsburckhardt/devcontainer-features/ruff:1": {}
17+
},
18+
"customizations": {
19+
"vscode": {
20+
"extensions": [
21+
"ms-python.python",
22+
"ms-python.vscode-pylance",
23+
"charliermarsh.ruff",
24+
"EditorConfig.EditorConfig",
25+
"redhat.vscode-yaml",
26+
"esbenp.prettier-vscode"
27+
],
28+
"settings": {
29+
"[python]": {
30+
"editor.defaultFormatter": "charliermarsh.ruff",
31+
"editor.formatOnSave": true
32+
},
33+
"[markdown]": {
34+
"editor.defaultFormatter": "esbenp.prettier-vscode",
35+
"editor.formatOnSave": true
36+
},
37+
"editor.codeActionsOnSave": {
38+
"source.fixAll.ruff": true,
39+
"source.organizeImports.ruff": true
40+
},
41+
"python-envs.workspaceSearchPaths": [
42+
"/home/vscode/.venv"
43+
]
44+
},
45+
"mypy-type-checker.importStrategy": "fromEnvironment"
46+
}
47+
},
48+
"postCreateCommand": "uv sync --locked",
49+
"postStartCommand": "uv run pre-commit install",
50+
"remoteUser": "vscode",
51+
"containerUser": "vscode"
52+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
ci:
13-
name: Checkout, SonarQube scan
13+
name: CI Checks (Code Quality, Static Analysis and Security Scan)
1414
runs-on: ubuntu-24.04
1515

1616
steps:
@@ -19,9 +19,14 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22-
- name: Run SonarQube scan
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v7
24+
25+
- name: Code Quality Checks
26+
run: make check
27+
28+
- name: Static Analysis and Security Scan
2329
uses: minvws/action-sonarqube@v1
2430
with:
2531
sonar-token: ${{ secrets.SONAR_TOKEN }}
2632
allow-run-on-dependabot: 'true'
27-

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__pycache__/
2+
.coverage
3+
coverage.xml

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/uv-pre-commit
3+
rev: 0.11.14
4+
hooks:
5+
- id: uv-lock
6+
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.15.13
9+
hooks:
10+
- id: ruff-check
11+
args: [--fix]
12+
- id: ruff-format
13+

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 80,
3+
"proseWrap": "always"
4+
}

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sonarlint.connectedMode.project": {
3+
"connectionId": "vws",
4+
"projectKey": "minvws_nl-mgo-metric-service"
5+
}
6+
}

CONTRIBUTING.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
11
# Contributing to MGO Metric Service
22

3-
Thank you for considering contributing to the MGO Metric Service! We welcome contributions from everyone. Below are some guidelines to help you get started.
3+
Thank you for considering contributing to the MGO Metric Service! We welcome
4+
contributions from everyone. Below are some guidelines to help you get started.
45

56
## How to Report Issues
67

7-
If you encounter any issues or have suggestions for improvements, please feel free to open an issue on the GitHub repository. When reporting an issue, please include as much detail as possible, including steps to reproduce the issue and any relevant logs or screenshots.
8+
If you encounter any issues or have suggestions for improvements, please feel
9+
free to open an issue on the GitHub repository. When reporting an issue, please
10+
include as much detail as possible, including steps to reproduce the issue and
11+
any relevant logs or screenshots.
812

913
## How to Submit Pull Requests
1014

1115
1. Fork the repository and create your branch from `main`.
1216
2. If you have added code that should be tested, add tests.
1317
3. Ensure the test suite passes (`make test`).
1418
4. Make sure your code passes the linters and analyzers (`make check`).
15-
5. Submit a pull request to the `main` branch with a clear description of your changes.
19+
5. Submit a pull request to the `main` branch with a clear description of your
20+
changes.
1621

1722
## Coding Standards
1823

1924
- Follow the existing coding style.
20-
- Write clear and concise commit messages following the [Conventional Commits specification](https://www.conventionalcommits.org/).
25+
- Write clear and concise commit messages following the
26+
[Conventional Commits specification](https://www.conventionalcommits.org/).
2127
- Include comments in your code where necessary.
2228

2329
## Code of Conduct
2430

25-
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms.
31+
Please note that this project is released with a
32+
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this
33+
project, you agree to abide by its terms.
2634

2735
## License
2836

29-
By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
37+
By contributing to this project, you agree that your contributions will be
38+
licensed under the same license as the project.
3039

3140
Thank you for your contributions!

LICENSES.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1-
The Dutch government reserves all rights to the works that belong to the Dutch Government published on this GitHub account. Nevertheless, reuse is permitted under the following conditions.
1+
The Dutch government reserves all rights to the works that belong to the Dutch
2+
Government published on this GitHub account. Nevertheless, reuse is permitted
3+
under the following conditions.
24

3-
First - The work that is created in the Covid19 context, such as the notification app, is available under the EUPL/1.2 license; and any outside contributions to it are under an individual Committer License Agreement (iCLA) that references this license explicitly.
5+
First - The work that is created in the Covid19 context, such as the
6+
notification app, is available under the EUPL/1.2 license; and any outside
7+
contributions to it are under an individual Committer License Agreement (iCLA)
8+
that references this license explicitly.
49

5-
However - that does not mean that all (derived) work is solely under that single license. For example - where appropriate certain (open source) modules may be required and included. These will remain under their original Copyright and License (though some may be released under the EUPL/1.2 if they are unsuitable to be contributed back upstream).
10+
However - that does not mean that all (derived) work is solely under that single
11+
license. For example - where appropriate certain (open source) modules may be
12+
required and included. These will remain under their original Copyright and
13+
License (though some may be released under the EUPL/1.2 if they are unsuitable
14+
to be contributed back upstream).
615

7-
Secondly – The documents of this project that are held in the directory ‘documentation’ are released under the CC0 license (see www.rijksoverheid.nl/copyright). If you use (parts) of these documents, you are not obliged to quote the source, but you must not imply that the Dutch government endorses the derivative work.
16+
Secondly – The documents of this project that are held in the directory
17+
‘documentation’ are released under the CC0 license (see
18+
www.rijksoverheid.nl/copyright). If you use (parts) of these documents, you are
19+
not obliged to quote the source, but you must not imply that the Dutch
20+
government endorses the derivative work.
821

922
The CC0 does not apply to:
1023

1124
- Patent rights and trademark rights.
1225
- Third-party rights.
1326

14-
Finally – The EUPL 1.2 and the CC0 do not apply to photos, videos, infographics or other forms of images. It is therefore not permitted to reuse or transfer the image, unless the image explicitly states that it is permitted or you have received written permission of the Dutch Government. Such permission will not be withheld on unreasonable grounds.
27+
Finally – The EUPL 1.2 and the CC0 do not apply to photos, videos, infographics
28+
or other forms of images. It is therefore not permitted to reuse or transfer the
29+
image, unless the image explicitly states that it is permitted or you have
30+
received written permission of the Dutch Government. Such permission will not be
31+
withheld on unreasonable grounds.
1532

16-
--
17-
v1.01 / 2020-5-26
33+
-- v1.01 / 2020-5-26

0 commit comments

Comments
 (0)