Harden Cloudflare pagination and tunnel status#749
Conversation
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
1 similar comment
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
Greptile SummaryThis PR hardens the Cloudflare adapter in two areas: the
Confidence Score: 5/5Safe to merge — both changes are isolated, well-tested, and represent pure additive hardening with no behaviour changes on existing code paths. The pagination change is a straightforward guard around a missing field; the fallback heuristic is a standard industry pattern and the worst-case side effect is a single extra API call on a perfectly-aligned page boundary. The status mapping change only adds new explicit cases ahead of an existing catch-all, leaving all previously-mapped statuses unchanged. Both changes are covered by targeted regression tests with call-count assertions. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[cfListAll called] --> B[page = 1, shouldContinue = true]
B --> C[Fetch page N with per_page=100]
C --> D[Parse pageItems from result]
D --> E{resultInfo.total_pages is a number?}
E -->|Yes| F[shouldContinue = page < total_pages]
E -->|No| G[shouldContinue = pageItems.length >= 100]
F --> H[page += 1]
G --> H
H --> I{shouldContinue?}
I -->|Yes| C
I -->|No| J[Return all collected items]
subgraph tunnelStatus
K[status input] --> L[normalize to lowercase]
L --> M{normalized value}
M -->|healthy / active / running| N[running]
M -->|inactive / down / stopped| O[stopped]
M -->|degraded / errored / error / failed / unhealthy| P[failed]
M -->|pending / provisioning / initializing| Q[provisioning]
M -->|empty / unknown| R[provisioning]
end
Reviews (1): Last reviewed commit: "Harden Cloudflare pagination and tunnel ..." | Re-trigger Greptile |
Summary
result_info.total_pagesbut returns a full pageactiveanderroredstatuses explicitly instead of sendingerroredthrough the provisioning fallbackContext
Follow-up to #747 after Greptile marked these as non-blocking production hardening items on the merged Cloudflare adapter.
Testing
corepack pnpm --filter @profullstack/sh1pt-core buildcorepack pnpm --filter @profullstack/sh1pt-cloud-cloudflare typecheckcorepack pnpm --filter @profullstack/sh1pt-cloud-cloudflare buildcorepack pnpm vitest run packages/cloud/cloudflare/src/index.test.ts(19 tests)git diff --check origin/master...HEAD