Skip to content

Create and connect a Space from WordPress - #4

Merged
batuhan merged 2 commits into
mainfrom
batuhan/create-and-connect-space
Aug 7, 2026
Merged

Create and connect a Space from WordPress#4
batuhan merged 2 commits into
mainfrom
batuhan/create-and-connect-space

Conversation

@batuhan

@batuhan batuhan commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • let Static WordPress create a Space in the authorized Team and connect it immediately
  • request Space management only for the static publishing flow
  • keep Headless WordPress limited to selecting a repository-backed Space
  • release the plugin as 0.4.0

Verification

  • ./bin/test.sh
  • ./bin/test-wordpress.sh

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features

    • Static WordPress setup can now create and connect a new Space for a selected Team.
    • Space creation includes title validation and clear handling for authorization or API errors.
    • Added the required permission for managing Spaces during authorization.
  • Bug Fixes

    • Improved feedback when no Spaces are available in headless mode.
  • Chores

    • Updated the plugin version to 0.4.0 and refreshed release documentation.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@batuhan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d6eebe7f-d69e-4876-b296-67ba3953b9bc

📥 Commits

Reviewing files that changed from the base of the PR and between 70caae6 and 12fa59b.

📒 Files selected for processing (6)
  • includes/class-spacefast-client.php
  • includes/class-spacefast-oauth.php
  • includes/class-spacefast-plugin.php
  • includes/class-spacefast-settings.php
  • tests/behavior.php
  • uninstall.php
📝 Walkthrough

Walkthrough

Changes

Static Space Creation

Layer / File(s) Summary
Space creation API contract
includes/class-spacefast-client.php, includes/class-spacefast-oauth.php, tests/behavior.php
Spacefast_Client can create a Team-scoped Space through /v1/spaces. Static OAuth requests include spaces:write and spaces:publish.
Admin creation and connection flow
includes/class-spacefast-plugin.php, tests/acceptance/wordpress.php
The plugin registers a creation handler, renders a Static WordPress form, validates input, creates and connects the Space, and reports results.
Release metadata alignment
readme.txt, spacefast-wordpress.php, tests/acceptance/wordpress.php
The plugin version changes to 0.4.0, and the changelog documents Space creation and connection.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Admin
  participant SpacefastPlugin
  participant SpacefastClient
  participant SpacefastAPI
  Admin->>SpacefastPlugin: Submit Space creation form
  SpacefastPlugin->>SpacefastPlugin: Validate mode, authorization, team, and title
  SpacefastPlugin->>SpacefastClient: create_space(team_id, title)
  SpacefastClient->>SpacefastAPI: POST /v1/spaces
  SpacefastAPI-->>SpacefastClient: Return created Space
  SpacefastPlugin->>SpacefastPlugin: connect_space(space)
  SpacefastPlugin-->>Admin: Report result and redirect
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: creating and connecting a Space from WordPress.
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.
✨ 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 batuhan/create-and-connect-space

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 70caae6048

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread includes/class-spacefast-oauth.php
Comment thread includes/class-spacefast-plugin.php

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@includes/class-spacefast-client.php`:
- Around line 109-119: Update create_space() to accept and forward a stable
Idempotency-Key with the POST /v1/spaces request, while preserving the existing
teamId/title payload. Generate and persist one key per creation operation, reuse
it across retries or timeout reconciliation, and clear it only after success or
reconciliation so repeated submissions cannot create duplicate Spaces.

In `@includes/class-spacefast-plugin.php`:
- Around line 181-192: Update the creation flow around
Spacefast_OAuth::CHOICES_OPTION and connect_space() so a successfully validated
Space creation is persisted as a selectable choice before the health check runs.
Preserve the existing validation of $created and $space, append the creation
receipt using the established choices format, and ensure the choice remains
available when connect_space() fails instead of returning to the cached
pre-creation choices.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b7f7e117-4efb-4ec5-994a-a9002a510140

📥 Commits

Reviewing files that changed from the base of the PR and between 111747b and 70caae6.

📒 Files selected for processing (7)
  • includes/class-spacefast-client.php
  • includes/class-spacefast-oauth.php
  • includes/class-spacefast-plugin.php
  • readme.txt
  • spacefast-wordpress.php
  • tests/acceptance/wordpress.php
  • tests/behavior.php
Comment thread includes/class-spacefast-client.php
Comment thread includes/class-spacefast-plugin.php Outdated
@batuhan
batuhan merged commit 4ab4a15 into main Aug 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant