-
Notifications
You must be signed in to change notification settings - Fork 321
fix: swap truncate logic #4971
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
Closed
+101
−9
Closed
fix: swap truncate logic #4971
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion
2
.circleci/get_scm_version.py → .github/scripts/get_scm_version.py
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,4 +1,4 @@ | ||
| from setuptools_scm import get_version | ||
|
|
||
| version = get_version(root='../', relative_to=__file__) | ||
| version = get_version(root='../../', relative_to=__file__) | ||
| print(version.split('+')[0]) |
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,92 @@ | ||
| name: Private Repo Testing | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: 'private-test-${{ github.event.pull_request.number }}' | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| trigger-private-test: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.pull_request.head.repo.full_name == github.repository | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
| - name: Set up Node.js for UI build | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: latest | ||
| - name: Install UI dependencies | ||
| run: pnpm install | ||
| - name: Build UI | ||
| run: pnpm --prefix web/client run build | ||
| - name: Install Python dependencies | ||
| run: | | ||
| python -m venv .venv | ||
| source .venv/bin/activate | ||
| pip install build twine setuptools_scm | ||
| - name: Generate development version | ||
| id: version | ||
| run: | | ||
| source .venv/bin/activate | ||
| # Generate a development version using existing script | ||
| DEV_VERSION=$(python .github/scripts/get_scm_version.py) | ||
| echo "version=$DEV_VERSION" >> $GITHUB_OUTPUT | ||
| echo "Generated development version: $DEV_VERSION" | ||
| - name: Build package | ||
| run: | | ||
| source .venv/bin/activate | ||
| python -m build | ||
| - name: Configure PyPI for private repository | ||
| run: | | ||
| cat > ~/.pypirc << EOF | ||
| [distutils] | ||
| index-servers = tobiko-private | ||
| [tobiko-private] | ||
| repository = ${{ secrets.TOBIKO_PRIVATE_PYPI_URL }} | ||
| username = _json_key_base64 | ||
| password = ${{ secrets.TOBIKO_PRIVATE_PYPI_KEY }} | ||
| EOF | ||
| - name: Publish to private PyPI | ||
| run: | | ||
| source .venv/bin/activate | ||
| python -m twine upload -r tobiko-private dist/* | ||
| - name: Get commit information | ||
| id: commit | ||
| run: | | ||
| echo "author=$(git log -1 --format='%an')" >> $GITHUB_OUTPUT | ||
| echo "hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
| echo "message=$(git log -1 --format='%s')" >> $GITHUB_OUTPUT | ||
| - name: Trigger private repository workflow | ||
| uses: convictional/[email protected] | ||
| with: | ||
| owner: ${{ secrets.PRIVATE_REPO_OWNER }} | ||
| repo: ${{ secrets.PRIVATE_REPO_NAME }} | ||
| github_token: ${{ secrets.PRIVATE_REPO_TOKEN }} | ||
| workflow_file_name: ${{ secrets.PRIVATE_WORKFLOW_FILE }} | ||
| client_payload: | | ||
| { | ||
| "package_version": "${{ steps.version.outputs.version }}", | ||
| "python_version": "3.12", | ||
| "author": "${{ steps.commit.outputs.author }}", | ||
| "hash": "${{ steps.commit.outputs.hash }}", | ||
| "message": "${{ steps.commit.outputs.message }}", | ||
| "pr_number": "${{ github.event.pull_request.number }}" | ||
| } | ||
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
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.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 6 months ago
To address the issue, we will add a
permissionsblock at the root of the workflow file to define the least privileges required for the task. Based on the workflow's operations:actions/checkout, which requirescontents: readto access repository files.twine, and triggers a private repository workflow, which might involve using secrets but does not require additional write permissions to repository contents.Thus, adding
permissions: contents: readat the root level is appropriate to ensure minimal permissions while allowing the workflow to function correctly.