Skip to content

fix(ci): switch python api-docs to pydoc-markdown - #32

Merged
WomB0ComB0 merged 1 commit into
mainfrom
fix/api-docs-pydoc-markdown
May 9, 2026
Merged

WomB0ComB0 merged 1 commit into
mainfrom
fix/api-docs-pydoc-markdown

Conversation

@WomB0ComB0

Copy link
Copy Markdown
Member

Why

The first run of api-docs on main after #30 and #31 merged (run 25602155559) hit AttributeError: 'FileFinder' object has no attribute 'find_module' on every submodule:

Generating docs for python import: resq_mcp
Failed to generate docs for module resq_mcp.core: AttributeError("'FileFinder' object has no attribute 'find_module'")
Failed to generate docs for module resq_mcp.core.config: ...
...

Root cause: lazydocs uses pkgutil's deprecated find_module() API, which was removed in Python 3.12. The runner uses Python 3.13. lazydocs is essentially abandoned for modern Python (last release 2023).

The resulting docs PR (resq-software/docs#19) only had README.md and an empty _pages.json because the script's fail-fast caught zero generated content.

Fix

Switch to pydoc-markdown, which uses find_spec() (the supported API since Python 3.4) and produces Markdown directly via its CLI:

pydoc-markdown -p resq_mcp --render-toc > out/overview.md

One combined Markdown document per package at <pkg_dir>/overview.md. Adds an empty-output sanity check so partial / silent failures land as a hard error.

Bundled

Test plan

  • Merge.
  • Re-trigger api-docs on main.
  • Confirm the resulting docs PR has resq-mcp/overview.md and resq-dsa/overview.md with real per-module content.
  • Confirm View source URLs resolve.
  • Confirm mintlify (broken links) is zero.

lazydocs uses pkgutil's deprecated find_module() API which Python
3.12 removed. The first dispatched run on main hit
  AttributeError: 'FileFinder' object has no attribute 'find_module'
on every submodule walk; the resulting docs PR (resq-software/
docs#19) only contained the top-level README.md and an empty
_pages.json. Switch to pydoc-markdown, which is on the find_spec()
API and works on the runner's Python 3.13.

Also pulls the README-phrasing fix landing in resq-software/
docs#18 (active voice + code-formatted repo path).
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented May 9, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@WomB0ComB0 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 42 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5735756a-e3f2-4c53-9a45-626201f7e603

📥 Commits

Reviewing files that changed from the base of the PR and between bb21dab and 42ebb48.

📒 Files selected for processing (1)
  • .github/workflows/api-docs.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/api-docs-pydoc-markdown

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.

@WomB0ComB0
WomB0ComB0 merged commit c485af3 into main May 9, 2026
20 checks passed
@WomB0ComB0
WomB0ComB0 deleted the fix/api-docs-pydoc-markdown branch May 9, 2026 13:28
WomB0ComB0 added a commit that referenced this pull request May 9, 2026
Resolves zizmor code-scanning alerts #29-#43:

security.yml
- Pin reusable security-scan.yml from @main to a SHA (alert #42)
- Replace `secrets: inherit` with explicit SEMGREP_APP_TOKEN pass
  (alert #43)
- Add `actions: read` to top-level permissions so CodeQL/zizmor
  telemetry (`GET /actions/runs/{id}`) can execute under the
  inherited token. This fixes the recurring startup_failure on
  main since 2026-05-04.

publish.yml
- Drop top-level write permissions to `contents: read`; lift
  `contents: write` only onto the two semantic-release jobs that
  actually need it (alerts #38-#41).
- Add `persist-credentials: false` to all five checkouts so
  uploaded artifacts can never carry the workflow's git
  credentials (alerts #33-#37). The release jobs still pass
  GITHUB_TOKEN explicitly to python-semantic-release.

ci.yml
- Add `persist-credentials: false` to lint/typecheck/test/build
  checkouts (alerts #29-#32).

Verified locally with `zizmor v1.24.1`: "No findings to report."
WomB0ComB0 added a commit that referenced this pull request May 9, 2026
…#34)

Resolves zizmor code-scanning alerts #29-#43:

security.yml
- Pin reusable security-scan.yml from @main to a SHA (alert #42)
- Replace `secrets: inherit` with explicit SEMGREP_APP_TOKEN pass
  (alert #43)
- Add `actions: read` to top-level permissions so CodeQL/zizmor
  telemetry (`GET /actions/runs/{id}`) can execute under the
  inherited token. This fixes the recurring startup_failure on
  main since 2026-05-04.

publish.yml
- Drop top-level write permissions to `contents: read`; lift
  `contents: write` only onto the two semantic-release jobs that
  actually need it (alerts #38-#41).
- Add `persist-credentials: false` to all five checkouts so
  uploaded artifacts can never carry the workflow's git
  credentials (alerts #33-#37). The release jobs still pass
  GITHUB_TOKEN explicitly to python-semantic-release.

ci.yml
- Add `persist-credentials: false` to lint/typecheck/test/build
  checkouts (alerts #29-#32).

Verified locally with `zizmor v1.24.1`: "No findings to report."
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