Skip to content

Commit 268e213

Browse files
committed
"Initial" commit to reset history
0 parents  commit 268e213

Some content is hidden

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

42 files changed

+4156
-0
lines changed

.ackrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--ignore-dir=.venv
2+
--ignore-dir=bin
3+
--ignore-dir=htmlcov
4+
--ignore-dir=log
5+
--ignore-dir=test/acceptance/cassettes

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @github/vuln-mgmt-eng

.github/dependabot.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
version: 2
3+
registries:
4+
ghcr: # Define access for a private registry
5+
type: docker-registry
6+
url: ghcr.io
7+
username: PAT
8+
password: ${{secrets.CONTAINER_BUILDER_TOKEN}}
9+
updates:
10+
- package-ecosystem: github-actions
11+
directory: "/"
12+
schedule:
13+
interval: "weekly"
14+
day: "sunday"
15+
time: "21:00"
16+
commit-message:
17+
prefix: "[actions] "
18+
include: "scope"
19+
groups:
20+
dev-dependencies:
21+
patterns:
22+
- "*" # A wildcard that matches all dependencies in the package
23+
- package-ecosystem: "docker"
24+
directory: "/"
25+
registries:
26+
- ghcr # Allow version updates for dependencies in this registry
27+
schedule:
28+
interval: "weekly"
29+
day: "sunday"
30+
time: "21:00"
31+
commit-message:
32+
prefix: "[docker] "
33+
include: "scope"
34+
groups:
35+
dev-dependencies:
36+
patterns:
37+
- "*" # A wildcard that matches all dependencies in the package
38+
- package-ecosystem: pip
39+
directory: "/"
40+
schedule:
41+
interval: "weekly"
42+
day: "sunday"
43+
time: "21:00"
44+
commit-message:
45+
prefix: "[pip] "
46+
prefix-development: "[pip][dev] "
47+
include: "scope"
48+
groups:
49+
dev-dependencies:
50+
patterns:
51+
- "*" # A wildcard that matches all dependencies in the package
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: ship-package
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-upload:
12+
runs-on: self-hosted
13+
permissions:
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Check for Changed Files
21+
id: changed-files
22+
uses: tj-actions/changed-files@635f118699dd888d737c15018cd30aff2e0274f8
23+
with:
24+
files: |
25+
annotated_logger
26+
Dockerfile
27+
pyproject.toml
28+
requirements.txt
29+
30+
- name: Log into registry
31+
if: steps.changed-files.outputs.any_changed == 'true'
32+
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
33+
with:
34+
registry: ghcr.io
35+
username: ${{ secrets.GHCR_USER }}
36+
password: ${{ secrets.GHCR_PW }}
37+
38+
- name: Build Package
39+
uses: ./ # Action defined in action.yaml in the root
40+
if: steps.changed-files.outputs.any_changed == 'true'
41+
42+
- name: Setup Octofactory config
43+
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad
44+
if: steps.changed-files.outputs.any_changed == 'true'
45+
env:
46+
JF_ENV_1: ${{ secrets.OCTOFACTORY_SERVER_CONFIG }}
47+
48+
- name: Upload to Octofactory
49+
if: steps.changed-files.outputs.any_changed == 'true'
50+
run: |
51+
jfrog rt u dist/ logger-decorator-pypi

.github/workflows/mutation.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Mutation Testing
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
checks: write
9+
10+
jobs:
11+
mutation-testing:
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.11'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install hatch
23+
hatch env create dev
24+
- name: Run mutation testing
25+
run: |
26+
set -e
27+
# Run pytest to get coverage so that mutmut can skip non covered lines
28+
hatch run dev:pytest
29+
hatch run dev:mutmut run --CI --no-progress
30+
hatch run dev:mutmut results
31+
hatch run dev:mutmut junitxml > junit.xml
32+
- name: Parse Results
33+
uses: mikepenz/action-junit-report@v4
34+
if: always()
35+
with:
36+
report_paths: junit.xml
37+
fail_on_failure: true
38+
require_passed_tests: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: package-quality-control
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
jobs:
12+
# Checks that version number has been updated
13+
package-quality-control:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Current PR Branch
17+
uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
- name: Check for Changed Files
21+
id: changed-files
22+
uses: tj-actions/changed-files@v44
23+
with:
24+
files: |
25+
pyproject.toml
26+
annotated_logger/__init__.py
27+
- name: Install hatch
28+
if: steps.changed-files.outputs.any_changed == 'true'
29+
run: python -m pip install hatch
30+
- name: Compare Versions
31+
if: steps.changed-files.outputs.any_changed == 'true'
32+
run: |
33+
export BRANCH_VERSION=$(hatch version)
34+
git checkout main
35+
export MAIN_VERSION=$(hatch version)
36+
37+
if [[ "$BRANCH_VERSION" == "$MAIN_VERSION" ]]; then echo "Please update package version number." && exit 1; fi

.github/workflows/pyright.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Pyright
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pyright:
8+
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.x'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install hatch
19+
hatch env create dev
20+
- run: echo "$(hatch env find dev)/bin" >> $GITHUB_PATH
21+
- name: Run pyright
22+
uses: jakebailey/[email protected]

.github/workflows/pytest.yaml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Pytest
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
9+
jobs:
10+
pytest:
11+
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
python-version: ["3.9", "3.10", "3.11", "pypy3.9", "pypy3.10"]
17+
exclude:
18+
- os: macos-latest
19+
python-version: "3.9"
20+
- os: windows-latest
21+
python-version: "3.9"
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install hatch
32+
hatch env create dev
33+
- name: Test with pytest
34+
run: |
35+
# Need relative files for the action to report, but it messes up mutmut
36+
echo "[run]" >> .coveragerc
37+
echo "relative_files = true" >> .coveragerc
38+
cat .coveragerc
39+
40+
hatch run dev:pytest
41+
env:
42+
COVERAGE_FILE: ".coverage.${{ matrix.os }}.${{ matrix.python-version }}"
43+
- name: Store coverage file
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
47+
path: .coverage.${{ matrix.os }}.${{ matrix.python-version }}
48+
49+
coverage:
50+
runs-on: ubuntu-latest
51+
needs: pytest
52+
permissions:
53+
pull-requests: write
54+
contents: write
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- uses: actions/download-artifact@v4
59+
id: download
60+
with:
61+
pattern: coverage-*
62+
merge-multiple: true
63+
- name: Re-add relative so the action is happy
64+
run: |
65+
echo "[run]" >> .coveragerc
66+
echo "relative_files = true" >> .coveragerc
67+
- name: Python Coverage Comment
68+
uses: py-cov-action/[email protected]
69+
with:
70+
GITHUB_TOKEN: ${{ github.token }}
71+
MERGE_COVERAGE_FILES: true

.github/workflows/ruff.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Ruff
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
ruff:
8+
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.x'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install hatch
19+
hatch env create dev
20+
- name: Lint with Ruff
21+
run: |
22+
hatch run dev:ruff --output-format=github .

0 commit comments

Comments
 (0)