managing-endpoint-versions
Skill này làm gì
Skill này giải thích cách các phiên bản endpoint hoạt động và cách hoàn tác hoặc xem trước thay đổi mà không làm gián đoạn việc sử dụng đang diễn ra. Nó dành cho người chỉnh sửa endpoint và muốn tránh những bất ngờ.
Khi nào nên dùng
- ✓Khi bạn muốn hoàn tác một endpoint về phiên bản cũ hơn.
- ✓Khi bạn muốn thử một thay đổi truy vấn trong playground trước khi đưa nó vào sử dụng.
- ✓Khi bạn muốn cập nhật mô tả hoặc cài đặt độ mới trên một phiên bản mà không tạo phiên bản mới.
Liên kết skill
https://github.com/PostHog/posthog/blob/master/products/endpoints/skills/managing-endpoint-versions/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm sao để hoàn tác endpoint của tôi về phiên bản 3?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Thay đổi truy vấn tạo một phiên bản mới, còn thay đổi cài đặt cập nhật trực tiếp phiên bản được chọn. Skill dùng điều này để chỉ cho bạn những cách thử và hoàn tác an toàn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Managing endpoint versions
This skill is the practical guide to endpoint versioning. It covers the today-workflow, which has some sharp edges worth being explicit about.
When to use this skill
- "How do I roll back to v3?"
- "I want to test changes before they go live"
- "How do I update the description /
data_freshness_secondson a specific version?" - "Can I disable v4 without affecting v5?"
- The user is uncertain whether a query change will cut a new version
Versioning model — what to know
| Behaviour | Reality |
|---|---|
| Query change | Auto-cuts a new version. Saving any edit to the query creates a new version and bumps the current version number |
Settings change (description, data_freshness_seconds, materialisation) |
Does not cut a new version. Updates the targeted version in place |
| The "current" version | Always the highest version number — it's not a pointer you can move backwards |
Calling without ?version=N |
Runs the latest version. So unpinned callers always hit the newest |
| Disabling the whole endpoint | endpoint-update with is_active: false (no version) takes every version offline at once |
| Disabling a single version | endpoint-update with version + is_active: false retires one version without affecting the others |
The model is forward-only. There is no "make v3 the default again" operation today. Practically
this means "rollback" requires either creating a new top version that re-uses the old query, or
pinning callers to ?version=N.
Available tools
| Tool | Purpose |
|---|---|
endpoint-versions |
List all versions for an endpoint, latest first |
endpoint-get |
Full config; supports ?version=N to fetch a specific version |
endpoint-update |
The workhorse — supports version body param to target a specific version |
endpoint-run |
Execute a version directly via ?version=N (without affecting which version other callers hit) |
Workflows
Previewing a draft before publishing
There is no "draft" concept in the model. Editing the query commits it as a new version immediately. To preview safely:
- Test the new query first with the
execute-sqltool (or the SQL editor) — not on the live endpoint - When ready, update the endpoint — this creates the new version automatically
- Use
endpoint-runwith?version=Nto confirm the new version returns what you expect - Old callers still hit the latest version (which is now your new version) — there is no "soft launch"
If the user needs a true staging endpoint, the only workaround today is a sibling endpoint
with a _v2 or _staging suffix. Document this honestly — there is no in-product staging path.
Rolling back to an older version
The forward-only model means "rollback" requires forking:
endpoint-versionsto find the version with the good query (say v3)endpoint-getwith?version=3to retrieve that version's query JSONendpoint-updatewith the v3 query as the new query — this creates a new version (e.g. v6) with the same query as v3- All callers without
?version=Nnow hit v6 (== v3's query)
The old version (v5, the broken one) still exists and is still callable via ?version=5 until
explicitly deactivated.
Faster mitigation if you can change every caller: have them pin to ?version=3 until a real
fix is ready. Lower-impact than cutting a
Câu hỏi thường gặp
Thay đổi cài đặt có tạo phiên bản mới không?
Không. Các cài đặt như mô tả hoặc độ mới cập nhật trực tiếp phiên bản được nhắm đến.
Thay đổi truy vấn có tạo phiên bản mới không?
Có. Lưu một chỉnh sửa truy vấn sẽ tự động tạo phiên bản mới và tăng số phiên bản hiện tại lên.
Tôi có thể tắt một phiên bản cũ mà không ảnh hưởng đến phiên bản mới không?
Có. Skill bao gồm việc vô hiệu hóa một phiên bản cụ thể, các phiên bản khác vẫn giữ nguyên.
Chi tiết
Mô tả gốc của tác giả
Work safely with endpoint versions — preview a draft in the playground, roll back to an older version, update settings on one version without bumping query history, deactivate a specific version. Use when the user asks "how do I roll back my endpoint", "preview my changes before publishing", "I want to fix v5 without bumping the version", or anything involving the version history. Calls out today's limitations honestly: there is no pointer flip; "rollback" means forking the old query into a new top version.
repo: PostHog/posthog
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6863
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
depot-ci
41kGiúp agent của bạn thiết lập và chạy quy trình Depot CI, một lựa chọn thay thế GitHub Actions, gồm chuyển các quy trình hiện có và đọc nhật ký chạy.
depot-container-builds
41kGiúp agent của bạn build image Docker trên các builder từ xa của Depot, gồm image đa nền tảng, đẩy lên registry và sửa lỗi build.
depot-github-runners
41kGiúp agent của bạn chuyển các job GitHub Actions sang runner do Depot quản lý, chọn kích thước và nhãn runner, và xử lý lỗi thiết lập runner.
editing-agents-md
41kGiúp agent của bạn quyết định một quy tắc nên nằm trong file AGENTS.md hay CLAUDE.md, và viết sao cho quy tắc được tuân thủ mà file không bị phình to.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.