From d645870080ad2ed8db16bb643b47c73afaa82a5d Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Thu, 30 Jul 2026 06:13:51 -0400 Subject: [PATCH 1/3] Run vcpkg bootstrap script with -disableMetrics instead of touching disable-metrics file Replaces the "Disable vcpkg metrics" step (which just dropped a vcpkg.disable-metrics marker file) with a "Bootstrap vcpkg" step that runs bootstrap-vcpkg.bat/.sh -disableMetrics after updating vcpkg, matching the approach already used in worker/windows/install.ps1. Also fixes two now-stale `ty: ignore` comments in SafeGitHubEventHandler that a newer ty release flags as unused/incorrect, unrelated to the vcpkg change but blocking the pre-commit hook. --- master/master.cfg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/master/master.cfg b/master/master.cfg index 42c06ac..19b4a07 100644 --- a/master/master.cfg +++ b/master/master.cfg @@ -580,16 +580,16 @@ def add_vcpkg_step(factory, builder_type): ) if builder_type.os == "windows": - disable_metrics_cmd = Interpolate('type nul > "%(prop:builddir)s\\vcpkg\\vcpkg.disable-metrics"') + bootstrap_cmd = Interpolate('"%(prop:builddir)s\\vcpkg\\bootstrap-vcpkg.bat" -disableMetrics') else: - disable_metrics_cmd = Interpolate('touch "%(prop:builddir)s/vcpkg/vcpkg.disable-metrics"') + bootstrap_cmd = Interpolate('"%(prop:builddir)s/vcpkg/bootstrap-vcpkg.sh" -disableMetrics') factory.addStep( ShellCommand( - name="Disable vcpkg metrics", + name="Bootstrap vcpkg", locks=[performance_lock.access("counting")], - haltOnFailure=False, - command=disable_metrics_cmd, + haltOnFailure=True, + command=bootstrap_cmd, ) ) @@ -1100,7 +1100,7 @@ c["schedulers"] = [ class SafeGitHubEventHandler(GitHubEventHandler): @staticmethod def _log(message): - log.msg(f"SafeGitHubEventHandler: {message}", logLevel=logging.DEBUG) # ty: ignore[possibly-missing-attribute] + log.msg(f"SafeGitHubEventHandler: {message}", logLevel=logging.DEBUG) def handle_push(self, payload, event): ref = payload["ref"] @@ -1132,7 +1132,7 @@ class SafeGitHubEventHandler(GitHubEventHandler): headers["Authorization"] = "token " + token http = yield httpclientservice.HTTPSession( - self.master.httpservice, # ty: ignore[possibly-missing-attribute] + self.master.httpservice, # ty: ignore[unresolved-attribute] self.github_api_endpoint, headers=headers, debug=self.debug, From b0dea66f945d867e1cc41858e813da75514ac3e4 Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Thu, 30 Jul 2026 06:21:18 -0400 Subject: [PATCH 2/3] Sync uv environment before running ty in pre-commit to match CI uv run --package master only syncs master's own dependency set, which doesn't include ty (a root dev-dependency), so a stale ty binary left in the shared .venv from an earlier sync was never reconciled against the lockfile and silently diverged from the pinned version CI uses. Running `uv sync` first forces the venv to match uv.lock every time. Also reverts the previous commit's `ty: ignore` comment changes, which were based on diagnostics from that stale, unpinned ty version. --- .pre-commit-config.yaml | 2 +- master/master.cfg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 35467ea..63c74a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: hooks: - id: ty-check name: ty - entry: uv run --package master ty check --error-on-warning master/master.cfg master/custom_steps.py + entry: bash -c 'uv sync && uv run --package master ty check --error-on-warning master/master.cfg master/custom_steps.py' language: system pass_filenames: false files: ^master/(master\.cfg|custom_steps\.py)$ diff --git a/master/master.cfg b/master/master.cfg index 19b4a07..ab2738e 100644 --- a/master/master.cfg +++ b/master/master.cfg @@ -1100,7 +1100,7 @@ c["schedulers"] = [ class SafeGitHubEventHandler(GitHubEventHandler): @staticmethod def _log(message): - log.msg(f"SafeGitHubEventHandler: {message}", logLevel=logging.DEBUG) + log.msg(f"SafeGitHubEventHandler: {message}", logLevel=logging.DEBUG) # ty: ignore[possibly-missing-attribute] def handle_push(self, payload, event): ref = payload["ref"] @@ -1132,7 +1132,7 @@ class SafeGitHubEventHandler(GitHubEventHandler): headers["Authorization"] = "token " + token http = yield httpclientservice.HTTPSession( - self.master.httpservice, # ty: ignore[unresolved-attribute] + self.master.httpservice, # ty: ignore[possibly-missing-attribute] self.github_api_endpoint, headers=headers, debug=self.debug, From 7a77b96bc088f154d15a79197b0e5f640985e22a Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Thu, 30 Jul 2026 06:24:27 -0400 Subject: [PATCH 3/3] Move ty dev-dependency from root to master package ty only type-checks master/master.cfg and master/custom_steps.py, so it belongs to the master package, not the workspace root. This makes `uv run --package master ty check` resolve and pin ty on its own (installing it fresh on a clean checkout), instead of silently relying on whatever ty happens to already be sitting in the shared .venv from an unrelated root-level sync. Simplifies the pre-commit hook and CI workflow back to a single `uv run --package master ...` call, and `ty` stays out of the production Docker image since it's a dev-only dependency (`--no-dev` still excludes it). --- .github/workflows/validations.yml | 4 +--- .pre-commit-config.yaml | 2 +- master/pyproject.toml | 5 +++++ pyproject.toml | 1 - uv.lock | 10 ++++++++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/validations.yml b/.github/workflows/validations.yml index fd6569a..82d6fa5 100644 --- a/.github/workflows/validations.yml +++ b/.github/workflows/validations.yml @@ -48,9 +48,7 @@ jobs: - uses: astral-sh/setup-uv@v6 - name: Type-check master config - run: | - uv sync - uv run --package master ty check --error-on-warning master/master.cfg master/custom_steps.py + run: uv run --package master ty check --error-on-warning master/master.cfg master/custom_steps.py bandit: runs-on: ubuntu-slim diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 63c74a2..35467ea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: hooks: - id: ty-check name: ty - entry: bash -c 'uv sync && uv run --package master ty check --error-on-warning master/master.cfg master/custom_steps.py' + entry: uv run --package master ty check --error-on-warning master/master.cfg master/custom_steps.py language: system pass_filenames: false files: ^master/(master\.cfg|custom_steps\.py)$ diff --git a/master/pyproject.toml b/master/pyproject.toml index 9caa7f8..eb6a417 100644 --- a/master/pyproject.toml +++ b/master/pyproject.toml @@ -10,3 +10,8 @@ dependencies = [ "twisted>=23.10", "zstandard>=0.22", # log chunk compression (c['logCompressionMethod']) ] + +[dependency-groups] +dev = [ + "ty~=0.0.16", +] diff --git a/pyproject.toml b/pyproject.toml index db00d3c..2ffe232 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,6 @@ requires-python = ">=3.12" [dependency-groups] dev = [ "ruff~=0.15.0", - "ty~=0.0.16", "pre-commit~=4.2", ] diff --git a/uv.lock b/uv.lock index bf088c7..1c9bd8f 100644 --- a/uv.lock +++ b/uv.lock @@ -448,7 +448,6 @@ source = { virtual = "." } dev = [ { name = "pre-commit" }, { name = "ruff" }, - { name = "ty" }, ] [package.metadata] @@ -457,7 +456,6 @@ dev = [ dev = [ { name = "pre-commit", specifier = "~=4.2" }, { name = "ruff", specifier = "~=0.15.0" }, - { name = "ty", specifier = "~=0.0.16" }, ] [[package]] @@ -602,6 +600,11 @@ dependencies = [ { name = "zstandard" }, ] +[package.dev-dependencies] +dev = [ + { name = "ty" }, +] + [package.metadata] requires-dist = [ { name = "buildbot", specifier = "~=4.0" }, @@ -612,6 +615,9 @@ requires-dist = [ { name = "zstandard", specifier = ">=0.22" }, ] +[package.metadata.requires-dev] +dev = [{ name = "ty", specifier = "~=0.0.16" }] + [[package]] name = "msgpack" version = "1.2.1"