-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: usage documentation This is the initial implementation. Expect many tweaks and adjustments in subsequent PRs.
- Loading branch information
Showing
70 changed files
with
3,238 additions
and
832 deletions.
There are no files selected for viewing
This file contains 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,179 @@ | ||
version: v1 | ||
|
||
labels: | ||
# -- types ------------------------------------------------------------------- | ||
- label: 'type/feat' | ||
sync: true | ||
matcher: | ||
title: '^feat(\([^)]+\))?!?:' | ||
|
||
- label: 'type/bug' | ||
sync: true | ||
matcher: | ||
title: '^fix(\([^)]+\))?!?:' | ||
|
||
- label: 'type/docs' | ||
sync: true | ||
matcher: | ||
title: '^docs(\([^)]+\))?:' | ||
|
||
- label: 'Breaking 🔨' | ||
sync: true | ||
matcher: | ||
title: '^(feat|fix)(\([^)]+\))?!:' | ||
|
||
# -- distinct areas ---------------------------------------------------------- | ||
|
||
- label: 'area/docs' | ||
sync: true | ||
matcher: | ||
files: | ||
any: ['docs/*', 'docs/**/*', '**/*.rst', '**/*.md'] | ||
|
||
- label: 'area/unit-tests' | ||
sync: true | ||
matcher: | ||
files: | ||
any: ['test/unit/*', 'test/unit/**/*', 'tests/*.py', 'tests/fixtures/**/*'] | ||
|
||
- label: 'area/integration-tests' | ||
sync: true | ||
matcher: | ||
files: | ||
any: ['test/integration/*', 'test/integration/**/*'] | ||
|
||
- label: 'area/example-apps' | ||
sync: true | ||
matcher: | ||
files: | ||
any: ['examples/**/*', 'examples/**/*'] | ||
|
||
- label: 'area/docs' | ||
sync: true | ||
matcher: | ||
files: | ||
any: ['docs/*', 'docs/**/*', '**/*.rst', '**/*.md'] | ||
|
||
- label: 'area/ci' | ||
sync: true | ||
matcher: | ||
files: | ||
any: ['.github/**/*', 'codecov.yml', 'pre-commit-config.yaml', 'sonar-project.properties', '*.yaml', '*.yml'] | ||
|
||
- label: 'area/dependencies' | ||
sync: true | ||
matcher: | ||
files: | ||
any: ['pyproject.toml', '*.lock'] | ||
|
||
- label: 'area/repositories' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/repository/**/*'] | ||
|
||
- label: 'area/services' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/service/**/*'] | ||
|
||
- label: 'area/base' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/base.py'] | ||
|
||
- label: 'area/exceptions' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/exceptions.py'] | ||
|
||
- label: 'area/filters' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/filters.py'] | ||
|
||
- label: 'area/operations' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/operations.py'] | ||
|
||
- label: 'area/mixins' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/mixins/**/*'] | ||
|
||
- label: 'area/config' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/config/**/*'] | ||
|
||
- label: 'area/alembic' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/alembic/**/*'] | ||
|
||
- label: 'area/flask' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/extensions/flask/**/*','advanced_alchemy/extensions/flask.py'] | ||
|
||
- label: 'area/sanic' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/extensions/sanic/**/*','advanced_alchemy/extensions/sanic.py'] | ||
|
||
- label: 'area/fastapi' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/extensions/starlette/**/*','advanced_alchemy/extensions/starlette.py'] | ||
|
||
- label: 'area/litestar' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/extensions/litestar/**/*'] | ||
|
||
- label: 'area/litestar' | ||
sync: true | ||
matcher: | ||
files: ['advanced_alchemy/extensions/litestar/**/*'] | ||
|
||
- label: 'area/private-api' | ||
sync: true | ||
matcher: | ||
files: | ||
any: ['advanced_alchemy/_*.py', 'advanced_alchemy/*/_*.py', 'advanced_alchemy/_*/**/*.py'] | ||
|
||
- label: 'area/tools' | ||
sync: true | ||
matcher: | ||
files: ['tools/**/*'] | ||
|
||
# -- Size Based Labels ------------------------------------------------------- | ||
- label: 'size: small' | ||
sync: true | ||
matcher: | ||
files: | ||
count: | ||
gte: 1 | ||
lte: 10 | ||
|
||
- label: 'size: medium' | ||
sync: true | ||
matcher: | ||
files: | ||
count: | ||
gte: 10 | ||
lte: 25 | ||
|
||
- label: 'size: large' | ||
sync: true | ||
matcher: | ||
files: | ||
count: | ||
gte: 26 | ||
|
||
# -- Merge Checks -------------------------------------------------------------- | ||
checks: | ||
- context: 'No Merge check' | ||
description: "Disable merging when 'do not merge' label is set" | ||
labels: | ||
none: ['do not merge'] |
This file contains 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 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 @@ | ||
name: Notify released issues | ||
on: | ||
workflow_call: | ||
inputs: | ||
release_tag: | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
notify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Get released issues | ||
id: get-released-issues | ||
run: | ||
echo "issues=$(python ./.github/workflows/notify_released_issues/get_closed_issues.py ${{ inputs.release_tag }})" >> "$GITHUB_OUTPUT" | ||
|
||
- uses: actions/github-script@v7 | ||
env: | ||
CLOSED_ISSUES: ${{ steps.get-released-issues.outputs.issues }} | ||
with: | ||
script: | | ||
const script = require('./.github/workflows/notify_released_issues/notify.js') | ||
await script({github, context, core}) |
This file contains 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,48 @@ | ||
name: "Pull Request Labeler" | ||
|
||
on: | ||
pull_request_target: | ||
|
||
jobs: | ||
apply-labels: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
checks: write | ||
statuses: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: fuxingloh/multi-labeler@v4 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
distinguish-pr-origin: | ||
needs: apply-labels | ||
if: ${{ always() }} | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
const maintainers = [ | ||
'JacobCoffee', 'provinzkraut', 'cofin','Alc-Alc', | ||
'dependabot[bot]', 'all-contributors[bot]' | ||
] | ||
if (maintainers.includes(context.payload.sender.login)) { | ||
github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: ['pr/internal'] | ||
}) | ||
} else { | ||
github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: ['pr/external', 'Triage Required :hospital:'] | ||
}) | ||
} |
This file contains 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,52 @@ | ||
name: "PR merged" | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
close_and_notify: | ||
name: Close issues and notify | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const prNumber = context.payload.number | ||
const branch = context.baseRef | ||
// TODO: use semantic commits to specify the exact version, when it will be released | ||
const commentBody = `<!--closing-comment-->\nThis issue has been closed in #${prNumber}. The change will be included in upcoming releases.` | ||
const query = `query($number: Int!, $owner: String!, $name: String!) { repository(owner: $owner, name: $name) { | ||
pullRequest(number: $number) { | ||
id | ||
closingIssuesReferences (first: 10) { edges { node { number } } } | ||
} | ||
} | ||
}` | ||
const res = await github.graphql(query, {number: prNumber, owner: context.repo.owner, name: context.repo.repo}) | ||
const linkedIssues = res.repository.pullRequest.closingIssuesReferences.edges.map( | ||
edge => edge.node.number | ||
) | ||
for (const issueNumber of linkedIssues) { | ||
const res = await github.rest.issues.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: issueNumber, | ||
state: "closed", | ||
state_reason: "completed" | ||
}) | ||
if (res.status === 200) { | ||
await github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: issueNumber, | ||
body: commentBody, | ||
}) | ||
} | ||
} |
This file contains 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 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 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 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
Oops, something went wrong.