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::Guildsplaceholder.- 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 thein_array()check as always false. - Pint's
ordered_class_elementskeeps that private method below the public ones.
- The list lives in a private
resources/js/pages/operations/features.tsx: the guilds description no longer calls them a preview.KNOWLEDGE_BASE.mdandPRODUCT.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,GuildReadControllerTestandUserControllerTest.FeatureControllerTestnow starts from open, narrows to admins, reopens, then disables.FollowingLogQueryTestasserted 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 touchesfollows. 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 andtscpass.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
.tsxtests (LinkifiedText,OrgMentionSuggestions,ThreadRecovery, viavp 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) failsFeatureControllerTest. - Making the Following log load followed users first fails
FollowingLogQueryTest.
- Making
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 | ||
| 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:
productionat0e09618atoaebd7838. - 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 thatFeatures::update()keeps the stored admin-only setting when a request leaves it out. Fixed:FeatureControllerTestnow 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::Guildsplaceholder.FollowingLogQueryTestchecks onlyfollows, not organization follows.- An old migration still sets guilds to admin-only on existing rows. It's historical and harmless.
ThreadRecovery.test.tsxstill has aguildPreviewvariable 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.
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
app/Services/Features.php,tests/Feature/Controllers/FeatureControllerTest.php,tests/Unit/Queries/LogQueries/FollowingLogQueryTest.phpfollows.tests/Feature/Controllers/Guild*Test.php,tests/Feature/Controllers/Api/*Guild*Test.php,tests/Feature/Controllers/Api/CommitControllerTest.php,tests/Feature/Controllers/UserControllerTest.phpKNOWLEDGE_BASE.md,PRODUCT.md,resources/js/pages/operations/features.tsx,tests/Unit/*Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related PRs
Suggested reviewers:
paulinevos,wendelladriel,nunomaduroMerge Risk: Minimal · up to
892f5Guilds 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: 4
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)
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
64ccc007-e8dc-4dda-b1ef-432b8ed3523bReviewing files that changed from the base of the PR and between 6cbdbe26ab3ab2b9f4e2d5bafb211d7471720e0f and 892f528523f1a97c127a911f352b1e7f19c66da4.
KNOWLEDGE_BASE.mdIncluded review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.