Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 23 additions & 1 deletion .github/workflows/operator-discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,24 @@ jobs:
- name: Checkout mongodb/docs operator pages
run: |
git clone -q --filter=blob:none --no-checkout https://github.com/mongodb/docs.git "$RUNNER_TEMP/docs"
# The operator pages, their includes and tested snippets, and for capability coverage the
# rest of the reference and the pages its links name (audits/config/manual-baseline-sources.json).
git -C "$RUNNER_TEMP/docs" sparse-checkout set --no-cone \
/content/manual/manual/source/reference/operator/ /content/manual/manual/source/includes/ \
/content/manual/manual/snooty.toml /content/manual/manual/source/reference/ \
/content/manual/manual/source/includes/ /content/manual/manual/source/core/ \
/content/manual/manual/source/tutorial/ /content/manual/manual/source/images/ \
/content/manual/manual/source/code-examples/ \
/content/code-examples/tested/
git -C "$RUNNER_TEMP/docs" checkout -q

- name: Setup the pinned parser's Python
uses: actions/setup-python@v6
with:
python-version: '3.12.16'

- name: Install the pinned runtime manager
run: python -m pip install uv==0.13.7

- name: Discover, generate and integrate
run: audits/discover.sh "$RUNNER_TEMP/docs" "$RUNNER_TEMP/discovery" --integrate

Expand Down Expand Up @@ -118,6 +131,14 @@ jobs:
-Daudits.mainClass=dev.morphia.audits.publish.PublishMainKt \
-Dexec.args="discovery $RUNNER_TEMP/discovery $PWD/audits/catalog/documented-examples.json $PWD/audits/catalog/publication-policy.json $RUNNER_TEMP/journal.json $PWD/pom.xml ${{ github.repository }} $flag" \
| tee "$RUNNER_TEMP/publications.json"
# Capability coverage against the accepted baseline: missing APIs and version annotations,
# from the contexts the report finds healthy. The same journal keeps both idempotent.
if [ -f "$RUNNER_TEMP/discovery/coverage.json" ]; then
./mvnw -B -ntp -q -Daudits -pl audits exec:java \
-Daudits.mainClass=dev.morphia.audits.publish.PublishMainKt \
-Dexec.args="$RUNNER_TEMP/discovery/coverage.json $PWD/audits/catalog/publication-policy.json $RUNNER_TEMP/journal.json $PWD/pom.xml ${{ github.repository }} $flag" \
| tee "$RUNNER_TEMP/coverage-publications.json"
fi

- name: Upload publications
uses: actions/upload-artifact@v7
Expand All @@ -126,6 +147,7 @@ jobs:
name: operator-publications
path: |
${{ runner.temp }}/publications.json
${{ runner.temp }}/coverage-publications.json
${{ runner.temp }}/journal.json
if-no-files-found: ignore
retention-days: 90
11 changes: 9 additions & 2 deletions audits/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Every command below runs through the exec plugin from the repository root, after
| `audits/catalog/name-backport*.json` | Descriptive names given to the legacy fixtures. |
| `audits/catalog/legacy-corpus.json` | The preservation snapshot of the legacy corpus. |
| `audits/catalog/publication-policy.json` | Labels the publisher applies. |
| `audits/catalog/discovery-plan.json`, `capability-catalog.json`, `coverage-plan.json` | The accepted capability baseline: discovery policy with reviewed assignments and omissions, the capabilities found at the baseline's commit, and the identities, minimums, bindings and exclusions later runs are held to. |
| `core/src/test/resources/dev/morphia/test/generated/manifest.json` | Every case on the runner and every file the generated namespace owns. |
| `core/src/test/java/dev/morphia/test/generated/` | Generated test classes; never edit them by hand. |

Expand All @@ -59,6 +60,9 @@ of mongodb/docs, then its Publish job files the findings as issues in this repos
- **Cover the documented `<operator>` example "…"** (`Task`, `proposed`): an example that appeared
upstream since the committed inventory, with no test.
- **Generated operator cases fail integration** (`bug`), naming the failing tests.
- **Add `<operator>`** (`enhancement`, `proposed`) and version-annotation fixes (`bug`): from the
capability coverage report, which compares the manual's operators, contexts and versions with the
accepted baseline in `discovery-plan.json`, `capability-catalog.json` and `coverage-plan.json`.

Each issue carries a hidden marker, so a rerun updates the publisher's section of an open issue
instead of filing it again, and keeps any edits outside that section. The journal of filed issues
Expand All @@ -79,8 +83,11 @@ To run discovery locally, clone the pages the same way (about 5 seconds):
```sh
git clone -q --filter=blob:none --no-checkout https://github.com/mongodb/docs.git /tmp/docs
git -C /tmp/docs sparse-checkout set --no-cone \
/content/manual/manual/source/reference/operator/ /content/manual/manual/source/includes/ \
/content/code-examples/tested/
/content/manual/manual/snooty.toml /content/manual/manual/source/reference/ \
/content/manual/manual/source/includes/ /content/manual/manual/source/core/ \
/content/manual/manual/source/tutorial/ /content/manual/manual/source/images/ \
/content/manual/manual/source/code-examples/ /content/code-examples/tested/
uv sync --frozen --project audits/parser # the pinned parser, for capability coverage
git -C /tmp/docs checkout -q
audits/discover.sh /tmp/docs /tmp/discovery --integrate
```
Expand Down
Loading
Loading