Fix accuracy gaps in feature flags doc before #130 implementation #142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "docs/feature-flags-accuracy-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
lucas-admin→lucas-super-admintest account nametable_exists?guard to testbefore(:each)hookChanges
docs/feature-flags.md: three accuracy fixes to align with current auth state before #130 implementationTest Plan
Review Checklist
Related Notes
ldraney/landscaping-assistant #130— the implementation ticket this doc supportsproject-landscaping-assistant— landscaping assistant projectPR #142 Review
DOMAIN REVIEW
Tech stack: Ruby on Rails documentation (Markdown). Verified all three fixes against source-of-truth files.
Fix 1 -- "four roles" to "five roles" (line 27)
Correct.
docs/keycloak-setup.mdline 31 lists thelandscapingrealm withroles = ["admin", "lead", "member", "client", "super_admin"](five). The Terraform tfvars at line 77 confirms the same.ApplicationController#TAB_ROLESreferences all five includingsuper_admin.Fix 2 --
lucas-admintolucas-super-admin(line 324)Correct.
docs/keycloak-setup.mdline 142 listslucas-super-adminas the test account withadmin+super_adminroles.lucas-adminis a separate test account with only theadminrole (line 143). The original text conflated the two accounts.Fix 3 --
table_exists?guard inbefore(:each)(lines 384-389)Correct Rails idiom.
ActiveRecord::Base.connection.table_exists?(:feature_flags)is the standard ActiveRecord introspection method for checking table existence. Thenext unlesspattern cleanly skips the hook body for specs that run before the feature_flags migration has been applied (e.g., model specs for unrelated models in CI where migration order matters). The removed comment (# Clear cache so tests see the enabled state) was redundant sinceRails.cache.clearis self-documenting.Line 324 -- "alongside the existing four roles"
This phrasing is correct as written. The sentence describes super_admin being created alongside the other four roles (client, member, lead, admin). "Four" here refers to the pre-existing roles, not the total count. No fix needed.
Broader staleness scan of
docs/feature-flags.md:current_user_has_role?("admin")usage in code examples (lines 116, 218, 273) -- matches the actual method signature inApplicationControllerline 56-59. Correct.require_super_admincontroller method (line 272-274) usescurrent_user_has_role?("super_admin")-- matches therequire_roleDSL pattern from PR #136. The doc shows a manualbefore_actionrather than therequire_role :super_adminclass-level DSL. Both work, but this is a deliberate choice (returns 404 vs redirect) so it is correct as documented.helper_method :feature_enabled?(line 98) -- matches the existinghelper_methodpattern inApplicationControllerline 8-9.current_usersession hash model is correctly reflected. The doc does not treatcurrent_useras an ActiveRecord model anywhere.keycloak-setup.mdlines 140-147 is consistent with the doc's references.Out-of-scope observation:
README.mdlines 14-21 list only four roles (Client, Crew Member, Crew Lead, Admin) and do not mention Super Admin. This is a pre-existing gap, not introduced by this PR. Consider a follow-up to add Super Admin to the README roles table.BLOCKERS
None. All three fixes are factually correct and align with source-of-truth files.
NITS
# Clear cache so tests see the enabled statefrom the test hook. While the comment was arguably redundant, havingRails.cache.clearwithout any comment in abefore(:each)block may confuse future readers about why the cache is cleared there (it is specifically to ensure tests see the freshly-enabled flag state, not just a generic cleanup). Optional: keep a shorter comment like# Flags just enabled above; bust stale cache. Very minor -- not blocking.SOP COMPLIANCE
docs/feature-flags-accuracy-fixes-- doc fix branch, no parent issue number but reasonable for a standalone doc fix)PROCESS OBSERVATIONS
VERDICT: APPROVED