Skip to content

ci: add workflow to verify generated docs are up to date#2096

Open
Adi-204 wants to merge 5 commits into
asyncapi:masterfrom
Adi-204:ci/verify-docs-up-to-date
Open

ci: add workflow to verify generated docs are up to date#2096
Adi-204 wants to merge 5 commits into
asyncapi:masterfrom
Adi-204:ci/verify-docs-up-to-date

Conversation

@Adi-204
Copy link
Copy Markdown
Member

@Adi-204 Adi-204 commented May 22, 2026

Description

Adds a CI check that regenerates docs on every PR and fails if the committed API.md files drift from their sources. Also fixes the react-sdk docs script to use sequential execution (&&) instead of parallel (&) and to resolve jsdoc2md via PATH rather than a hardcoded node_modules path, which was causing the regeneration to silently produce stale output on some environments.

image

Related issue(s)
Fixes #2038

Summary by CodeRabbit

  • Chores
    • Updated documentation generation workflow and added automated verification to ensure documentation stays current with code changes.

Review Change Stack

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: 64929f1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@asyncapi-bot
Copy link
Copy Markdown
Contributor

What reviewer looks at during PR review

The following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.

  1. PR Title: Use a concise title that follows our Conventional Commits guidelines and clearly summarizes the change using imperative mood (it means spoken or written as if giving a command or instruction, like "add new helper for listing operations")

    Note - In Generator, prepend feat: or fix: in PR title only when PATCH/MINOR release must be triggered.

  2. PR Description: Clearly explain the issue being solved, summarize the changes made, and mention the related issue.

    Note - In Generator, we use Maintainers Work board to track progress. Ensure the PR Description includes Resolves #<issue-number> or Fixes #<issue-number> this will automatically close the linked issue when the PR is merged and helps automate the maintainers workflow.

  3. Documentation: Update the relevant Generator documentation to accurately reflect the changes introduced in the PR, ensuring users and contributors have up-to-date guidance.

  4. Comments and JSDoc: Write clear and consistent JSDoc comments for functions, including parameter types, return values, and error conditions, so others can easily understand and use the code.

  5. DRY Code: Ensure the code follows the Don't Repeat Yourself principle. Look out for duplicate logic that can be reused.

  6. Test Coverage: Ensure the new code is well-tested with meaningful test cases that pass consistently and cover all relevant edge cases.

  7. Commit History: Contributors should avoid force-pushing as much as possible. It makes it harder to track incremental changes and review the latest updates.

  8. Template Design Principles Alignment: While reviewing template-related changes in the packages/ directory, ensure they align with the Assumptions and Principles. If any principle feels outdated or no longer applicable, start a discussion these principles are meant to evolve with the project.

  9. Reduce Scope When Needed: If an issue or PR feels too large or complex, consider splitting it and creating follow-up issues. Smaller, focused PRs are easier to review and merge.

  10. Bot Comments: As reviewers, check that contributors have appropriately addressed comments or suggestions made by automated bots. If there are bot comments the reviewer disagrees with, react to them or mark them as resolved, so the review history remains clear and accurate.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2aae9cf9-b8fa-4df4-af54-2773b4a35666

📥 Commits

Reviewing files that changed from the base of the PR and between 6c94c15 and 64929f1.

📒 Files selected for processing (1)
  • .github/workflows/verify-docs-up-to-date.yml

📝 Walkthrough

Walkthrough

This PR adds a GitHub Actions workflow to verify generated documentation stays up-to-date in PRs, and updates the docs generation script to call jsdoc2md directly from PATH instead of through node_modules/.bin.

Changes

Documentation Verification & Generation

Layer / File(s) Summary
Docs verification CI workflow
.github/workflows/verify-docs-up-to-date.yml
New GitHub Actions workflow that regenerates documentation assets on PR events, compares the result against committed files using git diff --exit-code, and fails the check if drift is detected. The workflow skips draft PRs and specific bot/title patterns.
Docs generation script update
apps/react-sdk/package.json
Updated the docs:markdown npm script to call jsdoc2md directly from PATH instead of using the explicit ./node_modules/.bin/jsdoc2md reference.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 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 title clearly and concisely summarizes the main change: adding a CI workflow to verify generated docs are up to date, following Conventional Commits format with the 'ci:' prefix and imperative mood.
Linked Issues check ✅ Passed The PR fully implements the requirements from issue #2038: adds a GitHub Actions workflow that regenerates docs on PRs and fails if git diff detects changes, with proper bot filtering and draft PR exclusion.
Out of Scope Changes check ✅ Passed The PR includes both the primary objective (verify-docs-up-to-date workflow) and related necessary fixes to the react-sdk docs script for proper execution, both of which are documented in issue #2038.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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: 2

🤖 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.

Inline comments:
In @.github/workflows/update-docs-up-to-date.yml:
- Around line 33-35: Replace the floating ref
"asyncapi/.github/.github/actions/get-node-version-from-package-lock@master"
with an immutable commit SHA: locate the uses line (id: lockversion) and change
the tail "`@master`" to a specific commit hash (e.g. "@<commit-sha>") obtained
from the asyncapi/.github repo to pin the action; apply the same change for
other workflows that reference this action to ensure reproducible runs.

In `@apps/react-sdk/package.json`:
- Around line 61-62: Add a top-level "engines" field to the package.json for
apps/react-sdk specifying Node and npm version constraints; update the
package.json (same object that contains keys like "name", "version", and
"scripts") to include "engines": { "node": ">=24.11", "npm": ">=11.5.1" } so
tooling and CI enforce Node >=24.11 and npm >=11.5.1.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5fae166d-5d2f-4ca4-9ac2-f7595cb58c75

📥 Commits

Reviewing files that changed from the base of the PR and between 6e5f64f and 34cc063.

📒 Files selected for processing (2)
  • .github/workflows/update-docs-up-to-date.yml
  • apps/react-sdk/package.json

Comment thread .github/workflows/verify-docs-up-to-date.yml
Comment thread apps/react-sdk/package.json
@sonarqubecloud
Copy link
Copy Markdown

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.

Add CI check to verify generated docs are up to date on PRs

2 participants