Add feature flags guide #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "docs/feature-flags-guide"
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
docs/feature-flags.md— the single reference for how feature flags work in palinkstemplate-issue-featurein pal-e-docs (now requires### Feature Flagsection)Changes
docs/feature-flags.md: New file covering flag types (global/role-scoped/per-user), data model, resolution order, how to add a flag, naming conventions, and lifecycleREADME.md: Added feature flags doc to TOCTest Plan
Review Checklist
Related Notes
template-issue-feature— updated in pal-e-docs to require### Feature Flagsectionproject-palinks— project pagePR #27 Review
DOMAIN REVIEW
Tech stack: Docs-only PR (Markdown, Mermaid diagrams, Ruby/Rails code examples). Reviewed for accuracy against existing architecture docs and Rails conventions.
Cross-reference: docs/feature-flags.md vs docs/architecture.md
FEATURE_FLAGS table schema discrepancy: The PR's ER diagram adds
description,created_at, andupdated_atcolumns that do not exist in the canonical data model indocs/architecture.md(lines 114-119). The architecture doc only hasid,name,enabled_globally,role_overrides. This is not wrong -- timestamps are standard Rails anddescriptionis reasonable -- but the two docs now disagree on the schema. One of them should be updated to match the other so there is a single source of truth.Three flag types: The PR documents global, role-scoped, and per-user flags. This matches
docs/architecture.mdlines 131-133 exactly. Consistent.role_overrides JSONB: Both docs agree on this column type and its purpose. Consistent.
User preferences JSONB: Architecture.md shows
USERS.preferencesdescribed as"feature flags, display settings". The PR's ER diagram labels it"per-user flag overrides". The PR label is narrower -- it omits display settings. Minor wording inconsistency but not a conflict.Resolution order: The PR documents
user pref > role override > global. This is net-new content (architecture.md does not specify resolution order). The logic is sound and matches the data model. Good addition.Ruby code examples:
find_or_create_by!with a block andfeature_enabled?(:symbol, current_user)are idiomatic Rails. The ERB example correctly uses<%%escaping for the diff context. No issues.Admin UI reference: The PR says "Flags are managed through the settings panel (person icon, top left)." This matches the architecture doc's description of the user dashboard at line 130. Consistent.
README TOC: Entry added at a reasonable position between Visibility and User Stories. Correctly formatted with relative path and description.
"Current Flags" section: The disclaimer that the system is not yet implemented, with a reference to #16 (Keycloak spike), is accurate and honest. Good.
BLOCKERS
None. This is a docs-only PR with no code changes, no secrets, and no security surface.
NITS
Schema drift between docs:
docs/feature-flags.mdshows the FEATURE_FLAGS table withdescription,created_at,updated_atcolumns thatdocs/architecture.mddoes not have. Consider updating architecture.md to match, or add a note in the feature-flags doc that it extends the base schema. Not a blocker for a docs PR, but schema should have one canonical definition.User preferences label: The PR's ER diagram labels
USERS.preferencesas"per-user flag overrides"while architecture.md calls it"feature flags, display settings". The architecture.md label is broader and more accurate since preferences will hold more than just flags. Consider matching the wording.Branch naming: Branch is
docs/feature-flags-guide. The SOP convention is{issue-number}-{kebab-case-purpose}(e.g.,26-feature-flags-guide). Thedocs/prefix style works for discoverability but does not match the documented convention.PR body template: The body uses
## Review Checklistinstead of the standard## Relatedheader. The "Related Notes" section is present but named differently. The "Feature flag needed?" checklist item is a nice self-referential touch for a feature-flags doc.SOP COMPLIANCE
docs/feature-flags-guideinstead of26-feature-flags-guideproject-palinksPROCESS OBSERVATIONS
VERDICT: APPROVED
Clean docs-only PR. The content is accurate, well-structured, and consistent with the existing architecture docs. The schema discrepancy and branch naming are nits, not blockers. The resolution order documentation and lifecycle guidance are valuable additions that the codebase did not previously have.
PR #27 Review
DOMAIN REVIEW
Tech stack: Documentation (Markdown, Mermaid diagrams). No application code changed. This is a docs-only PR adding a feature flags guide, updating the architecture data model diagram, adjusting visibility tier definitions, and adding a README TOC entry.
Content review of
docs/feature-flags.md:docs/architecture.mdFEATURE_FLAGS entity (both now includedescription,created_at,updated_at).docs/architecture.mdchanges:description,created_at,updated_atto the FEATURE_FLAGS mermaid entity. These are sensible additions that align the architecture diagram with the feature-flags guide.docs/visibility.mdchanges:README.mdchanges:BLOCKERS
None. This is a docs-only PR with no application code, no secrets, no security surface.
NITS
Mermaid diagram inconsistency in
visibility.md: The PR moves "Contact channel" from Public to Member in the prose (lines 39/49), but the mermaid diagram on line 23 still lists"Portfolio, case studies, contact, public demos"under Public link examples. The diagram should be updated to move "contact" to the Member subgraph for consistency. (Not blocking for a docs PR, but creates a self-contradiction in the same file.)ERB escape in feature-flags.md: The code example uses
<%%(double-percent) for ERB tags in the markdown code block. This is the correct escaping for some template engines but may render oddly in plain markdown viewers. Verify it renders correctly on Forgejo.feature_enabled?helper: The doc references afeature_enabled?(flag, user)helper that does not yet exist. The "Current Flags" note at the bottom covers this, but the code examples above could benefit from a brief inline note like "# (not yet implemented)" to avoid confusion for readers who skip to a section.SOP COMPLIANCE
docs/feature-flags-guidebut SOP requires{issue-number}-{kebab-case-purpose}format (expected:26-feature-flags-guide). Non-blocking for a docs PR, but deviates from convention.Closes #26present in Related Notes.project-palinks.PROCESS OBSERVATIONS
VERDICT: APPROVED
PR #27 Review
DOMAIN REVIEW
Tech stack: Documentation only (Markdown, Mermaid diagrams, ERB code examples). No executable code changes.
Files reviewed (5 files, +132/-6):
README.md-- TOC entry addeddocs/architecture.md-- FEATURE_FLAGS ERD expanded withdescription,created_at,updated_atdocs/feature-flags.md-- New 121-line guide (flag types, data model, resolution order, how-to, naming, lifecycle)docs/user-stories.md-- US-9 contact channel acceptance criteria refineddocs/visibility.md-- Mermaid diagram and tier definitions updated for contact form/info distinctionDocumentation quality:
architecture.mdnow matches the ERD infeature-flags.md-- good consistencyCross-document consistency:
visibility.mdanduser-stories.mdchanges refine the contact channel story (US-9) -- public gets an anonymous form, members get direct contact info after 2FA. This is coherent with the feature-flag gating modelBLOCKERS
None. This is a docs-only PR with no executable code changes, no secrets, and no security surface.
NITS
Branch naming convention: Branch is
docs/feature-flags-guidebut SOP expects{issue-number}-{kebab-case}(e.g.,26-feature-flags-guide). Non-blocking for a docs PR but worth noting for consistency.Related Notes missing plan slug: The Related Notes section references
project-palinksbut does not reference a plan slug. If a plan note exists for this work, it should be linked.Scope creep (minor): The
user-stories.mdandvisibility.mdchanges refine US-9 (contact channel) specifics beyond what a "feature flags guide" ticket would strictly cover. The changes are coherent and improve the docs, but they are tangential to the stated issue scope. Not blocking since all changes are documentation and internally consistent.ERB escape in code example:
docs/feature-flags.mdline 85 uses<%%which is the correct way to display ERB tags in a Markdown code fence, but the double-percent will render literally in Markdown viewers (not as<%). Consider using single<%inside the fenced code block since Markdown renderers do not process ERB. This is cosmetic only.SOP COMPLIANCE
docs/feature-flags-guidevs expected26-feature-flags-guide)project-palinksbut no plan slug)Closes #26present in PR bodyPROCESS OBSERVATIONS
VERDICT: APPROVED