Skip to content

Tighten docs smoke field matching#876

Open
Rajesh270712 wants to merge 2 commits into
ramimbo:mainfrom
Rajesh270712:bountyops/bou-311-docs-smoke-cleanup
Open

Tighten docs smoke field matching#876
Rajesh270712 wants to merge 2 commits into
ramimbo:mainfrom
Rajesh270712:bountyops/bou-311-docs-smoke-cleanup

Conversation

@Rajesh270712
Copy link
Copy Markdown

@Rajesh270712 Rajesh270712 commented Jun 4, 2026

Summary

Refs #846 / Bounty #846.

This tightens the docs smoke check so required template field ids are matched exactly instead of by substring.

Problem

The smoke check could treat a longer field id, such as evidence_extra, as satisfying the required evidence field.

Fix

  • Parse the referenced field ids from docs pages before matching required template ids.
  • Add a regression test for the exact-match behavior.

Validation

  • ./.venv/bin/python -m pytest tests/test_docs_public_urls.py::test_docs_smoke_matches_required_template_field_ids_exactly -q -> passed
  • ./.venv/bin/python -m pytest tests/test_docs_public_urls.py -q -> 36 passed
  • ./.venv/bin/python -m ruff check scripts/docs_smoke.py tests/test_docs_public_urls.py -> passed
  • ./.venv/bin/python -m ruff format --check scripts/docs_smoke.py tests/test_docs_public_urls.py -> passed
  • ./.venv/bin/python scripts/docs_smoke.py -> docs smoke ok

Risk notes

I did not rerun the full test suite for this PR. Open PR #873 also touches the docs smoke files for Markdown anchor validation; this PR is limited to exact field-id matching and may need a rebase if that PR lands first.

Summary by CodeRabbit

  • Tests

    • Added validation test to ensure precise matching of GitHub issue template field identifiers, preventing similar field names from being confused.
  • Chores

    • Improved field-matching logic in documentation validation for enhanced accuracy.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d09abd73-24f3-454f-926f-815142426b53

📥 Commits

Reviewing files that changed from the base of the PR and between 2184b16 and f8159d6.

📒 Files selected for processing (2)
  • scripts/docs_smoke.py
  • tests/test_docs_public_urls.py

📝 Walkthrough

Walkthrough

The PR refactors YAML issue-template field block parsing in scripts/docs_smoke.py to use regex-based scanning, replacing marker-split logic. A compiled FIELD_ID_RE pattern extracts field id lines, and _template_field_block now locates target fields and returns contiguous blocks. A new test validates exact field-ID matching.

Changes

Template field block parsing with exact ID matching

Layer / File(s) Summary
Regex-based field block parsing with exact ID validation
scripts/docs_smoke.py, tests/test_docs_public_urls.py
FIELD_ID_RE regex is introduced to match id: lines with indentation and field ID capture. _template_field_block is rewritten to scan lines using regex and return the block up to the next same-indentation id:, or empty string if not found. A test verifies exact field ID matching by confirming that evidence_extra required does not mark evidence as required.

Possibly related PRs

  • ramimbo/mergework#822: Adjusts scripts/docs_smoke.py logic for parsing and validating required YAML issue-template fields with related test updates in tests/test_docs_public_urls.py.
🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers the problem, fix, and validation steps. However, it omits required template sections like Evidence and Test Evidence checkboxes. Complete the Evidence section (Confusion/bug addressed, Bounty/PR tracking, Intended surfaces, Expected size, Out of scope) and mark completed Test Evidence checkboxes.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly names the changed surface (docs smoke field matching) and clearly describes the main intent of the changeset.
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.
Mergework Public Artifact Hygiene ✅ Passed PR contains only technical changes to test validation code; no modifications to README, docs, or public-facing content that could contain investment, price, cash-out, payout, or security claims.
Bounty Pr Focus ✅ Passed PR references bou-311, modifies only stated files, includes focused test demonstrating exact field-id matching fix (evidence vs evidence_extra), no scope creep.

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


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

@Rajesh270712 Rajesh270712 force-pushed the bountyops/bou-311-docs-smoke-cleanup branch from 2184b16 to 4a3577a Compare June 4, 2026 16:11
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1f2766fb-219b-4f50-8347-e1c2d9b07515

📥 Commits

Reviewing files that changed from the base of the PR and between d4d0e48 and 2184b16.

📒 Files selected for processing (2)
  • scripts/docs_smoke.py
  • tests/test_docs_public_urls.py

Comment thread tests/test_docs_public_urls.py
Copy link
Copy Markdown

@xiefuzheng713-alt xiefuzheng713-alt left a comment

Choose a reason for hiding this comment

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

Approved for current head f8159d69f9f4290a139bed608c2b84ba70545649.

I reviewed scripts/docs_smoke.py and tests/test_docs_public_urls.py. The change fixes the old substring-based field lookup by parsing id: lines, matching the exact field id, and ending the block at the next field with the same indentation. That keeps required-field checks scoped to the intended GitHub issue-template field while preserving the existing issue-template smoke behavior.

Validation I ran locally:

  • uv run --python 3.12 --extra dev python -m pytest tests/test_docs_public_urls.py -q -> 36 passed.
  • uv run --python 3.12 --extra dev python scripts/docs_smoke.py -> docs smoke ok.
  • uv run --python 3.12 --extra dev ruff check scripts/docs_smoke.py tests/test_docs_public_urls.py -> passed; local .ruff_cache write warning only.
  • uv run --python 3.12 --extra dev ruff format --check scripts/docs_smoke.py tests/test_docs_public_urls.py -> 2 files already formatted.
  • Direct probe: exact evidence required field returned true; evidence_extra did not satisfy evidence; quoted id: "summary" returned true for summary.
  • git diff --check -> clean.
  • git merge-tree --write-tree origin/main HEAD -> clean tree 03fdbe7f95d274818fc138beb3445fd8a997e763.

I also rechecked GitHub state before approving: this is not my PR, there were no prior human reviews on this head, mergeStateStatus=CLEAN, and the hosted Quality/readiness/docs/image check is successful. Scope is docs-smoke template-field validation only; I did not see ledger, wallet, treasury, payout, admin-token, exchange/bridge/cash-out, private-data, or MRWK price behavior changes.

@stmr
Copy link
Copy Markdown

stmr commented Jun 4, 2026

Bounty #838 current-head review for PR #876.

Reviewed head f8159d69f9f4290a139bed608c2b84ba70545649. Files inspected: scripts/docs_smoke.py, tests/test_docs_public_urls.py.

Verdict: no blocker found. FIELD_ID_RE now matches issue-template field ids exactly with indentation-aware block slicing, so evidence_extra can no longer satisfy required-field checks for evidence. The regression includes both the negative exact-match check and a positive control for the real longer field id.

GitHub state checked: mergeStateStatus=CLEAN; hosted Quality, readiness, docs, and image checks passed; CodeRabbit passed. Integration note: PR #873 also touches docs smoke files, so maintainer may need normal queue ordering if that lands first. Scope is docs smoke validation and tests only. No app runtime, ledger, wallet, treasury, payout, admin-token, private data, bridge, exchange, cash-out, or MRWK price behavior changed.

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.

3 participants