Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
891e190
Add `__doc__` crate
ShaharNaveh Nov 1, 2025
e74c26f
Base auto-generate ci
ShaharNaveh Nov 3, 2025
d6e00ba
Add dummy files
ShaharNaveh Nov 3, 2025
b309e90
Update docs
ShaharNaveh Nov 3, 2025
d35a6bd
Set codegen-units to 1 for doc db
ShaharNaveh Nov 3, 2025
232fe6d
Mark `*.inc.rs` as auto generated
ShaharNaveh Nov 3, 2025
231318a
Disable doctest
ShaharNaveh Nov 7, 2025
aaa2006
Reset docs
ShaharNaveh Nov 7, 2025
c2b2249
Simplify `generate.py`
ShaharNaveh Nov 7, 2025
2db1227
No need for optimizatins in dev
ShaharNaveh Nov 7, 2025
c3b191e
simplify `lib.rs`
ShaharNaveh Nov 7, 2025
34d4f32
Regenerate docs
ShaharNaveh Nov 7, 2025
83ab568
ignore cspell
ShaharNaveh Nov 7, 2025
efd4de9
Merge remote-tracking branch 'upstream/main' into move-doc
ShaharNaveh Nov 9, 2025
6140114
Configurable python-version
ShaharNaveh Nov 9, 2025
7a432ec
Fix logic error
ShaharNaveh Nov 9, 2025
a590b8d
Output as json
ShaharNaveh Nov 9, 2025
315ef1d
GHA now uploads `data.inc.rs`
ShaharNaveh Nov 9, 2025
100a803
Generate `data.inc.rs`
ShaharNaveh Nov 9, 2025
833c786
Add info comments
ShaharNaveh Nov 9, 2025
25cf146
Fix typo of missing type
ShaharNaveh Nov 9, 2025
83c03a5
Fix typo
ShaharNaveh Nov 9, 2025
4e21b6f
Assert raw_doc is not None
ShaharNaveh Nov 9, 2025
174cb87
Check if attr is callable
ShaharNaveh Nov 9, 2025
1542895
Merge remote-tracking branch 'upstream/main' into move-doc
ShaharNaveh Nov 10, 2025
4544be3
Rename to `rustpython-doc`
ShaharNaveh Nov 10, 2025
e089740
Merge remote-tracking branch 'upstream/main' into move-doc
ShaharNaveh Nov 10, 2025
15546ab
Rename to `crates/doc`
ShaharNaveh Nov 14, 2025
4bee896
Merge remote-tracking branch 'upstream/main' into move-doc
ShaharNaveh Nov 14, 2025
9e5ed29
Increase unix CI timeout to 35 minutes (was 30)
ShaharNaveh Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Base auto-generate ci
  • Loading branch information
ShaharNaveh committed Nov 7, 2025
commit e74c26f4bce52e9294e1645ebadff5f75b51a747
70 changes: 70 additions & 0 deletions .github/workflows/update-doc-db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Update doc DB

permissions:
contents: read

on:
workflow_dispatch:
inputs:
open_pr:
description: Whether or not to open a PR with any possible changes
type: boolean
default: false

defaults:
run:
shell: bash

env:
PYTHON_VERSION: "3.13.9"

jobs:
generate:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
sparse-checkout: |
crates/rustpython_doc_db

- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Generate (${{ matrix.os }})
run: python crates/rustpython_doc_db/generate.py

- name: Detect output file
id: diff
run: echo "diff=$(git diff --name-only)" >> $GITHUB_OUTPUT

- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: doc-db-${{ env.PYTHON_VERSION }}-${{ matrix.os }}
path: ${{ steps.diff.outputs.diff }}
if-no-files-found: error
retention-days: 7
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.

⚠️ Potential issue | 🟠 Major

Major: Workflow fails if generate script produces no changes.

The workflow detects output via git diff --name-only (line 43) and uploads artifacts with if-no-files-found: error (line 49). If the generated output is already up-to-date (no changes), the job fails, which contradicts the use case where this workflow may be idempotent.

Additionally, line 39 runs the generate script with no explicit error handling—if it fails, the workflow continues to the artifact upload step.

Consider:

  1. For idempotent behavior: Use if-no-files-found: warn instead of error to allow the workflow to complete gracefully when no changes are detected.
  2. For explicit error handling: Add set -e or explicit checks after the generate step.

Apply this diff:

      - name: Generate (${{ matrix.os }})
        run: python crates/rustpython_doc_db/generate.py

      - name: Detect output file
        id: diff
        run: echo "diff=$(git diff --name-only)" >> $GITHUB_OUTPUT

      - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
        with:
          name: doc-db-${{ env.PYTHON_VERSION }}-${{ matrix.os }}
          path: ${{ steps.diff.outputs.diff }}
-         if-no-files-found: error
+         if-no-files-found: warn

Based on learnings, the maintainers prefer simplicity and accept workflows that may fail gracefully in edge cases; however, the intent here is unclear.

🤖 Prompt for AI Agents
.github/workflows/update-doc-db.yml lines 38-50: the workflow will fail when the
generate script produces no git-diff (upload-artifact uses if-no-files-found:
error) and also doesn't stop early if the generate script itself fails; change
the upload step to use if-no-files-found: warn to make idempotent runs succeed
with no changes, and make the generate step fail fast by running the script
under a strict shell (e.g., add set -e before running the python command or
check the script exit status and exit non-zero on failure) so the job correctly
surfaces generation errors.

Comment thread
coderabbitai[bot] marked this conversation as resolved.
overwrite: true
pr:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I ain't sure if we want to open a PR, or just push the generated artifacts

Copy link
Copy Markdown
Member

@youknowone youknowone Nov 9, 2025

Choose a reason for hiding this comment

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

we need to update it only when target Python version is changed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, so probably not worth the effort in automating a PR

if: false && ${{ inputs.open_pr }}
needs: generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
sparse-checkout: |
crates/rustpython_doc_db

- name: Download generated doc DBs
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
pattern: "doc-db-${{ env.PYTHON_VERSION }}-**"
merge-multiple: true