Repository navigation
fix: default guilds to everyone, matching production - #1673
shanesmithdev wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
70fe104 to
aebd783
Compare
aebd783 to
6cbdbe2
Compare
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.
6cbdbe2 to
892f528
Compare
Summary
Production already opens guilds to everyone through a database override in the
featurestable, 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.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.ordered_class_elementskeeps that private method below the public ones.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.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.FeatureControllerTest,GuildControllerTest,GuildMembershipControllerTest,GuildReadControllerTest,UserControllerTest,FollowingLogQueryTest,Api/GuildControllerTest,Api/CommitControllerTest): all pass..tsxtests (LinkifiedText,OrgMentionSuggestions,ThreadRecovery, viavp test): 167 pass.pest --parallel --ci --coverage --exactly=100.0): 6516 passed, 100.0% coverage.Features::update()forget the stored admin-only setting ($adminOnly ?? false) failsFeatureControllerTest.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).production)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
productionat0e09618atoaebd7838.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.adminOnlyByDefault()keeps its// e.g. Feature::Guildsplaceholder.FollowingLogQueryTestchecks onlyfollows, not organization follows.ThreadRecovery.test.tsxstill has aguildPreviewvariable name.tsc(run separately, see Validation), and mobile or light-theme captures.Limitations
Summary by CodeRabbit