-
Notifications
You must be signed in to change notification settings - Fork 12
chore(standards): resolve repo-standards drift (CI, pnpm, changelog, ignores) #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
44403eb
chore(standards): fix CI filters, add SDK auto-bump + towncrier chang…
30d0b3f
chore(standards): add CI permissions, pnpm docs, yamllint truthy, Val…
9b8daa3
ci: bump docs job Node to 22 for pnpm 11.6.0 (requires Node >=22.13)
27d2506
chore(standards): add CODEOWNERS and pre-commit config
c9b0148
ci: harden update-infrahub-sdk workflow per code review
004bd63
chore(standards): migrate markdown lint from markdownlint-cli2 to rumdl
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Code ownership for infrahub-sync. | ||
| # The Solutions Architecture team owns the repository by default; PRs request | ||
| # their review automatically. See https://docs.github.com/articles/about-code-owners | ||
| * @opsmill/sa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| #!/bin/sh | ||
|
|
||
| cd docs && npm install && npm run build | ||
| cd docs && pnpm install --frozen-lockfile && pnpm run build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| --- | ||
| # yamllint disable rule:truthy rule:line-length | ||
| name: "Update infrahub-sdk-python Version" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "infrahub-sdk version to test" | ||
| required: true | ||
|
|
||
| repository_dispatch: | ||
| types: [trigger-infrahub-sdk-python-update] | ||
|
|
||
| jobs: | ||
| update-dependencies: | ||
| strategy: | ||
| matrix: | ||
| branch-name: | ||
| - develop | ||
|
|
||
| runs-on: ubuntu-22.04 | ||
| concurrency: | ||
| group: update-infrahub-sdk-${{ github.event_name == 'repository_dispatch' && github.event.client_payload.version || github.event.inputs.version }}-${{ matrix.branch-name }} | ||
| cancel-in-progress: false | ||
|
|
||
| env: | ||
| INFRAHUB_SDK_VERSION: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.version || github.event.inputs.version }} | ||
| BRANCH_NAME: ${{ matrix.branch-name }}-infrahub-sdk-${{ github.event_name == 'repository_dispatch' && github.event.client_payload.version || github.event.inputs.version }} | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install uv | ||
| run: | | ||
| pip install uv | ||
| uv sync | ||
|
|
||
| # infrahub-sync pins `infrahub-sdk[all]`; keep the `[all]` extras so the | ||
| # bracket syntax activates the SDK's own extras (not this project's | ||
| # optional-dependency groups, which the `--extra` flag would touch). | ||
| - name: Update infrahub-sdk to version ${{ env.INFRAHUB_SDK_VERSION }} | ||
| run: | | ||
| uv add "infrahub-sdk[all]==${INFRAHUB_SDK_VERSION}" | ||
|
|
||
| - name: Prepare the branch for the update | ||
| id: prepare-branch | ||
| run: | | ||
| echo "Checking if branch ${BRANCH_NAME} exists..." | ||
| BRANCH_EXISTS=$(git ls-remote --heads origin "${BRANCH_NAME}" | wc -l) | ||
| echo "BRANCH_EXISTS=$BRANCH_EXISTS" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Commit and push changes | ||
| uses: github-actions-x/commit@v2.9 | ||
| with: | ||
| github-token: ${{ secrets.GH_UPDATE_PACKAGE_OTTO }} | ||
| push-branch: ${{ env.BRANCH_NAME }} | ||
| commit-message: "chore: update infrahub-sdk to version ${{ env.INFRAHUB_SDK_VERSION }}" | ||
| files: | | ||
| pyproject.toml | ||
| uv.lock | ||
| name: opsmill-bot | ||
| email: github-bot@opsmill.com | ||
| rebase: ${{ env.BRANCH_EXISTS == 1 }} | ||
|
|
||
| - name: Create a pull request | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_UPDATE_PACKAGE_OTTO }} | ||
| MATRIX_BRANCH: ${{ matrix.branch-name }} | ||
| run: | | ||
| # Skip create if a PR already exists for this head branch (re-runs against the same version). | ||
| if [ -n "$(gh pr list --head "${BRANCH_NAME}" --state open --json number --jq '.[0].number')" ]; then | ||
| echo "PR for ${BRANCH_NAME} already open, skipping create" | ||
| exit 0 | ||
| fi | ||
| gh pr create \ | ||
| --title "update infrahub-sdk to version ${INFRAHUB_SDK_VERSION} against ${MATRIX_BRANCH}" \ | ||
| --body "This PR updates infrahub-sdk to version ${INFRAHUB_SDK_VERSION}." \ | ||
| --base "${MATRIX_BRANCH}" \ | ||
| --head "${BRANCH_NAME}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| # Run locally with `uv run pre-commit install` then on each commit, or | ||
| # `uv run pre-commit run --all-files`. Mirrors the CI ruff gate so formatting | ||
| # and lint issues are caught before push. Keep the ruff rev in sync with the | ||
| # pinned `ruff` version in pyproject.toml. | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-toml | ||
| - id: check-merge-conflict | ||
| - id: check-added-large-files | ||
| - id: detect-private-key | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.5 | ||
| hooks: | ||
| - id: ruff-format | ||
| - id: ruff-check | ||
| args: [--fix] | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: rumdl | ||
| name: rumdl | ||
| entry: uv run rumdl check | ||
| language: system | ||
| pass_filenames: false | ||
| files: \.(md|mdx)$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| !.gitignore |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.