Repository navigation
fix(ci): harden release builds, promotion, and terminal coverage - #745
mergify[bot] merged 2 commits into
Conversation
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed commit 276f18c. No blocking defects found in the changed implementation.
The Docker check validates the dependency-inputs stage inherited by the production builder, including full locked dependency resolution rather than only planner metadata. The existing required check aggregates applicable lint and Docker results fail-closed. Workspace shard coverage and explicit vendor scoping address the omitted build inputs without adding a separate production build definition.
For publication, I traced normal publication, draft recovery, and already-published recovery through the existing globally serialized workflow. Numeric version comparison independently protects latest and the minor line; pagination/schema/transport failures produce no promotion outputs, while unknown stable tags freeze both mutable aliases. GitHub publication precedes Docker promotion, preserving the release inventory as the workflow's high-water mark.
The test additions exercise actual workflow shell bodies for alias selection, aggregate failures/cancellations/skips, and apt source/update/install failures. The separate terminal invocations select both readers, and the existing PTY entrypoints cover malformed/late responses, input preservation, timeout fallback, and interrupt/terminal restoration rather than only parser units.
Validation: I ran all 77 Python CI tests: 76 passed; one test's three dependency-resolution subcases could not execute because Cargo is absent in this environment. git diff --check passed. Independently observed on this head in GitHub Actions: Docker dependency validation, repository validation, actionlint, CI contracts, and both Linux/macOS vendored-terminal jobs passed. The PTY jobs, main Rust suites, and remaining static checks were still running at the last check. I did not locally execute Rust/PTY tests, full application-image builds, hosted apt installation, or live release publication. This approval does not imply those pending gates have passed.
Rechecked the PR head and review history immediately before submitting; the reviewed SHA is unchanged.
Merge Queue Status
This pull request spent 25 seconds in the queue, including 3 seconds running CI. Required conditions to merge
|
#746) ## Summary Stabilize the fragmented-response PTY fixture and add useful failure diagnostics after the macOS terminal PTY lane failed on main. - Replace one write/sleep per byte with four deliberate chunks, splitting the opening ESC, ST terminator, and RGB payload. Pace them against absolute offsets instead of accumulating relative sleep overshoot. - Keep the real 300 ms startup deadline, parser deadlines, expected light/dark result, input-preservation checks, and terminal-restoration checks unchanged. No retries or ignored tests are added. - Include parent query-observation, response-write, DA1-write, and readiness timestamps in test failure output, alongside the child's startup duration and decoded colors/theme/events. - Add a parser unit test that feeds foreground and background replies byte by byte without sleeps, complementing the existing every-split-boundary test. PTY writes can be coalesced by the OS, so exact bytewise parsing coverage belongs in the parser tests. - Document the fixture and timing fields in the vendor patch notes. ## Related issue Follow-up to #745 and [the failing macOS PTY job](https://github.com/matrixorigin/Astra/actions/runs/34433056760/job/102732449999). That run passed every other job, including Linux PTY and the previously repaired Docker layout contract. The failure was `pty_detects_light_dark_and_fragmented_responses`: the `fragmented` case expected light mode but received dark mode. Accumulated sender scheduling delays are a plausible cause, not proven by the old logs, which did not include timing or the complete probe result. Thirty local repetitions of the old fixture did not reproduce the failure. This change removes the avoidable accumulated-sleep dependency and adds evidence for any remaining failures; it does not claim to have conclusively reproduced the runner's original timing. ## Change type - [ ] Feature - [x] Bug fix - [x] Documentation - [ ] Refactor or performance improvement - [x] Test - [x] Build, CI, or maintenance ## User and compatibility impact None for application behavior, APIs, credentials, or database schemas. Only test fixtures, test diagnostics, a parser unit test, and patch documentation change. Product timeouts and terminal parsing behavior remain unchanged. Diagnostics contain synthetic test-terminal data, not user terminal content. ## Architecture and complexity delta N/A for production architecture. - Canonical owner changed or extended: existing CLI terminal-startup PTY harness and vendored Unix parser tests. - Existing implementations and callers searched: `StartupTerminal::begin`, `query_startup_attributes`, parser escape/response deadlines, PTY sender and assertions, and both CI reader invocations. - Superseded code, states, tables, shims, or self-only tests removed: per-byte relative sleeps in the end-to-end sender; no product implementation removed. - If parallel implementations remain, their boundary and retirement condition: none. Unit tests force exact parser fragmentation; PTY tests exercise the real startup/reader/terminal lifecycle. ## Verification Commands and results on local macOS ARM: - `cargo test --locked -p astra-cli --lib tui::terminal_startup -- --test-threads=2`: **14 passed**. - `cargo test --locked -p astra-cli --lib --features crossterm/use-dev-tty tui::terminal_startup -- --test-threads=2`: **14 passed**. - Repeated `tui::terminal_startup::pty_tests::pty_detects_light_dark_and_fragmented_responses` directly from each freshly built test executable: **50 runs per reader**, two concurrent processes, **zero failures**, with no retries. Each run covers light, fragmented, background-only, and dark cases. - `cargo test --locked --manifest-path vendor/crossterm/Cargo.toml --lib --features event-stream`: **106 passed, 7 ignored**. - `cargo test --locked --manifest-path vendor/crossterm/Cargo.toml --lib --features event-stream,use-dev-tty`: **106 passed, 7 ignored**. - `python3 -m unittest discover -s scripts/ci -p 'test_*.py'`: **77 passed**. - `python3 scripts/ci/validate_repository.py`: **passed**. - `cargo fmt --all --check`: **passed**. - `rustfmt --check --edition 2021 vendor/crossterm/src/event/source/unix/parser.rs`: **passed**. - `git diff --check`: **passed**. Public entrypoint exercised: real CLI startup, terminal guard, event reader, and EventStream through isolated PTYs; no model or service required. Unhappy paths exercised: existing unsupported/late/malformed responses, timeouts, interrupted startup/handoff, escape/input preservation, and terminal-mode restoration tests remain enabled and passed for both readers. Database verification: not applicable. Limits: the original GitHub macOS failure was not reproduced locally; hosted macOS/Linux verification remains for CI. Full workspace Rust suites and release images were not rebuilt for this test-only change. The local CLI links emitted the existing `__eh_frame` size warning; selected tests passed. ## Final checklist - [x] I added or updated tests at the layer that owns the behavior, or explained why no test is needed. - [x] I updated public or design documentation for contract changes, or the change needs no documentation update. - [x] I checked the diff for credentials, private URLs, customer data, generated files, and other sensitive information. - [x] The PR title follows the repository's Conventional Commit format. Approved-by: XuPeng-SH <[email protected]>
Summary
Fix the related CI/release issues in one branch:
dependency-inputsstage that both CI and the real builder use: hydrate the cargo-chef skeleton, then run full locked dependency resolution. Planner-only/no-deps checks did not catch missing builder inputs.checkas their fail-closed aggregate.use-dev-ttyreaders on Linux/macOS. Commit the vendor test lockfile and explicitly route vendor changes to Rust scopes.Related issue
No separate issue linked. This follows the CI/release review and the failed release build investigation in this Actions run.
Change type
User and compatibility impact
No application API, database schema, model behavior, or authentication changes.
Release recovery can publish an older fixed version without downgrading newer aliases. An unrecognized published stable tag disables GitHub latest and both Docker rolling aliases until the inventory is corrected, but no longer strands an otherwise verified fixed-version release in draft.
PRs changing Rust inputs now have a Docker dependency-resolution gate; lint does not wait for that build. Terminal reader regressions are exercised on both Unix backends, and the standalone vendor test dependencies are locked.
Architecture and complexity delta
N/A for runtime architecture; only build/test/publication owners change.
Verification
Commands and results (local macOS ARM):
python3 -m unittest discover -s scripts/ci -p 'test_*.py': 76 passed.python3 scripts/ci/validate_repository.py: passed.actionlint: passed.git diff --check: passed.cargo test --locked -p astra-cli --lib tui::terminal_startup -- --test-threads=2: 14 passed.cargo test --locked -p astra-cli --lib --features crossterm/use-dev-tty tui::terminal_startup -- --test-threads=2: 14 passed.cargo test --locked --manifest-path vendor/crossterm/Cargo.toml --lib --features event-stream: 105 passed, 7 ignored.cargo test --locked --manifest-path vendor/crossterm/Cargo.toml --lib --features event-stream,use-dev-tty: 105 passed, 7 ignored.docker build --target dependency-inputs --progress plain .: passed, including a repeat build with cache hits. This is the native ARM dependency stage, not a full server-image build.Public entrypoints exercised: actual Docker dependency-stage build, actual workflow shell steps under deterministic command stubs, and real CLI terminal startup through PTYs.
Unhappy paths: arbitrary missing patched dependencies both inside and outside
vendor; aggregate gate failure/cancellation/skips; paginated/unknown/malformed release inventories; older and same-version release recovery; Ubuntu source fallback, missing sources, update failures, and installation failures.Database verification: not applicable; no database changes.
Validation limits: full Rust suites, Linux PTY execution, full AMD64/ARM64 application-image compilation, hosted-runner apt behavior, and live release publication were not run locally. Linux/macOS PTY lanes are configured in this PR; full image build/smoke checks remain release/IDC gates. Both local CLI builds emitted the macOS linker
__eh_framesize warning but all selected tests passed. No production services or release tags were modified during validation.Final checklist