Skip to content

fix: default guilds to everyone, matching production - #1673

Open
shanesmithdev wants to merge 1 commit into
dev-null-sh:productionfrom
shanesmithdev:guilds-generally-available
Open

shanesmithdev wants to merge 1 commit into
dev-null-sh:productionfrom
shanesmithdev:guilds-generally-available

Conversation

@shanesmithdev

@shanesmithdev shanesmithdev commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Production already opens guilds to everyone through a database override in the features table, but the code still defaulted them to admins only. Local development and any other fresh environment, with no override row, therefore hid guilds from everyone but admins.

This makes everyone the code default, so a fresh environment matches production. Admins can still restrict guilds to admins, or turn them off, from /operations/features.

Changes

  • app/Services/Features.php: when no override row exists, adminOnly() now checks a list of features that default to admins only. It's currently empty, holding only a // e.g. Feature::Guilds placeholder.
    • The list lives in a private adminOnlyByDefault() method rather than a constant or a local array, because PHPStan treats an empty literal as always empty and reports the in_array() check as always false.
    • Pint's ordered_class_elements keeps that private method below the public ones.
  • resources/js/pages/operations/features.tsx: the guilds description no longer calls them a preview.
  • KNOWLEDGE_BASE.md and PRODUCT.md: removes "(preview)" and "not generally available yet", adds a Guilds entry to the table of contents, and splits the long guild intro into paragraphs.
  • Tests that relied on the old default now make guilds admin-only themselves, so that setting stays covered. A comment marks each one. Affected: GuildControllerTest, GuildMembershipControllerTest, GuildReadControllerTest and UserControllerTest.
    • FeatureControllerTest now starts from open, narrows to admins, reopens, then disables.
    • FollowingLogQueryTest asserted that building the Following log runs no queries. With guilds open, the joined-guilds lookup runs early, so the test now asserts only that no query touches follows. It still fails if followed users are loaded eagerly.

Overlap with #1665: both edit the Guilds intro in KNOWLEDGE_BASE.md. Whichever merges second will conflict on that paragraph. The resolution keeps this PR's paragraph splits and wording, plus #1665's icon paragraph and moderation sentence.

Validation

Local, on aebd7838:

  • composer test:lint: Pint, Rector and the frontend format/lint check pass.
  • composer test:types: PHPStan and tsc pass.
  • bun run test:unit: 333 pass, 0 fail.
  • Changed PHP test files (FeatureControllerTest, GuildControllerTest, GuildMembershipControllerTest, GuildReadControllerTest, UserControllerTest, FollowingLogQueryTest, Api/GuildControllerTest, Api/CommitControllerTest): all pass.
  • Changed .tsx tests (LinkifiedText, OrgMentionSuggestions, ThreadRecovery, via vp test): 167 pass.
  • Full PHP suite with coverage (pest --parallel --ci --coverage --exactly=100.0): 6516 passed, 100.0% coverage.
  • Mutation checks, each failing the test as intended:
    • Making Features::update() forget the stored admin-only setting ($adminOnly ?? false) fails FeatureControllerTest.
    • Making the Following log load followed users first fails FollowingLogQueryTest.

Hosted CI: the CodeRabbit check passed, with no actionable comments. No other checks have run.

Visual evidence

The only visible change is the guilds description on /operations/features (admins only): "Choose who can use the preview." becomes "Choose who can use them."

Before is production (0e09618a), with guilds set to Admins, the code default there when no override row exists. After is this branch (70fe104f).

Before (production) After
Guilds row before guilds row after guilds row
Full page before full page after full page

The layout doesn't change, and there were no page errors.

Device verification

Chrome on desktop only. The change is one line of description text with no new interaction, so it wasn't checked on mobile.

Independent review

  • Reviewer: separate from the implementer, with read-only access, given the task, the repository guidelines, the full diff and the before/after captures.
  • Revision reviewed: production at 0e09618a to aebd7838.
  • Result: CODE: PASS and VISUAL: PASS after two rounds.
  • First round (70fe104f): CODE: FAIL on a test-coverage gap. This PR had dropped the only test that Features::update() keeps the stored admin-only setting when a request leaves it out. Fixed: FeatureControllerTest now turns guilds off while they're on Admins and asserts the setting stays admin-only. Breaking that line ($adminOnly ?? false) now fails the test.
  • Also fixed: guild-related test names that still said "preview" are renamed.
  • Accepted nits:
    • adminOnlyByDefault() keeps its // e.g. Feature::Guilds placeholder.
    • FollowingLogQueryTest checks only follows, not organization follows.
    • An old migration still sets guilds to admin-only on existing rows. It's historical and harmless.
    • ThreadRecovery.test.tsx still has a guildPreview variable name.
  • Verified by the reviewer: default resolution, caching, the update path and events; nothing else assumes guilds default to admin-only; the docs are accurate; the changed tests pass; the captures show only the text change and the selected setting.
  • Not verified by the reviewer: the full suite, lint and tsc (run separately, see Validation), and mobile or light-theme captures.

Limitations

  • Screenshots cover one viewport and theme, since the only visible change is one line of text.
  • Production behaviour doesn't change, because its override row still decides who sees guilds.

Summary by CodeRabbit

  • New Features
    • Guilds are available as public communities, with access configurable for everyone or admins only.
    • Each person can create up to 100 guilds.
  • Documentation
    • Updated Guilds guidance to reflect their general availability and access settings.
    • Clarified that flagged edits to existing guilds, like flagged new guilds, wait for admin review.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Guilds now defaults to access for everyone when no stored admin-only override exists. Admin-only access remains configurable. Documentation, operations UI text, and tests now describe Guilds without preview terminology.

Changes: Guild access and availability

Layer / File(s) Summary
Feature access default
app/Services/Features.php, tests/Feature/Controllers/FeatureControllerTest.php, tests/Unit/Queries/LogQueries/FollowingLogQueryTest.php
Features not listed by the default policy are no longer admin-only without a stored override. Tests cover the Guilds default and access transitions. The query test allows other logged queries while checking for queries that reference follows.
Admin-only access checks
tests/Feature/Controllers/Guild*Test.php, tests/Feature/Controllers/Api/*Guild*Test.php, tests/Feature/Controllers/Api/CommitControllerTest.php, tests/Feature/Controllers/UserControllerTest.php
Guild access tests configure admin-only access explicitly. API test labels and controller test descriptions use admin-only terminology.
Guild availability content
KNOWLEDGE_BASE.md, PRODUCT.md, resources/js/pages/operations/features.tsx, tests/Unit/*
Product and knowledge-base text removes the preview status. The knowledge base describes moderation of flagged edits to existing Guilds. The operations UI and related test descriptions no longer refer to a Guilds preview.

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

Change: Bug fix

Possibly related PRs

  • dev-null-sh/dev-null.sh#1576: Adds the Guilds feature control with Off, Admins, and Everyone states. This PR changes the default admin-only behavior for that feature.

Suggested reviewers: paulinevos, wendelladriel, nunomaduro

Merge Risk: Minimal · up to 892f5

Guilds now default to everyone when no override is stored, which matches production. Admins can still restrict access, and the tests and docs are updated to match. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix: default guilds to everyone, matching production" matches the main change. The PR changes the code default for Guilds from admin-only to everyone, so fresh environments match production…
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.
Full details: Title check

Explanation

The title "fix: default guilds to everyone, matching production" matches the main change. The PR changes the code default for Guilds from admin-only to everyone, so fresh environments match production. The title is short, specific, and uses a conventional commit prefix. The changeset also covers related items such as the Features admin-only fallback list, documentation updates, and test adjustments. The title does not need to name those.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 64ccc007-e8dc-4dda-b1ef-432b8ed3523b
Commits

Reviewing files that changed from the base of the PR and between 6cbdbe2 and 892f528.

Files selected for processing: 1

  • KNOWLEDGE_BASE.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@shanesmithdev
shanesmithdev force-pushed the guilds-generally-available branch from 70fe104 to aebd783 Compare November 23, 2026 05:38
@shanesmithdev
shanesmithdev marked this pull request as ready for review November 23, 2026 05:42
@shanesmithdev shanesmithdev changed the title feat: default guilds to everyone, matching production fix: default guilds to everyone, matching production Nov 23, 2026
@shanesmithdev
shanesmithdev force-pushed the guilds-generally-available branch from aebd783 to 6cbdbe2 Compare November 23, 2026 12:35
Production already opens guilds to everyone through a database override,
but the code still defaulted them to admins only. Local and other fresh
environments therefore hid guilds from everyone but admins. They now
match production by default.

- Features: no feature defaults to admin-only; adminOnlyByDefault()
  lists any future exception. Admins can still restrict guilds, or turn
  them off, from /operations/features.
- Docs: drop "preview" and "not generally available" from the knowledge
  base and product overview, and split the guild intro into paragraphs.
- Operations: the guilds description no longer calls them a preview.
- Tests: tests that relied on the old default now set admin-only
  themselves, so the setting stays covered.
@shanesmithdev
shanesmithdev force-pushed the guilds-generally-available branch from 6cbdbe2 to 892f528 Compare November 23, 2026 15:38
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.

1 participant