Skip to content

Commit 0025cfc

Browse files
committed
fix: update from template
1 parent 825675d commit 0025cfc

39 files changed

Lines changed: 1264 additions & 14382 deletions

.copier-answers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_commit: v1.2.0
1+
_commit: v1.7.1
22
_src_path: git@github.com:aignostics/foundry-python.git
33
author_email: oliver.meyer@aignostics.com
44
author_github_username: olivermeyer
@@ -9,5 +9,6 @@ import_package_name: aignostics_foundry_core
99
project_description: Foundational infrastructure for Foundry components.
1010
project_icon: 🏭
1111
project_name: Foundry Python Core
12+
project_type: library
1213
slack_notifications_enabled: true
1314
slack_release_channel: '#announce-foundry'

.github/actions/run-tests/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runs:
3535
shell: bash
3636
run: |
3737
set +e
38-
mise run $MISE_TASK
38+
mise run "${MISE_TASK}"
3939
EXIT_CODE=$?
4040
# Show test execution in GitHub Job summary
4141
found_files=0
@@ -47,7 +47,7 @@ runs:
4747
fi
4848
done
4949
if [ $found_files -eq 0 ]; then
50-
echo "# $SUMMARY_TITLE" >> $GITHUB_STEP_SUMMARY
50+
echo "# ${SUMMARY_TITLE}" >> $GITHUB_STEP_SUMMARY
5151
echo "" >> $GITHUB_STEP_SUMMARY
5252
fi
5353
# Show test coverage in GitHub Job summary

.github/actions/setup-dev-env/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ description: 'Checkout, GCP auth, mise, uv, and dev tools'
44
runs:
55
using: 'composite'
66
steps:
7+
78
- name: Install mise
89
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
910

1011
- name: Initialize mise and install Python dependencies
1112
shell: bash
13+
env:
14+
GITHUB_TOKEN: ${{ github.token }}
1215
run: mise run install

.github/workflows/_audit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Audit
2323
run: mise run audit
2424

25+
- name: Generate attributions
26+
run: mise run attributions
27+
2528
- name: Upload audit results
2629
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
2730
if: ${{ always() && (env.GITHUB_WORKFLOW_RUNTIME != 'ACT') }}
@@ -34,4 +37,5 @@ jobs:
3437
reports/licenses.json
3538
reports/licenses_grouped.json
3639
reports/vulnerabilities.json
40+
reports/ATTRIBUTIONS.md
3741
retention-days: 30

.github/workflows/_lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
uses: ./.github/actions/setup-dev-env
2121

2222
- name: Lint
23-
run: mise run lint
23+
run: mise run pre_commit_run_all

.github/workflows/_package-publish.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ jobs:
2323
- name: Setup Dev Environment
2424
uses: ./.github/actions/setup-dev-env
2525

26-
- name: Build documentation
27-
run: mise run docs
2826

2927
- name: Build distribution
3028
run: uv build
@@ -45,10 +43,15 @@ jobs:
4543
4644
# Export release notes for Slack notification
4745
# Convert markdown links [text](url) to Slack format <url|text>
48-
# Truncate to 2900 chars for Slack's ~3000 char limit
46+
# If notes exceed Slack's ~3000 char limit, truncate and add link to full release notes
4947
# Escape for JSON (backslashes, quotes, newlines)
50-
NOTES=$(sed -E 's/\[([^]]+)\]\(([^)]+)\)/<\2|\1>/g' RELEASE_NOTES.md | head -c 2900 | \
51-
sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
48+
NOTES_CONVERTED=$(sed -E 's/\[([^]]+)\]\(([^)]+)\)/<\2|\1>/g' RELEASE_NOTES.md)
49+
RELEASE_URL="${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}"
50+
if [ "$(printf '%s' "$NOTES_CONVERTED" | wc -c)" -gt 2700 ]; then
51+
NOTES_TRUNCATED=$(printf '%s' "$NOTES_CONVERTED" | head -c 2700)
52+
NOTES_CONVERTED="${NOTES_TRUNCATED}"$'\n'"...<${RELEASE_URL}|Read full release notes>"
53+
fi
54+
NOTES=$(printf '%s' "$NOTES_CONVERTED" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
5255
echo "RELEASE_NOTES_CONTENT=$NOTES" >> $GITHUB_ENV
5356
5457
@@ -69,8 +72,8 @@ jobs:
6972
7073
- name: Send Slack release notification
7174
if: success()
72-
uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3
75+
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
7376
with:
7477
method: chat.postMessage
7578
token: ${{ secrets.SLACK_RELEASE_BOT_TOKEN }}
76-
payload: '{"channel":"#announce-foundry","text":"🚀 aignostics-foundry-core ${{ github.ref_name }} released","blocks":[{"type":"section","text":{"type":"mrkdwn","text":"🚀 *aignostics-foundry-core* <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}> released"}},{"type":"section","text":{"type":"mrkdwn","text":"${{ env.RELEASE_NOTES_CONTENT }}"}}]}'
79+
payload: '{"channel":"#announce-foundry","text":"🚀 Foundry Python Core ${{ github.ref_name }} released","blocks":[{"type":"section","text":{"type":"mrkdwn","text":"🚀 *Foundry Python Core* <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}> released"}},{"type":"section","text":{"type":"mrkdwn","text":"${{ env.RELEASE_NOTES_CONTENT }}"}}]}'

.github/workflows/_scheduled-test-daily.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
3737
shell: bash
3838
run: |
39-
TOML_VERSION=$(grep -m 1 '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
39+
TOML_VERSION=$(uv run python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])")
4040
echo "Development build - Current version in pyproject.toml: $TOML_VERSION"
4141
4242
- name: Validate and set environment suffix
@@ -46,14 +46,14 @@ jobs:
4646
shell: bash
4747
run: |
4848
# Validate deploy_env is one of the allowed values
49-
case "$DEPLOY_ENV" in
49+
case "${DEPLOY_ENV}" in
5050
dev|test|staging|production)
5151
# Convert to uppercase
52-
SUFFIX=$(echo "$DEPLOY_ENV" | tr '[:lower:]' '[:upper:]')
52+
SUFFIX=$(echo "${DEPLOY_ENV}" | tr '[:lower:]' '[:upper:]')
5353
echo "suffix=${SUFFIX}" >> $GITHUB_OUTPUT
5454
;;
5555
*)
56-
echo "Error: Invalid deploy_env value '$DEPLOY_ENV'. Must be one of: dev, test, staging, production"
56+
echo "Error: Invalid deploy_env value '${DEPLOY_ENV}'. Must be one of: dev, test, staging, production"
5757
exit 1
5858
;;
5959
esac
@@ -220,7 +220,7 @@ jobs:
220220

221221
- name: SonarQube Scan
222222
if: ${{ !cancelled() && (env.GITHUB_WORKFLOW_RUNTIME != 'ACT') }}
223-
uses: SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8
223+
uses: SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8.0.0
224224
env:
225225
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
226226
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/_scheduled-test-hourly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ jobs:
3939
shell: bash
4040
run: |
4141
# Validate deploy_env is one of the allowed values
42-
case "$DEPLOY_ENV" in
42+
case "${DEPLOY_ENV}" in
4343
dev|test|staging|production)
4444
# Convert to uppercase
45-
SUFFIX=$(echo "$DEPLOY_ENV" | tr '[:lower:]' '[:upper:]')
45+
SUFFIX=$(echo "${DEPLOY_ENV}" | tr '[:lower:]' '[:upper:]')
4646
echo "suffix=${SUFFIX}" >> $GITHUB_OUTPUT
4747
;;
4848
*)
49-
echo "Error: Invalid deploy_env value '$DEPLOY_ENV'. Must be one of: dev, test, staging, production"
49+
echo "Error: Invalid deploy_env value '${DEPLOY_ENV}'. Must be one of: dev, test, staging, production"
5050
exit 1
5151
;;
5252
esac

.github/workflows/_test.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ name: "> Test"
22

33
on:
44
workflow_call:
5+
secrets:
6+
GCP_WORKLOAD_IDENTITY_PROVIDER:
7+
required: true
8+
CODECOV_TOKEN:
9+
required: true
10+
SONAR_TOKEN:
11+
required: true
12+
AIGNOSTICS_FOUNDRY_CORE_LOGFIRE_TOKEN:
13+
required: false
14+
AIGNOSTICS_FOUNDRY_CORE_SENTRY_DSN:
15+
required: false
516

617
concurrency:
718
group: test-${{ github.ref }}
@@ -15,6 +26,7 @@ jobs:
1526
contents: read
1627
id-token: write
1728
packages: write
29+
1830
steps:
1931
- name: Checkout
2032
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -40,13 +52,6 @@ jobs:
4052
TOML_VERSION=$(grep -m 1 '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
4153
echo "Development build - Current version in pyproject.toml: $TOML_VERSION"
4254
43-
- name: Create .env file
44-
uses: SpicyPizza/create-envfile@ace6d4f5d7802b600276c23ca417e669f1a06f6f # v2.0.3
45-
with:
46-
envkey_AIGNOSTICS_FOUNDRY_CORE_LOGFIRE_TOKEN: "${{ secrets.AIGNOSTICS_FOUNDRY_CORE_LOGFIRE_TOKEN }}"
47-
envkey_AIGNOSTICS_FOUNDRY_CORE_SENTRY_DSN: "${{ secrets.AIGNOSTICS_FOUNDRY_CORE_SENTRY_DSN }}"
48-
fail_on_empty: false
49-
5055
- name: Test / Unit
5156
uses: ./.github/actions/run-tests
5257
with:
@@ -74,6 +79,15 @@ jobs:
7479
summary-title: All e2e tests passed
7580
commit-message: ${{ github.event.head_commit.message }}
7681

82+
- name: Test / Unit (lowest-direct)
83+
uses: ./.github/actions/run-tests
84+
with:
85+
test-type: unit
86+
mise-task: test_lowest_direct
87+
skip-marker: skip:test:lowest-direct
88+
summary-title: All unit tests passed with lowest-direct dependencies
89+
commit-message: ${{ github.event.head_commit.message }}
90+
7791
- name: Upload test results
7892
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
7993
if: ${{ always() && (env.GITHUB_WORKFLOW_RUNTIME != 'ACT') }}
@@ -102,7 +116,7 @@ jobs:
102116

103117
- name: SonarQube Scan
104118
if: ${{ !cancelled() && (env.GITHUB_WORKFLOW_RUNTIME != 'ACT') }}
105-
uses: SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8
119+
uses: SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8.0.0
106120
env:
107121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108122
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/bump.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@ on:
88
required: false
99
type: string
1010
default: ""
11+
workflow_call:
12+
secrets:
13+
GCP_WORKLOAD_IDENTITY_PROVIDER:
14+
required: true
1115

1216
jobs:
1317
bump:
1418
runs-on: ubuntu-latest
1519
permissions:
1620
contents: write
21+
id-token: write
1722
steps:
1823
- name: Generate GitHub App token
1924
id: app-token
2025
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
2126
with:
22-
app-id: ${{ secrets.RELEASE_BOT_APP_ID }}
27+
client-id: ${{ secrets.RELEASE_BOT_APP_ID }}
2328
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
2429

2530
- name: Checkout
@@ -28,11 +33,8 @@ jobs:
2833
token: ${{ steps.app-token.outputs.token }}
2934
fetch-depth: 0
3035

31-
- name: Install mise
32-
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
33-
34-
- name: Install Python, venv and dependencies
35-
run: uv sync --all-extras --frozen --no-build --link-mode=copy
36+
- name: Setup Dev Environment
37+
uses: ./.github/actions/setup-dev-env
3638

3739
- name: Configure git identity
3840
run: |

0 commit comments

Comments
 (0)