Skip to content

NO-JIRA:Fix AsciiDoc documentation generation, add Docker-based spell-check, fix typos#3280

Open
vparfonov wants to merge 3 commits into
openshift:masterfrom
vparfonov:fix-ascidoc
Open

NO-JIRA:Fix AsciiDoc documentation generation, add Docker-based spell-check, fix typos#3280
vparfonov wants to merge 3 commits into
openshift:masterfrom
vparfonov:fix-ascidoc

Conversation

@vparfonov
Copy link
Copy Markdown
Contributor

@vparfonov vparfonov commented May 18, 2026

Description

  • Convert Markdown-style headings (#/##) to AsciiDoc syntax (==/===) in API Go doc comments
  • Fix heading level hierarchy in datamodel templates (===== to ====)
  • Create hack/fix-asciidoc.pl post-processing script to fix generated AsciiDoc:
    • strip carriage returns, escape || and {},
    • join multi-line table cells,
    • escape stray pipes in description cells
  • Add docs-spell-check Makefile target using podman with UBI9 Python image and codespell
  • Add .codespellignore for upstream (fileds) and domain-specific false positives (notin, coo, fileds (a real typo from upstream k8s.io/apiserver))
  • Fix typos in docs: policiy, similiarly, and others
  • Fix typos in codebase
  • Enable misspell linter for Go comments and strings

/cc @Clee2691
/assign @jcantrill

Links

  • Depending on PR(s):
  • GitHub issue:
  • JIRA:
  • Enhancement proposal:

Summary by CodeRabbit

  • Documentation
    • Corrected numerous typos, wording, headings and broken links across API docs, CRD descriptions, guides and README for clearer, more consistent documentation.
  • Build & Tooling
    • Added AsciiDoc post-processing and a docs spell-check target to prevent rendering issues and enforce doc spelling/formatting.
  • Tests
    • Fixed several test and suite descriptions to correct misspellings and improve clarity.

- Convert Markdown-style headings (#/##) to AsciiDoc syntax (==/===)
  in API Go doc comments
- Fix heading level hierarchy in datamodel templates (===== to ====)
- Create hack/fix-asciidoc.pl post-processing script to fix generated
  AsciiDoc: strip carriage returns, escape || and {}, join multi-line
  table cells, escape stray pipes in description cells
- Add docs-spell-check Makefile target using podman with UBI9 Python
  image and codespell, no local tooling installation required
- Add .codespellignore for upstream (fileds) and domain-specific
  false positives (notin, coo)
- Fix typos in docs: policiy, similiarly, and others

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 18, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@vparfonov: This pull request explicitly references no jira issue.

Details

In response to this:

Description

  • Convert Markdown-style headings (#/##) to AsciiDoc syntax (==/===) in API Go doc comments
  • Fix heading level hierarchy in datamodel templates (===== to ====)
  • Create hack/fix-asciidoc.pl post-processing script to fix generated AsciiDoc:
    • strip carriage returns, escape || and {},
    • join multi-line table cells,
    • escape stray pipes in description cells
  • Add docs-spell-check Makefile target using podman with UBI9 Python image and codespell
  • Add .codespellignore for upstream (fileds) and domain-specific false positives (notin, coo, fileds (a real typo from upstream k8s.io/apiserver))
  • Fix typos in docs: policiy, similiarly, and others

/cc @Clee2691
/assign @jcantrill

Links

  • Depending on PR(s):
  • GitHub issue:
  • JIRA:
  • Enhancement proposal:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

Adds a Perl AsciiDoc fixer and Makefile docs-spell-check target, applies AsciiDoc post-processing to generated API docs, and corrects many documentation, comment, manifest, template, and test typos and formatting issues across the repo.

Changes

Documentation and Tooling Improvements

Layer / File(s) Summary
AsciiDoc post-processing tool and Makefile integration
hack/fix-asciidoc.pl, Makefile
New Perl script escapes AsciiDoc special sequences (`
AsciiDoc templates & docs content
config/docs/templates/datamodels/asciidoc/members.tpl, docs/*, docs/reference/operator/api_logging_v1alpha1.adoc
Adjusted template heading levels and fixed multiple user-facing doc typos, link paths, and field documentation wording (including explicit allowed-char ranges in prune-filter docs and a large LogFileMetricExporter doc block update).
Manifests and CRD description updates
bundle/*, config/crd/bases/*, config/manifests/bases/*
Updated generated manifest description strings and heading formatting to match corrected Go docs and templates (field-path character wording, kubeAPIAudit section headings, receiver descriptions).
Comments, tests, scripts, and misc formatting
internal/*, test/*, hack/*, .codespellignore, .golangci.yaml, README.adoc
Widespread small fixes: comment typos, test case description corrections, import block reorders, minor script and helper comment fixes, added codespell ignore tokens, and enabling misspell linter in .golangci.yaml.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

lgtm

Poem

🐰 With whiskers twitching, I hopped through the tree,

Fixed pipes and braces, set the docs free.
Tables reflowed and typos undone,
A tidy repo—hop, hop—now it's fun! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 73.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The PR title accurately summarizes the main changes: fixing AsciiDoc documentation generation, adding Docker-based spell-check, and fixing typos across the codebase.
Description check ✅ Passed The PR description is well-structured with clear bullet points explaining the changes, mandatory reviewer/assignee assignments, and optional links sections appropriately filled or marked.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from cahartma and jcantrill May 18, 2026 09:16
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.

🧹 Nitpick comments (3)
Makefile (1)

103-105: ⚡ Quick win

Consider making codespell output visible and adding error handling.

The docs-spell-check target silently installs codespell with --quiet. While this keeps output clean, it may hide installation errors. Additionally, if codespell finds issues, users might want to see them immediately rather than having to re-run without --quiet.

♻️ Make errors visible and improve feedback
 .PHONY: docs-spell-check
 docs-spell-check:
-	podman run --rm -v $(PWD):/workdir:z registry.access.redhat.com/ubi9/python-312:latest sh -c 'pip install --quiet codespell && codespell /workdir/docs/ -I /workdir/.codespellignore'
+	podman run --rm -v $(PWD):/workdir:z registry.access.redhat.com/ubi9/python-312:latest sh -c 'pip install codespell >/dev/null && codespell /workdir/docs/ -I /workdir/.codespellignore'

This redirects pip's progress output but lets errors through, and codespell results remain visible.

🤖 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 `@Makefile` around lines 103 - 105, The docs-spell-check Makefile target
currently hides pip install progress/errors and may also suppress codespell
output; update the target (docs-spell-check) command to remove the pip --quiet
flag, check the pip install exit status, and ensure codespell runs transparently
so its findings are printed; for example, run pip install codespell and if it
fails exit with a clear error message, then run codespell /workdir/docs/ -I
/workdir/.codespellignore so that codespell output is visible to the user.
hack/fix-asciidoc.pl (2)

61-61: ⚡ Quick win

Clarify the purpose of this regex substitution.

The substitution s/(\d)-(\d+)([A-Z])/$1-$2 $3/g adds a space between a digit-hyphen-digit sequence and a following uppercase letter (e.g., "1-2A" → "1-2 A"). The purpose of this transformation is not obvious from the surrounding context. Consider adding a comment explaining why this is necessary for AsciiDoc processing.

📝 Add clarifying comment
 # Escape stray pipe characters inside table description cells
 foreach my $line (`@result`) {
     next unless $line =~ /^\|/ && $line !~ /^\|\s*=/;
 
+    # Prevent ranges like "1-2A" from being misinterpreted
     $line =~ s/(\d)-(\d+)([A-Z])/$1-$2 $3/g;
🤖 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 `@hack/fix-asciidoc.pl` at line 61, The regex substitution
s/(\d)-(\d+)([A-Z])/$1-$2 $3/g in fix-asciidoc.pl is unclear; add an inline
comment immediately above the substitution explaining that it inserts a space
between a digit-hyphen-digit sequence and a following uppercase letter (e.g.,
"1-2A" → "1-2 A") and why this normalization is required for AsciiDoc processing
(such as preventing token merging or ensuring proper word separation for
headings/anchors); reference the exact substitution pattern in the comment so
future readers can understand the intent.

8-8: 💤 Low value

Consider checking close() return values for completeness.

While open() errors are checked with or die, the close() calls don't verify success. In practice, close failures on read handles are rarely critical, but write handle close failures can indicate data loss (e.g., disk full). For a post-processing script that modifies files in place, checking the write close would be more defensive.

🛡️ Check close on write
 open($fh, '>', $file) or die "Cannot write to $file: $!";
 print $fh `@result`;
-close($fh);
+close($fh) or die "Failed to close $file: $!";

Also applies to: 72-72

🤖 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 `@hack/fix-asciidoc.pl` at line 8, The script currently calls close($fh)
without checking its return; update the code paths that close write filehandles
(the close($fh) calls at the locations noted) to verify the return value and
handle failures (e.g., die or warn with the actual $! error) so write-close
errors (like disk full) are surfaced; keep existing behavior for read-only
closes if you prefer, but ensure the in-place write/temporary file close in
fix-asciidoc.pl checks close($fh) and reports/handles errors appropriately.
🤖 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 `@hack/fix-asciidoc.pl`:
- Line 61: The regex substitution s/(\d)-(\d+)([A-Z])/$1-$2 $3/g in
fix-asciidoc.pl is unclear; add an inline comment immediately above the
substitution explaining that it inserts a space between a digit-hyphen-digit
sequence and a following uppercase letter (e.g., "1-2A" → "1-2 A") and why this
normalization is required for AsciiDoc processing (such as preventing token
merging or ensuring proper word separation for headings/anchors); reference the
exact substitution pattern in the comment so future readers can understand the
intent.
- Line 8: The script currently calls close($fh) without checking its return;
update the code paths that close write filehandles (the close($fh) calls at the
locations noted) to verify the return value and handle failures (e.g., die or
warn with the actual $! error) so write-close errors (like disk full) are
surfaced; keep existing behavior for read-only closes if you prefer, but ensure
the in-place write/temporary file close in fix-asciidoc.pl checks close($fh) and
reports/handles errors appropriately.

In `@Makefile`:
- Around line 103-105: The docs-spell-check Makefile target currently hides pip
install progress/errors and may also suppress codespell output; update the
target (docs-spell-check) command to remove the pip --quiet flag, check the pip
install exit status, and ensure codespell runs transparently so its findings are
printed; for example, run pip install codespell and if it fails exit with a
clear error message, then run codespell /workdir/docs/ -I
/workdir/.codespellignore so that codespell output is visible to the user.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 97bafab6-1f3c-4a06-bc01-35225e2f75ea

📥 Commits

Reviewing files that changed from the base of the PR and between e6cb82d and 431748c.

📒 Files selected for processing (22)
  • .codespellignore
  • Makefile
  • api/observability/v1/filter_api_audit_types.go
  • api/observability/v1/filter_types.go
  • api/observability/v1/input_types.go
  • api/observability/v1/output_types.go
  • bundle/manifests/cluster-logging.clusterserviceversion.yaml
  • bundle/manifests/observability.openshift.io_clusterlogforwarders.yaml
  • config/crd/bases/observability.openshift.io_clusterlogforwarders.yaml
  • config/docs/templates/datamodels/asciidoc/members.tpl
  • config/manifests/bases/cluster-logging.clusterserviceversion.yaml
  • docs/README.adoc
  • docs/administration/clusterlogforwarder.adoc
  • docs/administration/lokistack.adoc
  • docs/administration/upgrade/v6.0_changes.adoc
  • docs/architecture/readme.adoc
  • docs/features/logforwarding/filters/prune-filter.adoc
  • docs/reference/datamodels/viaq/v1.adoc
  • docs/reference/operator/api_logging_v1alpha1.adoc
  • docs/reference/operator/api_observability_v1.adoc
  • hack/fix-asciidoc.pl
  • internal/generator/vector/api/sinks/prometheus_export.go

@vparfonov
Copy link
Copy Markdown
Contributor Author

/retest

Comment thread Makefile
docs: docs/reference/operator/api_observability_v1.adoc docs/reference/operator/api_logging_v1alpha1.adoc docs/reference/datamodels/viaq/v1.adoc
.PHONY: docs

.PHONY: docs-spell-check
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This probably should be added to either the linter script or lint target

Copy link
Copy Markdown
Contributor Author

@vparfonov vparfonov May 20, 2026

Choose a reason for hiding this comment

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

enable misspell linter for Go comments and strings

@jcantrill
Copy link
Copy Markdown
Contributor

/hold

@jcantrill
Copy link
Copy Markdown
Contributor

/approve

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 18, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 18, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcantrill, vparfonov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 18, 2026
@vparfonov vparfonov requested a review from jcantrill May 20, 2026 14:47
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 2026

@vparfonov: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@vparfonov vparfonov changed the title NO-JIRA:Fix AsciiDoc documentation generation and add Docker-based spell-check NO-JIRA:Fix AsciiDoc documentation generation, add Docker-based spell-check, fix typos May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants