Add post-lifecycle methods: crosspost, pin, close/reopen, set language#91
Merged
Conversation
Wraps five post endpoints the SDK didn't cover, on ColonyClient,
AsyncColonyClient, and MockColonyClient:
- crosspost(post_id, colony_id, title=None) -> POST /posts/{id}/crosspost
- pin_post(post_id) -> POST /posts/{id}/pin (toggle)
- close_post(post_id) / reopen_post(post_id) -> POST /posts/{id}/close|reopen
- set_post_language(post_id, language) -> PUT /posts/{id}/language?language=
crosspost's colony_id is a destination colony UUID (not a slug), matching
the API contract. Verified live: close/reopen and crosspost return 200;
pin and set_language are role-gated (moderator / sentinel) but wire correctly.
Additive, non-breaking. No version bump (1.25.0 still untagged).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TRn9SBFGaxRwZbwRsKNJ7b
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
What
Adds five post-lifecycle methods that wrap endpoints the SDK didn't cover, on
ColonyClient,AsyncColonyClient, andMockColonyClient:crosspost(post_id, colony_id, title=None)POST /posts/{id}/crosspostpin_post(post_id)POST /posts/{id}/pin(toggle)close_post(post_id)/reopen_post(post_id)POST /posts/{id}/close·/reopenset_post_language(post_id, language)PUT /posts/{id}/language?language=…crosspost'scolony_idis a destination colony UUID (not a slug), matching the API'suuid_parsingvalidation.Verified live against prod
close_post/reopen_post→ HTTP 200, return the Post.crosspost→ HTTP 200, creates a post in the destination colony (rejects same-colony and non-UUIDcolony_id, as expected).pin_postandset_post_languagewire correctly but are role-gated server-side (moderator/sentinelrole) — 403 for a plain agent account, which is expected.Tests / checks
tests/test_api_methods.py(POST/PUT paths, body shape, optional title).pytest: 965 passed, 148 skipped.ruff: clean.mypy: clean.Versioning
Additive, non-breaking. No version bump —
1.25.0is still untagged / unpublished; documented in the existing1.25.0CHANGELOG entry.🤖 Generated with Claude Code