Repository navigation
Reduce PR CI time with parallel image validation, uv and focused AI coverage - #1306
Open
mborodii-prog wants to merge 3 commits into
Open
mborodii-prog wants to merge 3 commits into
mborodii-prog wants to merge 3 commits into
Conversation
4 tasks done
mborodii-prog
marked this pull request as ready for review
November 30, 2026 10:51
This was referenced Nov 30, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
PR CI previously waited for every test matrix before building and smoke-testing its CI image. Start the existing
buildPR check immediately afterconfig, alongside the matrices. Keep registry writes restricted to pushes and retain the existing push validation -> image build -> container test -> digest promotion sequence throughbuild-push.Use pinned, cached uv installs in the pytest jobs, explicitly targeting the setup-python interpreter. Preserve requirements, test pins, local package installation, the pip-based Windows 3.14 lxml workaround, and real pip installation in all package-install smoke jobs. Remove 35 seconds of fixed sleeps from synchronous memory connector tests and report the slowest 25 pytest durations.
Refs #1300. All six PR test combinations remain enabled. In main-target PRs, 28 individually marked real AI cases now run once on Ubuntu 3.13; the other five combinations retain all unmarked tests. Pushes keep their complete existing matrices. No runtime/API behavior changes.
Validation
actionlint 1.7.12 passed (external shellcheck/pyflakes disabled).
Memory connector: 16 passed on Python 3.12 and 3.14; latest focused Python 3.12 run: 0.17s.
pytest-local.ini guard passed on Python 3.12 and 3.14 (70 files).
Fresh uv installs succeeded; Python 3.14 dependency compatibility check passed.
Workflow dependency assertions and git diff --check passed.
The initial CI trial exposed uv incompatibility with the direct
--find-linkslxml wheel URL on Windows 3.14. That exceptional bootstrap now retains its original pip command; the main dependency installs still use uv.Remaining measurements
Before the AI selection change, full six-combination CI and image/process-pool checks passed in cold attempt 1 and warm attempt 2.
Validate the new AI selection in all six GitHub Actions jobs: run 46394831522, all passed.
Record dependency, pytest, image and total wall times for cold and warm uv caches on the same commit; both attempts passed all six combinations.
Enumerate all 28 moved AI node IDs and all seven retained TestExtractAI cases in docs/ci-performance.md. Full main-push coverage stays enabled.
See docs/ci-performance.md for baseline and measurement procedure. The historical run #351 took about 15m40s; local memory-test timings are not evidence of total CI speedup. Push image publication/promotion requires post-merge execution to validate end to end.
Compatibility and rollback
The PR image check retains its
buildidentity. Repository branch-protection/ruleset settings are unchanged. Revert the workflow commit to restore pip setup and serial PR image validation; sleep removal is independently reversible.Initial CI measurements
Cold attempt 1 completed successfully in 12m17s versus 15m46s for historical run #351 (3m29s shorter, about 22%). Windows 3.11 dependency setup including uv took 33s versus 1m33s; pytest step 11m12s versus 12m16s. Image job completed in parallel in 1m20s. Runs differ in commit, runner and external service conditions, so this is an observed comparison, not an isolated benchmark. Warm-cache attempt 2 also passed on the same commit in 12m32s (3m14s shorter than the historical baseline, about 20.5%). Cache hits were confirmed on Ubuntu and Windows.
| Metric | Historical #351 | Cold attempt 1 | Warm attempt 2 |
| --- | ---: | ---: | ---: |
| PR wall time | 15m46s | 12m17s | 12m32s |
| Windows 3.11 setup (uv included where used) | 1m33s | 33s | 39s |
| Windows 3.11 pytest step | 12m16s | 11m12s | 11m30s |
| Image job (including checkout/smoke) | 1m35s, after matrices | 1m20s, parallel | 1m37s, parallel |
The cache itself did not show additional benefit in this pair: Windows setup was 6s slower with a hit, while Ubuntu setup ranged from 4�5s cold to 6�11s warm. Cache restore/unpack has overhead (Ubuntu cache about 197 MB). Keep caching as an evaluated trial; a separate cache-off comparison would be needed to isolate its contribution. Live-service runtimes also varied substantially.
Focused inspection identifies the real lookup performance test and model-creation regressions as live-service candidates for a future once-per-PR lane. Process-pool timing tests must stay in the OS/Python matrix. Do not use whole-file offline exclusions as the reduced PR selector: mixed files also contain deterministic tests. The 28 explicitly listed AI cases now move to post-merge coverage on the other five OS/Python combinations; they still run on Ubuntu 3.13 before merge.
AI selection behavior
Mark 26 real-provider/saved-schema TestExtractAI methods and both real generate.ai methods with
live_ai; no class/file-level exclusions.Only main-target PR combinations other than Ubuntu 3.13 pass
-m "not live_ai". PRs to dev keep all tests on their existing Ubuntu 3.11 job. Push and container selections are unchanged.Retain five deterministic TestExtractAI methods, both real timeout cases, mocked source-column tests, every unmarked AI adapter/unit case and every process-pool check in all six main PR combinations.
Register the marker in setup.cfg and pytest-local.ini. Ordinary local test selection is unchanged.
Exact node-ID discovery: 28 live AI cases, 4157 retained cases, 4185 total. AST comparison confirms every test body/assertion is unchanged. Offline execution: seven deterministic/mock cases passed; actionlint and git diff --check passed.
Each of these 28 cases runs once instead of six times per main-target PR (140 fewer repeated test executions). No assertions, provider models, retries or inputs are weakened. The new CI run passed all six combinations in 12m08s.
AI selection CI result
Run 46394831522 passed in 12m08s on commit
0f13dbc, compared with 12m17s cold / 12m32s warm before this AI change. That is only 9�24s shorter in these observations; external service variation prevents claiming a stable whole-CI gain from one run. The deterministic reduction is 140 repeated test executions per main-target PR.Ubuntu 3.13: 4179 passed, 6 skipped, with all live AI cases included.
All other five combinations: 4151 passed, 6 skipped, 28 deselected each.
Process checks, package installation, schema validation, image smoke and local-config guard passed.
Windows 3.11 remains the critical path. Its longest individual case is the unmodified live lookup timing test at 75.41s. This PR does not filter that test.
The complete per-method deferred-coverage list is in docs/ci-performance.md. Assertions and production code are unchanged. Push filter behavior is statically preserved; actual publication/promotion still requires post-merge execution.
PR replacement
Supersedes #1304 solely to use branch
reduce-pr-ci-time. The initial head commit is unchanged:0f13dbc6656499bd2272c8eeb338ba29d14fdb30. Existing CI evidence above belongs to the same commit in #1304; this replacement will have its own PR checks.