Repository navigation
Raise the quality bar for pull requests: lint, coverage gate, broader tests - #7
Merged
Merged
Conversation
… tests CI now runs `bun run check` (typecheck, ESLint, tests with coverage, build) and the tests again on Windows. Coverage goes from ~32 % to ~88 % of statements, with thresholds that fail the run when it drops. New tests: - http: localhost-only guard, DNS rebinding, cross-site origin, JSON body validation, error mapping - cloudAuth: PKCE auth URL and scopes, code exchange, token refresh and revocation, offline errors - API routes: trips CRUD and id checks, storage switching, config never returning secrets, Google sign-in (state/CSRF check, hidden-folder migration) and disconnect - browser sync: newest wins, deletes, storage switch, offline; store actions; trip import - MCP server: the real server over stdio, planning a trip end to end - tripOps, maps fallback to OpenStreetMap, time and place helpers ESLint (eslint-config-next core-web-vitals + typescript) found and this fixes: a ref written during render in OsmMap, setState in effects in Settings and Splitter, and an unused MCP helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Every pull request now has to pass typecheck, ESLint, tests with a coverage gate, and a production build, and the tests also run on Windows.
CI (
.github/workflows/ci.yml)typecheck→lint→test:coverage→build. A coverage table is shown in the run summary.permissions: contents: read.Coverage: ~32 % → ~88 % statements, enforced
vitest.config.mts: statements 85, branches 80, functions 78, lines 87. These are just below today's numbers, so a change that removes coverage fails CI.lib/server/http.tsHost), cross-siteOrigin, JSON content type (blocks form posts), body validation, error mapping that never leaks internalslib/server/cloudAuth.ts/api/confignever returning secrets; Google sign-in: start cookies, CSRF state check, declined consent, full callback with migration from the hidden folder; disconnect copying trips to this PClib/sync.ts+ storemcp/server.tstripOps(19 % → 100 %), Google → OpenStreetMap fallback in maps, time and place helpersServer tests run against a temporary
TRIPDECK_HOME, with the OneDrive folder replaced by a temporary one, so real trips are never touched.ESLint (
eslint-config-nextcore-web-vitals + typescript,--max-warnings 0)Fixes for what it found:
OsmMap: wrote a ref during render. It is now updated in an effect.setStatein an effect to readwindow.location.origin. It now usesuseSyncExternalStore.Splitter: the localStorage read after hydration is intentional. It is kept, and the rule is disabled for that line with the reason in a comment.dayNumberOf)._namestays the convention for deliberately unused values.Not included
checkandwindowsjobs as required checks in the branch protection rules formain.Test plan
bun run checkpasses locally: 152 tests, coverage 88.5 % statements / 83.4 % brancheslines=99) makes the run fail🤖 Generated with Claude Code