Skip to content

docs: document the shared HttpMethod enum in the migration guide - #1679

Merged
spydon merged 1 commit into
mainfrom
docs/migration-http-method
Aug 10, 2026
Merged

spydon merged 1 commit into
mainfrom
docs/migration-http-method

Conversation

@spydon

@spydon spydon commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #1678, which landed without a migration note.

Why

Merging the two HttpMethod enums changed the one that functions_client exported, and both effects are things a caller can hit:

  • head joined the enum, so an exhaustive switch over HttpMethod in user code stops compiling. Verified: the analyzer reports non_exhaustive_switch_expression.
  • The declaration order changed, so index moved for post, put and delete. That one is silent, which is exactly the kind of change this guide flags.

Nothing changes for callers who only used postgrest's enum, and no import paths change, since the shared enum is re-exported from both packages.

What changed

One section added to the v3 list in MIGRATION.md: 13 lines, two bullets, no snippets. The shifted indices were read off the runtime output of iterating the merged enum (get=0 head=1 post=2 put=3 patch=4 delete=5) rather than derived by hand.

Docs only, no code changes.

Summary by CodeRabbit

  • New Features

    • Added support for the HEAD HTTP method.
    • Standardized HTTP method handling across Functions and PostgREST integrations.
    • Added uppercase wire-format values for HTTP methods.
    • Improved compatibility for sharing HTTP method definitions across integrations.
  • Documentation

    • Added migration guidance for updating method-based switches.
    • Documented replacing persisted numeric method indices with stable method names.

@spydon
spydon requested a review from a team as a code owner August 10, 2026 09:53
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

MIGRATION.md adds guidance for the shared HttpMethod enum. It documents the new head value, changed indices, package re-exports, exhaustive switch updates, stable persistence names, and uppercase wire-format values.

Changes

HttpMethod migration

Layer / File(s) Summary
Migration guidance for the shared enum
MIGRATION.md
Documents the shared enum, changed indices, package re-exports, exhaustive switch updates, stable method-name persistence, and the uppercase value getter.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: tr00d

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the migration-guide documentation for the shared HttpMethod enum.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/migration-http-method

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@MIGRATION.md`:
- Around line 346-366: Expand the HttpMethod persistence guidance in
MIGRATION.md to include an explicit migration for previously stored integer
indexes before readers switch to method.name. Document the compatibility mapping
for legacy values, including post 1→2, put 2→3, and delete 3→5, while preserving
unchanged get and patch values and handling the newly introduced head entry.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ff2a99c4-7c4d-44f6-a2b6-d348f020a8f9

📥 Commits

Reviewing files that changed from the base of the PR and between 23d55c3 and 3f9d8cd.

📒 Files selected for processing (1)
  • MIGRATION.md

Comment thread MIGRATION.md Resolved
The functions_client enum gained head and reordered its values when it
merged with postgrest's (#1678), so an exhaustive switch stops compiling
and index shifts for post, put and delete.
@spydon
spydon force-pushed the docs/migration-http-method branch from 3f9d8cd to 37a0036 Compare August 10, 2026 09:55
@spydon
spydon merged commit 21abb81 into main Aug 10, 2026
30 of 31 checks passed
@spydon
spydon deleted the docs/migration-http-method branch August 10, 2026 09:56
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