Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Default owners for everything in the repo

* @opsmill/sa
86 changes: 63 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ name: CI
# yamllint disable rule:truthy rule:line-length

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

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

permissions:
contents: read

jobs:
# Detect which files have changed to run only necessary jobs
files-changed:
Expand All @@ -20,9 +25,10 @@ jobs:
documentation: ${{ steps.changes.outputs.documentation_all }}
python: ${{ steps.changes.outputs.python_all }}
yaml: ${{ steps.changes.outputs.yaml_all }}
markdown: ${{ steps.changes.outputs.markdown_all }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Filter changed paths
uses: opsmill/[email protected]
id: changes
Expand All @@ -38,15 +44,22 @@ jobs:
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: true
- name: Install Ruff
run: pip install ruff==0.11.0
- name: Run Ruff linter
run: ruff check .
- name: Install uv
uses: "astral-sh/setup-uv@v7"
with:
version: "0.9.18"
- run: uv sync
- name: Check code formatting
run: ruff format --check --diff
run: |
uv run ruff format --check --diff
uv run ruff check --select I .
- name: Run linters
run: uv run ruff check
- name: Run type checks
run: uv run mypy .

# YAML linting job
yaml-lint:
Expand All @@ -56,13 +69,34 @@ jobs:
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: true
- name: Install yamllint
run: pip install yamllint==1.35.1
- name: Install uv
uses: "astral-sh/setup-uv@v7"
with:
version: "0.9.18"
- run: uv sync
- name: Run yamllint
run: yamllint -s .
run: uv run yamllint -s .

# Markdown linting job
markdown-lint:
if: needs.files-changed.outputs.markdown == 'true'
needs: ["files-changed"]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 20
- name: Install markdownlint-cli
run: npm install -g markdownlint-cli
- name: Run markdownlint
run: markdownlint "**/*.{md,mdx}"

# Documentation build job
documentation:
Expand All @@ -75,14 +109,14 @@ jobs:
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled') &&
needs.files-changed.outputs.documentation == 'true'
needs: ["files-changed", "yaml-lint", "python-lint"]
needs: ["files-changed", "yaml-lint", "python-lint", "markdown-lint"]
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
build-status: ${{ job.status }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: true
- name: Update submodules
Expand All @@ -95,10 +129,14 @@ jobs:
cache-dependency-path: docs/package-lock.json
- name: Install Node dependencies
run: npm install
- name: Install Python dependencies
run: pip install invoke toml
- name: Install uv
uses: "astral-sh/setup-uv@v7"
with:
version: "0.9.18"
- run: uv sync
working-directory: ./
- name: Build documentation
run: invoke docs
run: uv run invoke docs

# Link checking job
check-links:
Expand All @@ -119,7 +157,7 @@ jobs:
working-directory: ./docs
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
submodules: true
- name: Update submodules
Expand All @@ -134,10 +172,12 @@ jobs:
run: npm install
- name: Install sitemap2urllist
run: cargo install --locked sitemap2urllist
- name: Install Python dependencies
run: pip install invoke toml
- name: Install uv
uses: "astral-sh/setup-uv@v7"
with:
version: "0.9.18"
- name: Build documentation
run: invoke docs
run: uv run invoke docs
- name: Start Docusaurus server
run: |
npm run serve &
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
Expand Down
28 changes: 18 additions & 10 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
---
# Markdownlint configuration
# https://github.com/DavidAnson/markdownlint

default: true
MD013: false # disables max line-length
MD014: false # dollar signs used before commands
MD024: false # disables 'no duplicate headings', which we use in tabs for instructions

# MD013/line-length - Line length (disabled for readability in prose)
MD013: false

# MD024/no-duplicate-heading - Multiple headings with the same content
# Allow duplicate headings in different sections (e.g., tabs)
MD024:
siblings_only: true

# MD025/single-title - Multiple top-level headings
# Prevent collisions with h1s and frontmatter titles
MD025:
front_matter_title: "" # prevent collisions with h1s and frontmatter titles
MD029: false # allows manually creating ordered lists
MD033: false # allows inline html to override markdown styles
MD034: false # no-bare-urls
MD041: false # allow 1st line to not be a top-level heading (required for Towncrier)
MD045: false # no alt text around images
MD047: false # single trailing newline
front_matter_title: ""

# MD060/table-column-style - Table column style (disabled for flexibility)
MD060: false
16 changes: 16 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Files to ignore

.claude/
.git/
.kiro/
.mypy_cache/
.ruff_cache/
.venv/
docs/.docusaurus/
docs/build/
docs/docs-*
docs/docs/
docs/node_modules/
docs/README.md
infrahub/
node_modules/
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

12 changes: 5 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ npm run clear # Clear Docusaurus build cache
From the repository root, use Python invoke tasks:

```bash
invoke docs # Build documentation (runs npm run build in docs/)
invoke lint # Run all linters (ruff + yamllint)
invoke format # Format Python files with ruff
invoke lint-yaml # Check YAML files
invoke lint-ruff # Check Python files with ruff
uv run invoke docs # Build documentation (runs npm run build in docs/)
uv run invoke lint # Run all linters (ruff + yamllint)
uv run invoke format # Format Python files with ruff
```

**Note**: Requires Poetry installation. Run `poetry install` to set up Python dependencies.
**Note**: Requires uv installation. Run `uv sync` to set up Python dependencies.

### Linting and Quality Checks

Expand Down Expand Up @@ -307,7 +305,7 @@ The repository uses GitHub Actions for CI/CD:
- Hosted on Cloudflare Pages
- Production URL: `https://docs.infrahub.app`
- Deployment triggered by pushes to `main` branch
- Build command: `invoke docs` (runs `npm run build` in `docs/`)
- Build command: `uv run invoke docs` (runs `npm run build` in `docs/`)
- Build output directory: `docs/build/`

## Troubleshooting
Expand Down
Loading