Skip to content

🐛 Restricted page-hit member statuses at the HTTP boundary - #922

Draft
cmraible wants to merge 1 commit into
mainfrom
codex/tighten-member-status
Draft

cmraible wants to merge 1 commit into
mainfrom
codex/tighten-member-status

Conversation

@cmraible

@cmraible cmraible commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

no refs

Summary

  • Restricted HTTP page-hit member_status to undefined, paid, free, comped, and gift. Unsupported or missing statuses fail request validation.
  • Kept the stored-event contract as a nonempty string, shared by raw and processed event schemas, so previously accepted Pub/Sub messages drain unchanged. A worker regression test covers forwarding and acknowledgment of a legacy status.
  • Kept the field's TypeScript type as string to preserve compatibility with the existing proxy handler; the HTTP enum is enforced at runtime.

Validation

  • Docker build, TypeScript checks, and lint passed.
  • All 618 unit and integration tests passed; combined coverage thresholds passed.
  • Zod/AJV tests cover strict HTTP statuses and permissive stored-event statuses.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b396db47-5795-4160-a222-35e7c4a5f2e7

📥 Commits

Reviewing files that changed from the base of the PR and between f259f71 and 13aeb78.

📒 Files selected for processing (6)
  • src/schemas/v1/member-status.ts
  • src/schemas/v1/page-hit-processed.ts
  • src/schemas/v1/page-hit-raw.ts
  • src/schemas/v1/page-hit-request.ts
  • test/unit/handlers/page-hit-handlers.test.ts
  • test/unit/schemas/validation.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

A shared MemberStatusSchema now permits undefined, paid, free, comped, and gift. The request, raw, and processed page-hit schemas use this enum. The request payload no longer defaults member_status to undefined. Tests cover valid, invalid, and missing values through Zod, application validators, and HTTP request validation. Handler fixtures now use literal undefined types.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: joeegrigg

Merge Risk: ⚪ Minimal · up to 13aeb

The validation change consistently accepts supported tracker statuses and rejects unsupported or missing values. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: restricting page-hit member statuses at the HTTP boundary.
Description check ✅ Passed The description directly explains the validation changes, compatibility behavior, removed default, and test coverage.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/tighten-member-status

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@f4b929e). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #922   +/-   ##
=======================================
  Coverage        ?   95.97%           
=======================================
  Files           ?       50           
  Lines           ?     1169           
  Branches        ?      201           
=======================================
  Hits            ?     1122           
  Misses          ?       47           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cmraible
cmraible force-pushed the codex/tighten-member-status branch from 4d003ce to 13aeb78 Compare September 16, 2026 15:44
@cmraible
cmraible marked this pull request as ready for review September 16, 2026 16:39
@cmraible cmraible changed the title 🐛 Restricted page-hit member statuses and removed redundant default Tightened validation on the page hit endpoints's member_status field Sep 16, 2026
@cmraible
cmraible force-pushed the codex/tighten-member-status branch from 13aeb78 to a28497d Compare September 16, 2026 16:48
@cmraible
cmraible marked this pull request as draft September 16, 2026 16:58
@cmraible
cmraible force-pushed the codex/tighten-member-status branch from a28497d to ba9c5a8 Compare September 16, 2026 17:11
@cmraible cmraible changed the title Tightened validation on the page hit endpoints's member_status field 🐛 Restricted page-hit member statuses at the HTTP boundary Sep 16, 2026
@cmraible
cmraible force-pushed the codex/tighten-member-status branch 2 times, most recently from 6fbcd22 to 4e03115 Compare September 16, 2026 17:38
@cmraible
cmraible force-pushed the codex/tighten-member-status branch from 4e03115 to 3b1441b Compare September 28, 2026 21:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants