-
Notifications
You must be signed in to change notification settings - Fork 0
chore: migration #2
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
Changes from all commits
f4adef9
0de149d
1b9aa39
431e911
5503783
902df9a
669431c
d1108e5
458664d
cb19dc5
eaac031
cd8a8aa
eac041d
c8ed0b4
a0eb6f5
843f227
cb41996
769befe
7010ffc
c836388
04e73f6
eab7156
4d8f4cb
4c78e60
44d214e
4b4462e
2f67c3e
fb90e27
bcaac25
1578fc9
55fb0d8
8a6411d
55d3e69
ccf8e0b
6f5587b
9211705
b8503cf
903ef47
2d5b8e8
5ca727c
702a084
f7869a1
29b9a20
ee0e40a
04eff5f
23795a3
7045fc4
246f88d
08bbdd5
257c881
eae5f83
4af4051
82a6767
8940104
78e33f1
8415a13
c72a713
5987281
22109e9
3d97882
6bdc8d8
39d952f
5258d62
2a310b8
0c9ee1a
7cf2657
f618e45
da9e166
67a6d4a
aa994bd
568b362
4875f03
94e65dc
c5d8cc2
2f9a985
7e91ddf
20994fd
61de04f
b41c3e5
8b76d85
da58860
7d64f4b
eb39224
ed43bda
e802b6c
b12a542
9b743b5
4085b61
a357251
6672c20
50b08d9
4d375ab
d611cb4
f9a8d05
285707f
bc6053b
201ccbe
951709e
26c7c3f
521411f
9dabce7
a61ac05
aebc22d
ebb5c8e
b7a633f
3564e9e
7c6e5d2
9d626a7
d33ad26
2b20cce
6ae0dff
e8621c4
a982c45
34e8e3c
1872b23
fc8f65b
3055f92
12243ed
be57bbe
3ad6cbb
b22e0d8
c4404e3
45ee6b8
e6c7e08
3f28a02
1ffd9fd
700dae0
35bc8d0
5c1b66e
7442d9a
5748cd5
f9fb29d
d17c78e
3179885
f5d530c
d96e89a
488187c
435f533
748f0ec
7f3e0b1
50b017e
26aecf2
e89d590
3a518cb
b8d99c9
5c4b3c9
6f19d5d
950eac7
cc5e87f
973f7ed
f894b64
737a498
2b11f9f
05fdaf6
9885cb3
9942c2a
ad631cb
c88e83b
b4be50b
5a1114a
5f0d50e
0a1d65e
7c82bc1
94e95af
93f6d38
9e41c43
1b9e502
a620f68
488c8ec
d3fb585
aba527c
a9e66f1
d960b1d
d3afb90
592a0a0
18f61a4
0c2232b
874ee0f
5710c35
2ddb058
c95f1ec
343173a
07f2ade
090d063
fb9b309
7a068a4
b9da990
8c6ba37
efd5a7f
80fd458
88180f5
db04f1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * @alpkom |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: setup | ||
| description: Checkout repo, set up Python and uv, and install dependencies. | ||
| inputs: | ||
| token: | ||
| description: 'GitHub token for checkout (defaults to GITHUB_TOKEN)' | ||
| default: ${{ github.token }} | ||
| persist-credentials: | ||
| description: 'Whether to persist the token in git config after checkout' | ||
| default: 'false' | ||
| ref: | ||
| description: 'Git ref to checkout' | ||
| default: '' | ||
| fetch-depth: | ||
| description: 'Number of commits to fetch (0 = full history)' | ||
| default: '1' | ||
| python-version: | ||
| description: 'Python version' | ||
| default: '3.13' | ||
| index-username: | ||
| description: 'Username for the PyPI index' | ||
| default: '' | ||
| index-token: | ||
| description: 'Auth token for the PyPI index' | ||
| default: '' | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| token: ${{ inputs.token }} | ||
| persist-credentials: ${{ inputs.persist-credentials }} | ||
| ref: ${{ inputs.ref }} | ||
| fetch-depth: ${{ inputs.fetch-depth }} | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
|
|
||
| - name: Set up Python ${{ inputs.python-version }} | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: ${{ inputs.python-version }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 #v8.2.0 | ||
| - name: Install dependencies | ||
| shell: bash | ||
| env: | ||
| INDEX_USERNAME: ${{ inputs.index-username }} | ||
| INDEX_TOKEN: ${{ inputs.index-token }} | ||
| IS_FORK: ${{ github.event.pull_request.head.repo.fork == true }} | ||
| run: | | ||
| if [[ "$IS_FORK" == "true" ]]; then | ||
| echo "Fork detected — syncing from PyPI without lockfile" | ||
| UV_INDEX_URL="https://pypi.org/simple/" \ | ||
| uv sync --all-packages --all-extras | ||
| else | ||
| echo "Syncing from Artifactory with lockfile" | ||
| UV_INDEX_ARTIFACTORY_USERNAME="${INDEX_USERNAME}" \ | ||
| UV_INDEX_ARTIFACTORY_PASSWORD="${INDEX_TOKEN}" \ | ||
| uv sync --all-packages --all-extras --locked | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| version: 2 | ||
| registries: | ||
| sap-artifactory: | ||
| type: python-index | ||
| url: https://common.repositories.cloud.sap/artifactory/api/pypi/build.releases.pypi/ | ||
| username: ${{secrets.DBOT_ARTIFACTORY_USERNAME}} | ||
| password: ${{secrets.DBOT_ARTIFACTORY_TOKEN}} | ||
| replaces-base: true | ||
| updates: | ||
| - package-ecosystem: uv | ||
| target-branch: 'main' | ||
| directory: / | ||
| registries: | ||
| - sap-artifactory | ||
| schedule: | ||
| interval: daily | ||
| time: '22:00' | ||
| cooldown: | ||
| default-days: 5 | ||
| open-pull-requests-limit: 10 | ||
|
|
||
| - package-ecosystem: github-actions | ||
| target-branch: 'main' | ||
| directory: / | ||
| schedule: | ||
| interval: daily | ||
| time: '22:00' | ||
| cooldown: | ||
| default-days: 5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/usr/bin/env python3 | ||
| import sys | ||
|
|
||
| package, version = sys.argv[1], sys.argv[2] | ||
| sections = open(f"packages/{package}/RELEASE_NOTES.md").read().split("## ") | ||
| match = next((s for s in sections if s.startswith(version)), None) | ||
|
|
||
| if not match: | ||
| sys.exit(f"No changelog entry found for version {version}") | ||
| print(match[len(version):].strip()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/usr/bin/env python3 | ||
| import sys | ||
|
|
||
| package, version, body = sys.argv[1], sys.argv[2], sys.argv[3] | ||
| path = f"packages/{package}/RELEASE_NOTES.md" | ||
| content = open(path).read() | ||
| sections = content.split("## ") | ||
| match = next((s for s in sections if s.startswith(version)), None) | ||
|
|
||
| if not match: | ||
| sys.exit(f"No changelog entry found for version {version}") | ||
|
|
||
| open(path, "w").write(content.replace(match, f"{version}\n\n{body.strip()}\n\n")) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: auto-doc | ||
|
|
||
| on: | ||
| pull_request: ~ | ||
| workflow_dispatch: ~ | ||
|
|
||
| jobs: | ||
| doc: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| if: github.event.pull_request.head.repo.fork == false | ||
|
|
||
| steps: | ||
| - name: Generate GitHub App token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 | ||
| with: | ||
| client-id: ${{ secrets.SAP_AI_SDK_BOT_CLIENT_ID }} | ||
| private-key: ${{ secrets.SAP_AI_SDK_BOT_PRIVATE_KEY }} | ||
| permission-contents: write | ||
|
|
||
| - name: Setup | ||
| uses: SAP/ai-sdk-python/.github/actions/setup@os-migration | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| persist-credentials: true | ||
| ref: ${{ github.head_ref }} | ||
| index-username: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
| index-token: ${{ secrets.ARTIFACTORY_TOKEN }} | ||
|
|
||
| - name: Configure git | ||
| env: | ||
| BOT_EMAIL: ${{ vars.SAP_AI_SDK_BOT_EMAIL }} | ||
| BOT_NAME: ${{ vars.SAP_AI_SDK_BOT_NAME }} | ||
| run: | | ||
| git config --local user.email "$BOT_EMAIL" | ||
| git config --local user.name "$BOT_NAME" | ||
|
|
||
| - name: Generate docs | ||
| run: | | ||
| generate_docs() { | ||
| ( | ||
| cd packages/$1/docs | ||
| rm -f *.html | ||
| uv run python -m pydoc -w ../ || true | ||
| ) | ||
| } | ||
|
|
||
| generate_docs base | ||
| generate_docs core | ||
| generate_docs gen | ||
|
|
||
| - name: Commit and push | ||
| env: | ||
| HEAD_REF: ${{ github.head_ref }} | ||
| run: | | ||
| git add packages/base/docs packages/core/docs packages/gen/docs | ||
| if git diff --cached --quiet; then | ||
| echo "No documentation changes to commit" | ||
| else | ||
| git commit -m "docs: update pydoc3 documentation [skip ci]" | ||
| git push origin HEAD:"$HEAD_REF" | ||
| fi | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: blackduck | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 3 * * *' | ||
| workflow_dispatch: | ||
| inputs: | ||
| branch: | ||
| description: 'Branch to scan (defaults to default branch).' | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: {} | ||
|
|
||
| env: | ||
| BLACKDUCK_SKIP_PHONE_HOME: true | ||
|
|
||
| jobs: | ||
| blackduck-scan: | ||
| name: blackduck scan | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| timeout-minutes: 15 | ||
|
|
||
| steps: | ||
| - name: Determine project version | ||
| id: version | ||
| env: | ||
| INPUT_BRANCH: ${{ github.event.inputs.branch }} | ||
| run: | | ||
| if [ -n "$INPUT_BRANCH" ]; then | ||
| VERSION="$INPUT_BRANCH" | ||
| else | ||
| VERSION="main" | ||
| fi | ||
| echo "Black Duck project version: $VERSION" | ||
| echo "project_version=$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Checkout repository at project version | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ steps.version.outputs.project_version }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Run Black Duck SCA scan | ||
| uses: blackduck-inc/black-duck-security-scan@3fe94e4b3c3947bd21ba46b7da255d6d3638b325 # v2.10.0 | ||
| with: | ||
| blackducksca_url: https://sap.blackducksoftware.com | ||
| blackducksca_token: ${{ secrets.BLACKDUCK_API_TOKEN }} | ||
| blackducksca_scan_full: true | ||
| blackducksca_scan_failure_severities: 'BLOCKER,CRITICAL' | ||
| blackducksca_reports_sarif_create: true | ||
| blackducksca_reports_sarif_severities: 'BLOCKER,CRITICAL' | ||
| blackducksca_reports_sarif_groupSCAIssues: true | ||
| blackducksca_upload_sarif_report: true | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| detect_args: >- | ||
| --detect.project.name="${{ vars.BLACKDUCK_PROJECT_NAME }}" | ||
| --detect.project.version.name="${{ steps.version.outputs.project_version }}" | ||
| --detect.project.user.groups="${{ vars.BLACKDUCK_PROJECT_GROUP }}" | ||
| --detect.code.location.name="${{ vars.BLACKDUCK_PROJECT_NAME }}/${{ steps.version.outputs.project_version }}" | ||
| --detect.blackduck.signature.scanner.memory=4096 | ||
| --detect.timeout=6000 | ||
| --detect.blackduck.signature.scanner.arguments="--min-scan-interval=0" | ||
| --detect.excluded.directories='**/__pycache__,**/.venv,**/venv,**/env,**/dist,**/build,**/*.egg-info,**/test,**/tests,**/coverage' |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After some thoughts, I think we are doing the right thing to bump separately. And bumping one does not necessarily mean we need to bump the other as long as we are careful about the dependency range in |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: bump | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| package: | ||
| description: 'Package to bump' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - base | ||
| - core | ||
| - gen | ||
|
|
||
| jobs: | ||
| bump: | ||
| runs-on: ubuntu-latest | ||
| permissions: {} | ||
| steps: | ||
| - name: Generate GitHub App token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 | ||
| with: | ||
| client-id: ${{ secrets.SAP_AI_SDK_BOT_CLIENT_ID }} | ||
| private-key: ${{ secrets.SAP_AI_SDK_BOT_PRIVATE_KEY }} | ||
| permission-contents: write | ||
|
|
||
| - name: Setup | ||
| uses: SAP/ai-sdk-python/.github/actions/setup@os-migration | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| persist-credentials: true | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Configure git | ||
| run: | | ||
| git config --local user.email "${{ vars.SAP_AI_SDK_BOT_EMAIL }}" | ||
|
alpkom marked this conversation as resolved.
Dismissed
|
||
| git config --local user.name "${{ vars.SAP_AI_SDK_BOT_NAME }}" | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
github-advanced-security[bot] marked this conversation as resolved.
Fixed
alpkom marked this conversation as resolved.
Dismissed
|
||
|
|
||
| - name: Bump versions and generate changelogs | ||
| working-directory: packages/${{ inputs.package }} | ||
| run: uv run cz bump --changelog | ||
|
|
||
| - name: Push | ||
| working-directory: packages/${{ inputs.package }} | ||
| run: | | ||
| VERSION=$(uv run cz version --project) | ||
| git push origin main | ||
| git push origin "${{ inputs.package }}-v${VERSION}" | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
Uh oh!
There was an error while loading. Please reload this page.