-
Notifications
You must be signed in to change notification settings - Fork 34
Adopt vscode-common-python-lsp as a git submodule, synced via repository_dispatch, and stop Dependabot duplicates #547
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
Merged
Eduardo Villalpando Mello (edvilme)
merged 25 commits into
main
from
shared-package-sync
Jul 22, 2026
Merged
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
5af883d
Add shared package release dispatch workflow and stop Dependabot dupl…
edvilme 6c8d828
Use sed + uv pip compile for the pip dependency update
edvilme 5ed122e
Harden shared package release workflow from review feedback
edvilme 6f89692
Experiment: integrate shared package as a git submodule (#548)
edvilme adac6da
Simplify and harden shared package submodule sync workflow
edvilme abb9d2f
Address review feedback on submodule sync and install
edvilme 265ac1d
Harden submodule sync workflow and clean dependency metadata
edvilme 77cd50c
Verify extension/shared-package Python floors in submodule sync
edvilme 5df2f6f
Split submodule sync into discrete, readable steps
edvilme bc2f1ce
Document submodule initialization in the README
edvilme b47dff7
Verify extension/shared-package Node versions in submodule sync
edvilme 8966f46
Harden shared-package submodule sync workflow
edvilme 478041e
Update shared package submodule to v0.8.1
edvilme 7541d64
Probe bare release tags symmetrically in submodule sync
edvilme 85bfbe5
Parse only a >=/~= lower bound from requires-python
edvilme f3de76d
Validate the computed branch ref before emitting it
edvilme 2f51bb7
Harden tracking-issue lookup in submodule sync
edvilme fd914ac
Guard shared-package postinstall build
edvilme d2cad3a
Document dead shared-package Dependabot ignores as no-ops
edvilme 8b314f1
Fix 7: re-notify maintainers on re-dispatch when the sync branch alre…
edvilme d0bb0ba
Fix 8: resolve symbolic minimumPythonVersion constants in the Python …
edvilme 272b876
Fix 9: fail fast with guidance when the shared-package submodule is m…
edvilme 2516b49
Harden Node/Python floor parsing so an unparseable floor warns and sk…
edvilme e98818c
Clarify that non-recursive clones fail at file: resolution, not posti…
edvilme c1225f0
Make the tracking-issue title canonical and flag the branch as unvali…
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
Some comments aren't visible on the classic Files Changed page.
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
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,157 @@ | ||
| name: Shared Package Submodule Sync | ||
|
|
||
| on: | ||
| repository_dispatch: | ||
| types: [shared-package-release] | ||
|
edvilme marked this conversation as resolved.
|
||
|
|
||
| permissions: | ||
| contents: write | ||
| issues: write | ||
|
|
||
| env: | ||
| SUBMODULE_PATH: external/vscode-common-python-lsp | ||
|
|
||
|
edvilme marked this conversation as resolved.
|
||
| jobs: | ||
| prepare: | ||
| name: Validate and normalize the release | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version: ${{ steps.normalize.outputs.version }} | ||
| branch: ${{ steps.normalize.outputs.branch }} | ||
| steps: | ||
| - name: Normalize release tag | ||
| id: normalize | ||
| env: | ||
| RELEASE_TAG: ${{ github.event.client_payload.release_tag }} | ||
| run: | | ||
| set -euo pipefail | ||
| # Require a real dotted release so a branch/ref name can never be malformed. | ||
| if ! printf '%s' "${RELEASE_TAG}" | grep -Eq '^v?[0-9]+\.[0-9]+\.[0-9]+([-+][0-9A-Za-z.]+)*$'; then | ||
| echo "::error::release_tag '${RELEASE_TAG:-<empty>}' is missing or not a valid semver release." | ||
| exit 1 | ||
| fi | ||
| VERSION="${RELEASE_TAG#v}" | ||
| { | ||
| echo "version=${VERSION}" | ||
| echo "branch=shared-package-v${VERSION}" | ||
| } >>"$GITHUB_OUTPUT" | ||
|
|
||
| sync: | ||
| name: Update shared package submodule | ||
| needs: prepare | ||
| runs-on: ubuntu-latest | ||
| # Key on the normalized branch so `v1.2.3` and `1.2.3` share one group. | ||
| concurrency: | ||
| group: shared-package-submodule-${{ needs.prepare.outputs.branch }} | ||
| cancel-in-progress: false | ||
| env: | ||
| VERSION: ${{ needs.prepare.outputs.version }} | ||
| BRANCH: ${{ needs.prepare.outputs.branch }} | ||
| RELEASE_TAG: ${{ github.event.client_payload.release_tag }} | ||
| RELEASE_URL: ${{ github.event.client_payload.release_url }} | ||
| REPO: ${{ github.repository }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
|
|
||
| - name: Update submodule and open tracking issue | ||
| run: | | ||
|
edvilme marked this conversation as resolved.
Outdated
|
||
| set -euo pipefail | ||
|
|
||
| # Retry wrapper for flaky network operations (fetch/push). | ||
| retry() { | ||
| local attempt=1 | ||
| until "$@"; do | ||
| if [ "${attempt}" -ge 3 ]; then | ||
| echo "::error::Command failed after ${attempt} attempts: $*" | ||
| return 1 | ||
| fi | ||
| echo "Attempt ${attempt} failed: $* — retrying..." >&2 | ||
| attempt=$((attempt + 1)) | ||
| sleep $((attempt * 5)) | ||
| done | ||
| } | ||
|
|
||
| # 1. Never clobber an existing release branch: once it exists a | ||
| # maintainer may be editing it, so this workflow leaves it alone. | ||
| if git ls-remote --exit-code --heads origin "refs/heads/${BRANCH}" >/dev/null 2>&1; then | ||
| echo "Branch ${BRANCH} already exists; leaving it untouched." | ||
|
edvilme marked this conversation as resolved.
|
||
| exit 0 | ||
| fi | ||
|
edvilme marked this conversation as resolved.
|
||
|
|
||
| # 2. Build the release branch from the latest main. | ||
| retry git fetch origin main | ||
| git checkout -B "${BRANCH}" FETCH_HEAD | ||
| git submodule update --init --recursive "${SUBMODULE_PATH}" | ||
|
|
||
| # 3. Move the submodule to the released commit (fail if the tag is unknown). | ||
| ( | ||
| cd "${SUBMODULE_PATH}" | ||
| retry git fetch --tags --force origin | ||
| TARGET='' | ||
| for CANDIDATE in "refs/tags/${RELEASE_TAG}" "refs/tags/v${VERSION}"; do | ||
| if git rev-parse -q --verify "${CANDIDATE}^{commit}" >/dev/null; then | ||
| TARGET="${CANDIDATE}" | ||
| break | ||
| fi | ||
| done | ||
| if [ -z "${TARGET}" ]; then | ||
| echo "::error::Release tag '${RELEASE_TAG}' was not found in the shared package repository." | ||
| exit 1 | ||
| fi | ||
| echo "Checking out submodule at ${TARGET}." | ||
| git checkout --detach "${TARGET}" | ||
| ) | ||
|
|
||
| # 4. Stop early if the submodule pointer did not move. | ||
|
edvilme marked this conversation as resolved.
Outdated
|
||
| if git diff --quiet -- "${SUBMODULE_PATH}"; then | ||
| echo "Submodule already at ${RELEASE_TAG}; nothing to do." | ||
| exit 0 | ||
| fi | ||
|
|
||
|
edvilme marked this conversation as resolved.
edvilme marked this conversation as resolved.
|
||
| # 5. Refresh the lockfile so the branch stays `npm ci`-mergeable, then | ||
| # commit both the submodule pointer and the regenerated lockfile. | ||
| npm install --package-lock-only --ignore-scripts | ||
| git config user.name 'github-actions[bot]' | ||
| git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
| git add "${SUBMODULE_PATH}" package-lock.json | ||
| git commit -m "Update shared package submodule to ${RELEASE_TAG}" | ||
| # New branch only (guarded above), so a plain push cannot overwrite work. | ||
| retry git push --set-upstream origin "${BRANCH}" | ||
|
|
||
| # 6. Point a maintainer at the compare page via the job summary and a tracking issue. | ||
| COMPARE_URL="https://github.com/${REPO}/compare/main...${BRANCH}?expand=1" | ||
|
edvilme marked this conversation as resolved.
|
||
| TITLE="[Shared Package] Open PR to update submodule to ${RELEASE_TAG}" | ||
| BODY_FILE="$(mktemp)" | ||
| { | ||
| echo "### Shared package submodule update ready" | ||
| echo '' | ||
| echo "Branch \`${BRANCH}\` has been pushed, moving \`${SUBMODULE_PATH}\` to ${RELEASE_TAG}." | ||
| echo '' | ||
| echo 'Organization settings prevent this workflow from opening pull requests automatically. Please open it manually:' | ||
| echo '' | ||
| echo "[Open the pull request](${COMPARE_URL})" | ||
| echo '' | ||
| echo "Source release: ${RELEASE_URL:-n/a}" | ||
| } | tee -a "$GITHUB_STEP_SUMMARY" >"$BODY_FILE" | ||
|
|
||
| # Reuse an existing open tracking issue for this release if present. | ||
| EXISTING="$(gh issue list --repo "$REPO" --state open \ | ||
| --search "in:title ${TITLE}" --json number,title \ | ||
| --jq "map(select(.title == \"${TITLE}\")) | .[0].number // empty" 2>/dev/null || true)" | ||
| if [ -n "${EXISTING}" ]; then | ||
| echo "Reusing existing tracking issue #${EXISTING}." | ||
| gh issue comment "${EXISTING}" --repo "$REPO" --body-file "$BODY_FILE" \ | ||
| || echo 'Could not comment on the tracking issue; the compare URL is in the job summary.' | ||
| else | ||
| gh issue create --repo "$REPO" --title "${TITLE}" --body-file "$BODY_FILE" \ | ||
| || echo 'Could not create the tracking issue; the compare URL is in the job summary.' | ||
| fi | ||
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,3 @@ | ||
| [submodule "external/vscode-common-python-lsp"] | ||
| path = external/vscode-common-python-lsp | ||
| url = https://github.com/microsoft/vscode-common-python-lsp.git |
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 |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| .vscode-test/** | ||
| out/** | ||
| node_modules/** | ||
| external/** | ||
| src/** | ||
| .gitignore | ||
| .yarnrc | ||
|
|
||
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
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
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,19 @@ | ||
| // Builds the shared package that lives in the git submodule after install. | ||
| // | ||
| // The build is skipped (with guidance) when the submodule has not been | ||
| // checked out, so a clone made without `--recurse-submodules` does not fail | ||
| // `npm install`/`npm ci` at the postinstall step with a confusing error. | ||
| const { existsSync } = require("fs"); | ||
| const { execSync } = require("child_process"); | ||
|
|
||
| const pkgDir = "external/vscode-common-python-lsp/typescript"; | ||
|
|
||
| if (!existsSync(`${pkgDir}/package.json`)) { | ||
| console.warn( | ||
| `[postinstall] Shared package submodule not found at "${pkgDir}". ` + | ||
| "Run `git submodule update --init --recursive` and reinstall to build it.", | ||
| ); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| execSync(`npm --prefix ${pkgDir} run build`, { stdio: "inherit" }); |
Submodule vscode-common-python-lsp
added at
74080a
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.
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.