Skip to content

docs(adr): ADR 008 — baseline mode for CI adoption#176

Merged
Krishan27 merged 3 commits into
mainfrom
docs/adr-008-baseline-mode
Jun 23, 2026
Merged

docs(adr): ADR 008 — baseline mode for CI adoption#176
Krishan27 merged 3 commits into
mainfrom
docs/adr-008-baseline-mode

Conversation

@Krishan27

@Krishan27 Krishan27 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Defines baseline mode: --write-baseline and --baseline/--fail-on-new. Includes file format spec, behavior table, file-move edge case, and exit codes. Part of the v1.0.0 milestone.

Summary by CodeRabbit

Release Notes

  • Documentation
    • Added design documentation for baseline mode, which enables capturing FlagLint findings as a baseline and detecting only new violations in CI pipelines.

Defines --write-baseline and --baseline/--fail-on-new behavior, baseline
file format (version:1 JSON), and edge case behavior for file moves.
Part of the v1.0.0 milestone.

Signed-off-by: Krishan Kant Sharma <krishansharma0327@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds docs/adr/008-baseline-mode.md, a complete architectural decision record for baseline mode in FlagLint CI adoption. It specifies two CLI workflows, the baseline JSON schema, fingerprint-based comparison behavior, exit-code contract, file-move edge case handling, and an implementation outline pointing to src/baseline.ts and new CLI options.

Changes

ADR 008: Baseline Mode

Layer / File(s) Summary
Baseline mode ADR
docs/adr/008-baseline-mode.md
Adds the full ADR 008 document covering the --write-baseline and --baseline --fail-on-new CLI workflows, baseline JSON schema (version, timestamp, FlagLint version, fingerprint list), fingerprint-matching behavior, exit-code contract, file-move edge case guidance, and implementation outline for src/baseline.ts and option additions in src/commands/scan.ts and src/commands/validate.ts.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related issues

Possibly related PRs

  • flaglint/flaglint#160: ADR 008 directly depends on the stable finding fingerprint schema from ADR 007 (introduced in this PR) for computing and comparing baseline fingerprints.

Poem

🐇 Hop, hop, the baseline is set,
No new flag lint shall slip through the net!
Fingerprints stamped on a JSON so neat,
--write-baseline and --fail-on-new — what a feat.
The rabbit audits, validates with glee,
From CI chaos to order, we're free! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change: adding ADR 008 documentation for baseline mode in FlagLint. It is concise, specific, and clearly indicates the primary focus of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/adr-008-baseline-mode

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
docs/adr/008-baseline-mode.md (3)

137-148: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add closing period to final list item.

The last item in the Negative / Trade-offs section appears to be missing a period at the end of line 148.

✏️ Proposed fix
-  accumulate silently. Recommend adding baseline regeneration to sprint
-  definition-of-done.
+  accumulate silently. Recommend adding baseline regeneration to sprint
+  definition-of-done.

(If line 148 ends prematurely, ensure it concludes with a period.)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/adr/008-baseline-mode.md` around lines 137 - 148, The last bullet point
in the Negative / Trade-offs section starting with "**Baseline can go stale**"
is missing a period at the end of the line. Locate the final item in that list
and add a period after "definition-of-done" to maintain consistent punctuation
with the other list items in the section.

37-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add language identifier to fenced code block.

Markdown linting requires fenced code blocks to specify a language for proper syntax highlighting and rendering.

✏️ Proposed fix
-```
+```bash
 flaglint validate ./src --baseline flaglint-baseline.json --fail-on-new
-```
+```
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/adr/008-baseline-mode.md` around lines 37 - 39, The fenced code block
containing the flaglint validate command is missing a language identifier for
proper markdown linting. Locate the code block that starts with triple backticks
followed by the flaglint validate command and add "bash" as the language
identifier to the opening fence. Change the opening fence from three backticks
to three backticks followed by "bash" to enable proper syntax highlighting and
satisfy markdown linting requirements.

Source: Linters/SAST tools


28-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add language identifier to fenced code block.

Markdown linting requires fenced code blocks to specify a language for proper syntax highlighting and rendering.

✏️ Proposed fix
-```
+```bash
 flaglint audit ./src --write-baseline flaglint-baseline.json
-```
+```
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/adr/008-baseline-mode.md` around lines 28 - 30, The fenced code block
containing the flaglint audit command is missing a language identifier, which is
required for proper markdown linting and syntax highlighting. Locate the code
block that contains "flaglint audit ./src --write-baseline
flaglint-baseline.json" and add "bash" as the language specifier after the
opening triple backticks (change the opening fence from ``` to ```bash) to
properly identify the code block as a bash command.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/adr/008-baseline-mode.md`:
- Around line 137-148: The last bullet point in the Negative / Trade-offs
section starting with "**Baseline can go stale**" is missing a period at the end
of the line. Locate the final item in that list and add a period after
"definition-of-done" to maintain consistent punctuation with the other list
items in the section.
- Around line 37-39: The fenced code block containing the flaglint validate
command is missing a language identifier for proper markdown linting. Locate the
code block that starts with triple backticks followed by the flaglint validate
command and add "bash" as the language identifier to the opening fence. Change
the opening fence from three backticks to three backticks followed by "bash" to
enable proper syntax highlighting and satisfy markdown linting requirements.
- Around line 28-30: The fenced code block containing the flaglint audit command
is missing a language identifier, which is required for proper markdown linting
and syntax highlighting. Locate the code block that contains "flaglint audit
./src --write-baseline flaglint-baseline.json" and add "bash" as the language
specifier after the opening triple backticks (change the opening fence from ```
to ```bash) to properly identify the code block as a bash command.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 239aa342-da79-41c8-9953-fda313c0eee4

📥 Commits

Reviewing files that changed from the base of the PR and between 573c5bd and 276d982.

📒 Files selected for processing (1)
  • docs/adr/008-baseline-mode.md

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploying flaglint with  Cloudflare Pages  Cloudflare Pages

Latest commit: 86744d5
Status: ✅  Deploy successful!
Preview URL: https://c0989a7c.flaglint.pages.dev
Branch Preview URL: https://docs-adr-008-baseline-mode.flaglint.pages.dev

View logs

@Krishan27 Krishan27 merged commit 3336bc2 into main Jun 23, 2026
11 of 12 checks passed
@Krishan27 Krishan27 deleted the docs/adr-008-baseline-mode branch June 23, 2026 04:10
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