Skip to content

Commit 65c6eba

Browse files
committed
ci: use uv run --no-sync and guard SPA build in CI
P1.2 — add --no-sync to all bare uv run calls so CI never re-syncs the project (and fires setup.py's build_ui.sh hook) after the venv has already been restored from cache: makefiles/ci.mk — ruff check/format (lines 7, 8, 12); arch validators now use uv run --no-sync python instead of bare shebang calls (cqrs, clean, imports, file-sizes) makefiles/quality.mk — ruff format/check in format/lint targets; validate_workflows.py makefiles/dev.mk — pytest in system-tests, test-no-live, test-providers, test-architecture makefiles/providers.mk — pytest in unit/mocked/contract/all targets; live-test target keeps its --extra sync but gains ORB_SKIP_UI_BUILD=1 prefix so the sync cannot fire the SPA build dev-tools/setup/run_tool.sh — all six uv run execution paths P1.3 — set ORB_SKIP_UI_BUILD: "1" at workflow-level env in ci-quality, ci-tests, security-code, docs, and reusable-test so any accidental implicit sync can never trigger build_ui.sh.
1 parent 94ab324 commit 65c6eba

9 files changed

Lines changed: 49 additions & 26 deletions

File tree

.github/workflows/ci-quality.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ concurrency:
3535
permissions:
3636
contents: read
3737

38+
# Belt-and-suspenders: prevent any accidental implicit uv sync from firing
39+
# the SPA build hook (setup.py build_ui.sh) in this workflow.
40+
env:
41+
ORB_SKIP_UI_BUILD: "1"
42+
3843
jobs:
3944
config:
4045
name: Configuration

.github/workflows/ci-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ concurrency:
3838
permissions:
3939
contents: read
4040

41+
# Belt-and-suspenders: prevent any accidental implicit uv sync from firing
42+
# the SPA build hook (setup.py build_ui.sh) in this workflow.
43+
# Exception: build-and-package sets ORB_SKIP_UI_BUILD=1 on its own step env
44+
# because it intentionally skips the UI build for the CI-only wheel artifact.
45+
env:
46+
ORB_SKIP_UI_BUILD: "1"
47+
4148
jobs:
4249
config:
4350
name: Configuration

.github/workflows/docs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ concurrency:
3636
group: "pages"
3737
cancel-in-progress: false
3838

39+
# Belt-and-suspenders: prevent any accidental implicit uv sync from firing
40+
# the SPA build hook (setup.py build_ui.sh) in this workflow.
41+
env:
42+
ORB_SKIP_UI_BUILD: "1"
43+
3944
jobs:
4045
config:
4146
name: Get Configuration

.github/workflows/reusable-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ env:
9292
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-key }}
9393
ENVIRONMENT: ${{ inputs.environment }}
9494
TESTING: ${{ inputs.testing-flag }}
95+
# Belt-and-suspenders: prevent any accidental implicit uv sync from firing
96+
# the SPA build hook (setup.py build_ui.sh) in test jobs.
97+
ORB_SKIP_UI_BUILD: "1"
9598

9699
jobs:
97100
test:

dev-tools/setup/run_tool.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ run_tool() {
105105
adjusted_args=$(adjust_relative_args "$project_root" "$@")
106106
if [ -n "$adjusted_args" ]; then
107107
# shellcheck disable=SC2086
108-
(cd "$project_root" && uv run "${TOOL_NAME}" $adjusted_args)
108+
(cd "$project_root" && uv run --no-sync "${TOOL_NAME}" $adjusted_args)
109109
else
110-
(cd "$project_root" && uv run "${TOOL_NAME}")
110+
(cd "$project_root" && uv run --no-sync "${TOOL_NAME}")
111111
fi
112112
else
113-
uv run "${TOOL_NAME}" "$@"
113+
uv run --no-sync "${TOOL_NAME}" "$@"
114114
fi
115115
elif [ -f ".venv/bin/${TOOL_NAME}" ] && venv_usable ".venv"; then
116116
echo "Executing with venv..."
@@ -125,12 +125,12 @@ run_tool() {
125125
adjusted_args=$(adjust_relative_args "$project_root" "$@")
126126
if [ -n "$adjusted_args" ]; then
127127
# shellcheck disable=SC2086
128-
(cd "$project_root" && uv run python -m "${TOOL_NAME}" $adjusted_args)
128+
(cd "$project_root" && uv run --no-sync python -m "${TOOL_NAME}" $adjusted_args)
129129
else
130-
(cd "$project_root" && uv run python -m "${TOOL_NAME}")
130+
(cd "$project_root" && uv run --no-sync python -m "${TOOL_NAME}")
131131
fi
132132
else
133-
uv run python -m "${TOOL_NAME}" "$@"
133+
uv run --no-sync python -m "${TOOL_NAME}" "$@"
134134
fi
135135
else
136136
python3 -m "${TOOL_NAME}" "$@"

makefiles/ci.mk

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
# Individual code quality targets (with tool names)
55
ci-quality-ruff: dev-install ## Run Ruff formatting and linting check (basic rules only)
66
@echo "Running Ruff formatting and linting check (basic rules only)..."
7-
@uv run ruff check --select W,F,I --ignore E501 --quiet .
8-
@uv run ruff format --check --quiet .
7+
@uv run --no-sync ruff check --select W,F,I --ignore E501 --quiet .
8+
@uv run --no-sync ruff format --check --quiet .
99

1010
ci-quality-ruff-optional: ## Run Ruff extended linting (warnings only)
1111
@echo "Running Ruff extended linting..."
12-
uv run ruff check --select=E501,N,UP,B,PL,C90,RUF . || true
12+
uv run --no-sync ruff check --select=E501,N,UP,B,PL,C90,RUF . || true
1313

1414
ci-quality-radon: ## Run radon complexity analysis
1515
@echo "Running radon complexity analysis..."
@@ -28,19 +28,19 @@ ci-quality-full: ci-quality-ruff ci-quality-ruff-optional ci-quality-pyright ##
2828
# Individual architecture quality targets (with tool names)
2929
ci-arch-cqrs: ## Run CQRS pattern validation
3030
@echo "Running CQRS pattern validation..."
31-
./dev-tools/quality/validate_cqrs.py
31+
uv run --no-sync python ./dev-tools/quality/validate_cqrs.py
3232

3333
ci-arch-clean: ## Run Clean Architecture dependency validation
3434
@echo "Running Clean Architecture validation..."
35-
./dev-tools/quality/check_architecture.py
35+
uv run --no-sync python ./dev-tools/quality/check_architecture.py
3636

3737
ci-arch-imports: dev-install ## Run import validation
3838
@echo "Running import validation..."
39-
uv run python ./dev-tools/quality/validate_imports.py
39+
uv run --no-sync python ./dev-tools/quality/validate_imports.py
4040

4141
ci-arch-file-sizes: ## Check file size compliance
4242
@echo "Running file size checks..."
43-
./dev-tools/quality/dev_tools_runner.py check-file-sizes --warn-only
43+
uv run --no-sync python ./dev-tools/quality/dev_tools_runner.py check-file-sizes --warn-only
4444

4545
ci-arch-lint-imports: dev-install ## Run import-linter layer-boundary contracts
4646
@echo "Running import-linter layer-boundary checks..."

makefiles/dev.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ test-report: dev-install ## Generate comprehensive test report (PRESERVE: used
6060
./dev-tools/testing/run_tests.py --all --coverage --junit-xml=test-results-combined.xml --cov-xml=coverage-combined.xml --html-coverage --maxfail=1 --timeout=60
6161

6262
system-tests: dev-install ## Run system integration tests (real AWS)
63-
@uv run python -m pytest tests/providers/aws/live/test_onaws.py -v -m manual_aws --no-cov --tb=long
63+
@uv run --no-sync python -m pytest tests/providers/aws/live/test_onaws.py -v -m manual_aws --no-cov --tb=long
6464

6565
# Backward compatibility aliases (direct calls to avoid loops)
6666
test-unit: dev-install
@@ -109,14 +109,14 @@ _HALF_CPU := $(shell python3 -c 'import os; print(max(1, (os.cpu_count() or 2) /
109109
PYTEST_WORKERS ?= $(_HALF_CPU)
110110

111111
test-no-live: dev-install ## Run all tests except live cloud suites (pre-PR check)
112-
@uv run pytest --no-cov -q -ra -n $(PYTEST_WORKERS) --ignore=tests/providers/aws/live
112+
@uv run --no-sync pytest --no-cov -q -ra -n $(PYTEST_WORKERS) --ignore=tests/providers/aws/live
113113

114114
test-providers: dev-install ## Run all provider tests except live
115-
@uv run pytest --no-cov -q -ra -n $(PYTEST_WORKERS) tests/providers --ignore=tests/providers/aws/live
115+
@uv run --no-sync pytest --no-cov -q -ra -n $(PYTEST_WORKERS) tests/providers --ignore=tests/providers/aws/live
116116

117117

118118
test-architecture: dev-install ## Run architecture compliance tests
119-
@uv run pytest --no-cov -q -ra -n $(PYTEST_WORKERS) tests/unit/architecture tests/unit/test_architectural_compliance.py
119+
@uv run --no-sync pytest --no-cov -q -ra -n $(PYTEST_WORKERS) tests/unit/architecture tests/unit/test_architectural_compliance.py
120120

121121
# Dummy targets removed (consolidated in quality.mk)
122122

makefiles/providers.mk

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,37 @@ endef
3333
define _provider_targets
3434
test-providers-$(1)-unit: dev-install ## Run $(1) provider unit tests
3535
@if [ -d tests/providers/$(1)/unit ]; then \
36-
uv run pytest --no-cov -q -ra $(call _workers_flag,$(1)) tests/providers/$(1)/unit; \
36+
uv run --no-sync pytest --no-cov -q -ra $(call _workers_flag,$(1)) tests/providers/$(1)/unit; \
3737
else \
3838
echo "no unit tests for $(1)"; \
3939
fi
4040

4141
test-providers-$(1)-mocked: dev-install ## Run $(1) provider mocked tests (in-process API mock)
4242
@if [ -d tests/providers/$(1)/mocked ]; then \
43-
uv run pytest --no-cov -q -ra $(call _workers_flag,$(1)) tests/providers/$(1)/mocked; \
43+
uv run --no-sync pytest --no-cov -q -ra $(call _workers_flag,$(1)) tests/providers/$(1)/mocked; \
4444
else \
4545
echo "no mocked tests for $(1)"; \
4646
fi
4747

4848
test-providers-$(1)-contract: dev-install ## Run $(1) provider contract tests
4949
@if [ -d tests/providers/$(1)/contract ]; then \
50-
uv run pytest --no-cov -q -ra $(call _workers_flag,$(1)) tests/providers/$(1)/contract; \
50+
uv run --no-sync pytest --no-cov -q -ra $(call _workers_flag,$(1)) tests/providers/$(1)/contract; \
5151
else \
5252
echo "no contract tests for $(1)"; \
5353
fi
5454

55+
# Live tests must sync the provider extra (--extra installs the cloud SDK).
56+
# ORB_SKIP_UI_BUILD=1 prevents setup.py's build_ui.sh hook from firing during
57+
# that extra-sync without stripping the --extra flag.
5558
test-providers-$(1)-live: dev-install ## Run $(1) provider live tests (real cloud / cluster)
5659
@if [ -d tests/providers/$(1)/live ]; then \
57-
uv run --extra $$(or $$(EXTRAS_$(1)),$(1)) pytest --no-cov -q -ra $(call _workers_flag,$(1)) $$(or $$(LIVE_GATE_$(1)),--run-$(1)) tests/providers/$(1)/live; \
60+
ORB_SKIP_UI_BUILD=1 uv run --extra $$(or $$(EXTRAS_$(1)),$(1)) pytest --no-cov -q -ra $(call _workers_flag,$(1)) $$(or $$(LIVE_GATE_$(1)),--run-$(1)) tests/providers/$(1)/live; \
5861
else \
5962
echo "no live tests for $(1)"; \
6063
fi
6164

6265
test-providers-$(1): dev-install ## Run all non-live $(1) provider tests
63-
@uv run pytest --no-cov -q -ra $(call _workers_flag,$(1)) tests/providers/$(1) --ignore=tests/providers/$(1)/live
66+
@uv run --no-sync pytest --no-cov -q -ra $(call _workers_flag,$(1)) tests/providers/$(1) --ignore=tests/providers/$(1)/live
6467

6568
endef
6669

makefiles/quality.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ format: dev-install ## Format code (usage: make format [fix])
99
@if echo "$(MAKECMDGOALS)" | grep -q "fix"; then \
1010
./dev-tools/quality/quality_dispatcher.py fix; \
1111
else \
12-
uv run ruff format --check --quiet .; \
12+
uv run --no-sync ruff format --check --quiet .; \
1313
fi
1414

1515
lint: dev-install ## Lint code (usage: make lint [optional])
1616
@if echo "$(MAKECMDGOALS)" | grep -q "optional"; then \
17-
uv run ruff check --select=N,UP,B,PL,C90,RUF --quiet . || true; \
17+
uv run --no-sync ruff check --select=N,UP,B,PL,C90,RUF --quiet . || true; \
1818
else \
19-
uv run ruff check --quiet .; \
19+
uv run --no-sync ruff check --quiet .; \
2020
fi
2121

2222
validate: lint ci-tests-unit ## Run all validation checks
@@ -136,7 +136,7 @@ validate-workflow-syntax: dev-install ## Validate GitHub Actions workflow YAML
136136
@echo "Validating workflow files..."
137137
# Use 'uv run' because this script imports PyYAML (third-party package)
138138
# Other dev-tools scripts use only standard library so work with shebang
139-
uv run ./dev-tools/quality/validate_workflows.py
139+
uv run --no-sync ./dev-tools/quality/validate_workflows.py
140140

141141
validate-workflow-logic: dev-install ## Validate GitHub Actions workflows with actionlint
142142
@echo "Validating workflows with actionlint..."

0 commit comments

Comments
 (0)