Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e6c1604
Feat(validation): Add support for prefix_keys
ClausHolbechArista May 22, 2026
59e2349
improve code readability (i hope)
ClausHolbechArista May 22, 2026
ca99e0b
CI: pre-commit autoupdate (#138)
pre-commit-ci[bot] May 26, 2026
a08252c
CI: Enable workspace lint rules on every crate (#135)
gmuloc May 28, 2026
442fa13
Feat(rust): Add support for dynamic key overrides (#133)
ClausHolbechArista Jun 1, 2026
697cd3e
CI: pre-commit autoupdate (#141)
pre-commit-ci[bot] Jun 1, 2026
9c5c3aa
CI: Use our own pre-commit hooks repo (#132)
ClausHolbechArista Jun 3, 2026
b8fb03e
Bump: Release v0.0.6 (#142)
ClausHolbechArista Jun 3, 2026
f045985
Bump(rust): Bump base64 from 0.21.7 to 0.22.1 (#139)
dependabot[bot] Jun 3, 2026
6dfe0b9
Bump(rust): Bump criterion from 0.7.0 to 0.8.2 (#130)
dependabot[bot] Jun 3, 2026
d2cf4a5
Bump(rust): Bump pyo3-log from 0.13.2 to 0.13.3 (#129)
dependabot[bot] Jun 3, 2026
c3fb775
Bump(rust): Bump serde_with from 3.16.1 to 3.20.0 (#128)
dependabot[bot] Jun 3, 2026
53147bd
CI(requirements): Bump coverage from 7.14.0 to 7.14.1 in the dev grou…
dependabot[bot] Jun 3, 2026
e2e5812
CI: add zizmor audit (#140)
gmuloc Jun 3, 2026
de482ec
CI: Bump codecov/codecov-action from cddd853df119a48c5be31a973f8cd97e…
dependabot[bot] Jun 3, 2026
7d29c18
Bump(rust): Bump serde_json from 1.0.149 to 1.0.150 (#151)
dependabot[bot] Jun 3, 2026
b0115c2
CI: Bump pypa/gh-action-pypi-publish from 6733eb7d741f0b11ec6a39b5854…
dependabot[bot] Jun 3, 2026
f4c46a2
CI: Bump eps1lon/actions-label-merge-conflict from 2.1.0 to 3.1.0 (#146)
dependabot[bot] Jun 3, 2026
0264006
Bump(rust): Bump pyo3-build-config from 0.27.2 to 0.28.3 (#150)
dependabot[bot] Jun 3, 2026
c0f9851
Bump(rust): Bump des from 0.8.1 to 0.9.0 (#116)
dependabot[bot] Jun 8, 2026
928b6fb
CI: pre-commit autoupdate (#154)
pre-commit-ci[bot] Jun 9, 2026
bc2b723
CI: Bump codecov action to v7.0.0 (#155)
gmuloc Jun 9, 2026
fc1fc45
refactor: prepare dict module in avdschema
ClausHolbechArista Jun 11, 2026
0b90d72
Feat(rust): Add support for prefix-keys
ClausHolbechArista Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 23 additions & 28 deletions .github/actions/rn-pr-labeler-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,28 @@ inputs:
runs:
using: "composite"
steps:
- name: 'Looking up existing "rn:" label'
- name: Label PR for release notes
env:
AUTO_CREATE_LABEL: ${{ inputs.auto_create_label }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "OLD_LABEL=$(gh pr view ${{ github.event.pull_request.number }} --json labels -q .labels[].name | grep 'rn: ')" >> $GITHUB_ENV
shell: bash
- name: 'Delete existing "rn:" label if found'
run: gh pr edit ${{ github.event.pull_request.number }} --remove-label "${{ env.OLD_LABEL }}"
shell: bash
if: ${{ env.OLD_LABEL }}
- name: Set Label
# Using toJSON to support ' and " in commit messages
# https://stackoverflow.com/questions/73363167/github-actions-how-to-escape-characters-in-commit-message
run: echo "LABEL=$(echo ${{ toJSON(github.event.pull_request.title) }} | cut -d ':' -f 1 | tr -d ' ' | tr ',' '|')" >> $GITHUB_ENV
shell: bash
# an alternative to verifying if the target label already exist is to
# create the label with --force in the next step, it will keep on changing
# the color of the label though so it may not be desirable.
- name: Check if label exist
run: |
EXIST=$(gh label list -L 100 --search "rn:" --json name -q '.[] | select(.name=="rn: ${{ env.LABEL }}").name')
echo "EXIST=$EXIST" >> $GITHUB_ENV
shell: bash
- name: Create Label if auto-create and label does not exist already
run: |
gh label create "rn: ${{ env.LABEL }}"
shell: bash
if: ${{ inputs.auto_create_label && ! env.EXIST }}
- name: Labelling PR
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "rn: ${{ env.LABEL }}"
set -euo pipefail

old_label="$(gh pr view "$PR_NUMBER" --json labels -q '.labels[].name' | grep 'rn: ' || true)"
if [[ -n "$old_label" ]]; then
while IFS= read -r label; do
gh pr edit "$PR_NUMBER" --remove-label "$label"
done <<< "$old_label"
fi

label="$(printf '%s' "$PR_TITLE" | cut -d ':' -f 1 | tr -d ' ' | tr ',' '|')"
if [[ "$AUTO_CREATE_LABEL" == "true" ]]; then
existing_label="$(gh label list -L 100 --search "rn:" --json name -q '.[] | select(.name | startswith("rn: ")) | .name' | grep -Fx "rn: $label" || true)"
if [[ -z "$existing_label" ]]; then
gh label create "rn: $label"
fi
fi

gh pr edit "$PR_NUMBER" --add-label "rn: $label"
shell: bash
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ updates:
commit-message:
prefix: "Bump(requirements): "
prefix-development: "CI(requirements):"
cooldown:
default-days: 7
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
Expand All @@ -26,6 +28,8 @@ updates:
day: "monday"
commit-message:
prefix: "CI: "
cooldown:
default-days: 7
# Maintain dependencies for Rust crates
- package-ecosystem: "cargo"
directory: "/"
Expand All @@ -34,6 +38,8 @@ updates:
day: "monday"
commit-message:
prefix: "Bump(rust): "
cooldown:
default-days: 7
# Maintain the pinned Rust toolchain
- package-ecosystem: "rust-toolchain"
directory: "/"
Expand All @@ -42,3 +48,5 @@ updates:
day: "monday"
commit-message:
prefix: "Bump(rust): "
cooldown:
default-days: 7
29 changes: 20 additions & 9 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ env:
# rust
CARGO_TERM_COLOR: always

permissions:
contents: read

jobs:
# ------------------------------------------------------------ #
# Build cross platform pyavd-utils wheels and upload artifacts
Expand All @@ -27,19 +30,23 @@ jobs:
name: Build pyavd-utils wheel on ${{ inputs.runner }}
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Update version to ${{ inputs.TESTPYPI_VERSION }}
if: ${{ inputs.TESTPYPI_VERSION != '' }}
shell: bash # For our Windows friend
env:
TESTPYPI_VERSION: ${{ inputs.TESTPYPI_VERSION }}
run: |-
pip install bump-my-version
bump-my-version replace \
--regex \
--search "__version__ = \"[^\n]*\"" \
--replace "__version__ = \"${{ inputs.TESTPYPI_VERSION }}\"" \
--replace "__version__ = \"${TESTPYPI_VERSION}\"" \
--no-configured-files \
-v \
pyavd_utils/__init__.py
Expand All @@ -52,7 +59,7 @@ jobs:
# and will not copy the parent Cargo.toml and we will be sad
run: |-
python -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pyavd-utils-wheels-${{ inputs.runner }}
path: dist/*.whl
Expand All @@ -69,13 +76,15 @@ jobs:
matrix:
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Download ${{ inputs.runner }} wheel(s)
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pyavd-utils-wheels-${{ inputs.runner }}
path: dist
- uses: actions/setup-python@v6
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python }}
- name: Install tox
Expand Down Expand Up @@ -113,9 +122,11 @@ jobs:
apk add nodejs --update-cache
mkdir /opt/bin
ln -s /usr/bin/node /opt/bin/node
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Download ${{ inputs.runner }} wheel(s)
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pyavd-utils-wheels-${{ inputs.runner }}
path: dist
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,26 @@ jobs:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Download coverage from pytest
continue-on-error: true
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pytest-coverage
path: .

- name: Download coverage report from rust tests
continue-on-error: true
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: rust-llvm-cov
path: .

- name: Upload results to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
use_oidc: true
files: coverage.xml,lcov.info
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/pull-request-autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: autofix.ci

"on":
pull_request:
push:
branches:
- main

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

permissions:
contents: read
Comment on lines +14 to +15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Grant write permission for autofix commits.

Line 14-15 sets contents: read, but Line 47-48 attempts to push fixes via autofix-ci/action. With read-only contents, the commit-back step cannot write.

Suggested fix
 permissions:
-  contents: read
+  contents: write
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
contents: read
permissions:
contents: write
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pull-request-autofix.yml around lines 14 - 15, The
workflow currently sets repository contents permission to read (permissions:
contents: read) which prevents the autofix action from pushing commits; change
the permissions block to grant write access for contents (so the
autofix-ci/action can create commits) by updating the permissions key that
references contents: read to allow write (e.g., contents: write) and ensure the
job that runs autofix-ci/action retains that permission so the push step
succeeds.


jobs:
autofix:
name: Run pre-commit and commit back any changes
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"

# Needed until we move to prek and get proper support for toolchain profile - preferably per hook.
- name: Install Rust nightly formatter
run: rustup toolchain install nightly --component rustfmt --no-self-update

- name: Run pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
continue-on-error: true
with:
extra_args: --all-files
# Allowing cargo installs to be unoptimized for install speed.
env:
CARGO_PROFILE_RELEASE_OPT_LEVEL: 0
CARGO_PROFILE_RELEASE_LTO: false
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 256

- name: Commit back any git diff
uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4
9 changes: 7 additions & 2 deletions .github/workflows/pull-request-conflict.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name: "PR Conflicts checker"
"on":
"on": # zizmor: ignore[dangerous-triggers] Uses pull_request_target only to label/comment on PR metadata, not to check out or execute PR code.
pull_request_target:
types: [synchronize]

permissions:
contents: read
issues: write
pull-requests: write

jobs:
Conflict_Check:
name: "Check PR status: conflicts and resolution"
runs-on: ubuntu-latest
steps:
- name: Check if PRs are dirty
uses: eps1lon/actions-label-merge-conflict@releases/2.x
uses: eps1lon/actions-label-merge-conflict@0273be72a0bbd58fcd71d0d6c02c209b50d1e5e1 # v3.1.0
with:
dirtyLabel: "state: conflict"
removeOnDirtyLabel: "state: conflict resolved"
Expand Down
Loading
Loading