-
Notifications
You must be signed in to change notification settings - Fork 26
Adopt vscode-common-python-lsp as a git submodule, synced via repository_dispatch, and stop Dependabot duplicates #695
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
Open
edvilme
wants to merge
22
commits into
main
Choose a base branch
from
shared-package-sync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1a2c0f5
Add shared package release dispatch workflow and stop Dependabot dupl…
edvilme e488b40
Use sed + uv pip compile for the pip dependency update
edvilme cc3220e
Harden shared package release workflow from review feedback
edvilme d1f2a44
Experiment: integrate shared package as a git submodule (#696)
edvilme 2292581
Simplify and harden shared package submodule sync workflow
edvilme 35003ad
Address review feedback on submodule sync and install
edvilme 393f13d
Harden submodule sync workflow and clean dependency metadata
edvilme def29cc
Verify extension/shared-package Python floors in submodule sync
edvilme 4f5a1d6
Split submodule sync into discrete, readable steps
edvilme 7e44824
Document submodule initialization in the README
edvilme dae53d4
Verify extension/shared-package Node versions in submodule sync
edvilme 6022f97
Harden shared-package submodule sync workflow
edvilme c7e5006
Update shared package submodule to v0.8.1
edvilme ca39d20
Probe bare release tags symmetrically in submodule sync
edvilme bcd212a
Parse only a >=/~= lower bound from requires-python
edvilme 4de51fc
Validate the computed branch ref before emitting it
edvilme 1ba3691
Harden tracking-issue lookup in submodule sync
edvilme 40bd139
Guard shared-package postinstall build
edvilme 68b2c64
Document dead shared-package Dependabot ignores as no-ops
edvilme 9ef3e7c
Fix 7: re-notify maintainers on re-dispatch when the sync branch alre…
edvilme 9483820
Fix 8: resolve symbolic minimumPythonVersion constants in the Python …
edvilme b26364c
Fix 9: fail fast with guidance when the shared-package submodule is m…
edvilme 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
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,112 @@ | ||
| name: Shared Package Release Handler | ||
|
|
||
| on: | ||
| repository_dispatch: | ||
| types: [shared-package-release] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| issues: write | ||
|
|
||
| env: | ||
| NODE_VERSION: 24.17.0 | ||
| PYTHON_VERSION: '3.x' | ||
|
|
||
| jobs: | ||
| update-shared-packages: | ||
| name: Update shared packages | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install Node | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
|
|
||
| - name: Install Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
|
|
||
| - name: Normalize release tag | ||
| id: release_version | ||
| env: | ||
| RELEASE_TAG: ${{ github.event.client_payload.release_tag }} | ||
| run: | | ||
| set -euo pipefail | ||
| VERSION="${RELEASE_TAG#v}" | ||
| echo "value=$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Create branch for this release | ||
| env: | ||
| RELEASE_TAG: ${{ github.event.client_payload.release_tag }} | ||
| run: | | ||
| set -euo pipefail | ||
| BRANCH="shared-package-v${RELEASE_TAG#v}" | ||
| git fetch origin main | ||
| git checkout -B "$BRANCH" origin/main | ||
|
|
||
| - name: Update npm dependency | ||
| env: | ||
| NPM_DEP: ${{ github.event.client_payload.npm_dependency }} | ||
| RELEASE_VERSION: ${{ steps.release_version.outputs.value }} | ||
| run: | | ||
| set -euo pipefail | ||
| if [ -z "${NPM_DEP}" ]; then | ||
| echo 'No npm dependency in payload; skipping.' | ||
| exit 0 | ||
| fi | ||
| npm install "${NPM_DEP}@${RELEASE_VERSION}" | ||
|
|
||
| - name: Update pip dependency | ||
| env: | ||
| PIP_DEP: ${{ github.event.client_payload.pip_dependency }} | ||
| RELEASE_VERSION: ${{ steps.release_version.outputs.value }} | ||
| run: | | ||
| set -euo pipefail | ||
| if [ -z "${PIP_DEP}" ]; then | ||
| echo 'No pip dependency in payload; skipping.' | ||
| exit 0 | ||
| fi | ||
| if [ ! -f requirements.in ]; then | ||
| echo 'No requirements.in found; skipping.' | ||
| exit 0 | ||
| fi | ||
| python -m pip install --upgrade uv | ||
| sed -i -E "s/^${PIP_DEP}([<>=!~].*)?\$/${PIP_DEP}==${RELEASE_VERSION}/" requirements.in | ||
| uv pip compile --generate-hashes --upgrade -o requirements.txt requirements.in | ||
|
|
||
| - name: Commit branch and open tracking issue if changed | ||
| env: | ||
| RELEASE_TAG: ${{ github.event.client_payload.release_tag }} | ||
| RELEASE_URL: ${{ github.event.client_payload.release_url }} | ||
| REPO: ${{ github.repository }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| set -euo pipefail | ||
| git config user.name 'github-actions[bot]' | ||
| git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
| if git diff --quiet; then | ||
| echo 'No changes detected.' | ||
| exit 0 | ||
| fi | ||
| BRANCH="shared-package-v${RELEASE_TAG#v}" | ||
| git add -A | ||
| git commit -m "Upgrade shared package to ${RELEASE_TAG}" | ||
| git push --set-upstream origin "$BRANCH" | ||
| COMPARE_URL="https://github.com/${REPO}/compare/main...${BRANCH}?expand=1" | ||
| BODY_FILE="$(mktemp)" | ||
| cat > "$BODY_FILE" <<EOF | ||
| Branch \`${BRANCH}\` has been pushed with the shared package upgrade to ${RELEASE_TAG}. | ||
|
|
||
| Organization settings prevent this workflow from opening pull requests automatically. Please open the PR manually: | ||
|
|
||
| ${COMPARE_URL} | ||
|
|
||
| Source release: ${RELEASE_URL} | ||
| EOF | ||
| gh issue create \ | ||
| --title "[Shared Package] Open PR to upgrade to ${RELEASE_TAG}" \ | ||
| --body-file "$BODY_FILE" | ||
|
edvilme marked this conversation as resolved.
Outdated
|
||
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.