Repository navigation
fix: clear the Sonar issues and the planner's stop-test flake - #207
Merged
Merged
Conversation
SonarQube Cloud's run on 00caae0 failed its gate on two issues from the planner's steps, and TestStopEndsTheQuestions failed now and then in CI. - The planner's image fetches the Copilot CLI with ADD --checksum, so no HTTP client follows GitHub's redirect in a RUN (docker:S6506). - The notes editor's ⌘S test gives its skip's reason in a comment, as SonarJS's Vitest rules want (typescript:S1607). - The SDK sends a handler's error after the handler returns and closes the connection in Stop without waiting for it, so the stop test ends the questions' waits alone, with the connection open. See decision 419.
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.
Brief
Goal. Clear the two open issues from SonarQube Cloud's run 41026989231 on
00caae0, which turned the gate red on the new code's security rating (C), and fix the planner's flakyTestStopEndsTheQuestions, which failed CI run 41027630840 on #127 and the first run of #206. One PR before the next step, as AGENTS.md asks (decision 419).Scope.
services/planner/Dockerfile(docker:S6506, "HTTPS should be enforced on HTTP clients following redirects"): thewgetof the CLI's tarball followed GitHub's redirect to another host. BuildKit'sADD --checksum=sha256:$COPILOT_SHA256now fetches it and checks it against the pinned SHA-256, so no HTTP client runs in aRUN. The build arguments, the platform check andcopilot:checkstay as they were.apps/web/e2e/notes-edit.spec.ts(typescript:S1607): the ⌘S test's phone skip gives its reason in a comment right abovetest.skip, aspulls.spec.tsand nudge's spec do (decision 168), since SonarJS reads the specs with its Vitest rules.services/planner/internal/copilot:TestStopEndsTheQuestionsends the questions' waits withstop,Stop's first step, while the connection is open, and still checks that the CLI gets the error. Its cleanup stops the client.Stop's doc comment no longer promises that the CLI gets the error.Stop.Out of scope.
Stopwait for the SDK's handlers (see decision 419's Rejected).Acceptance criteria.
wgetorcurl; a build fetches the tarball, checks its SHA-256 and fails on a mismatch; a build for another platform still fails with "The planner's image is for linux/amd64 alone."; the image's CLI runs on a read-only root.copilot:checkstill reads the version and the checksum from the Dockerfile and passes.test.skip, and still skips on the phone and passes on desktop.TestStopEndsTheQuestionspasses the orchestrator'sgo test -race -count=200, and doesn't fail under load, where it failed before.Size. 11 lines added and 10 removed outside the docs, comments included.
QA
--target clibuilds; theADDexpands$COPILOT_SHA256and$COPILOT_VERSIONfrom the build arguments.--build-arg COPILOT_SHA256=000…0fails with "digest mismatch".--platform linux/arm64fails with "The planner's image is for linux/amd64 alone."copilot --versionon a read-only root says "GitHub Copilot CLI 1.0.105.".wgetand nocurl.mise run copilot:checkpasses.mise run check, the ⌘S test passed on desktop and was skipped on the phone.Stopsendssession.detach, then closes the connection, without waiting for those goroutines.go test -race -count=200 -run TestStopEndsTheQuestionspasses.Review
No blocking findings. Non-blocking:
maintells whetherADDsatisfies it.ADD --checksumfor URLs (stable since Dockerfile 1.6).stop,Stop's first step, rather thanStop; every test's cleanup still callsStopand checks its error.Gates
BAKHYARD_E2E_PORT=8480 mise run checkpassed locally on the head withmainat8feff43(#194) merged in:fmt:checkno diff,gen:check,copilot:check,vulnwith no vulnerabilities; coverage 97.1% total, the copilot package 99.6%.lint:actions,lint:compose.pnpm auditclean.main. An earlier run, before the merges, failed on timeouts while the Mac slept in the middle of it (clamshell sleep 10:19 to 11:11); every run since, awake, passed.Credits