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
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/compatibility-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Integration compatibility problem
description: Report behavior that disagrees with a tested compatibility result.
title: "[Compatibility] "
body:
- type: markdown
attributes:
value: |
Include a minimal reproduction with synthetic data. Do not include credentials,
connection strings containing secrets, or customer data. A passing dashboard
result covers only its listed scenarios and version pair.
- type: input
id: integration
attributes:
label: Integration
validations:
required: true
- type: input
id: documentdb_version
attributes:
label: DocumentDB version
validations:
required: true
- type: input
id: upstream_version
attributes:
label: Integration version
validations:
required: true
- type: textarea
id: environment
attributes:
label: Actual environment
description: Include operating system, runtime, topology, and relevant non-secret settings.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction and expected versus actual behavior
validations:
required: true
- type: textarea
id: dashboard_run
attributes:
label: Dashboard and pipeline run
description: Include the dashboard entry or run that led you to expect this scenario to work.
validations:
required: true
14 changes: 12 additions & 2 deletions .github/workflows/compatibility-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:
paths:
- "compatibility/**"
- ".github/workflows/compatibility*"
- ".github/aw/actions-lock.json"
- ".github/ISSUE_TEMPLATE/compatibility-report.yml"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- "compatibility/**"
- ".github/workflows/compatibility*"
- ".github/aw/actions-lock.json"
- ".github/ISSUE_TEMPLATE/compatibility-report.yml"

concurrency:
group: compatibility-infrastructure-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -43,5 +43,15 @@ jobs:
python -m mypy --config-file compatibility/pyproject.toml compatibility
- name: Run compatibility unit tests
run: python -m pytest -c compatibility/pyproject.toml compatibility/unit
- name: Check the trusted Git history publisher
run: shellcheck compatibility/persist.sh
- name: Check the README dashboard publisher
run: shellcheck compatibility/publish-readme.sh
- name: Check JavaScript reporting and dashboard freshness
run: |
image=$(sed -n 's/^FROM //p' compatibility/integrations/nodejs/Dockerfile)
docker run --rm --read-only --network none --user 1000:1000 \
--tmpfs /tmp:size=64m --cap-drop=ALL --security-opt=no-new-privileges \
--mount "type=bind,source=$PWD,target=/workspace,readonly" \
--workdir /workspace "$image" \
node --test compatibility/unit/test_freshness.cjs compatibility/unit/test_nodejs.cjs
46 changes: 46 additions & 0 deletions .github/workflows/compatibility-documentdb-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Compatibility DocumentDB releases

on:
push:
branches: [main]
paths:
- compatibility/registry.yaml

permissions:
contents: read

jobs:
dispatch:
name: Test added or re-pinned DocumentDB releases
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
actions: write
contents: read
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Install trusted orchestration dependencies
run: python -m pip install -r compatibility/requirements.txt
- name: Dispatch the compatibility workflow for each changed release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
BEFORE: ${{ github.event.before }}
run: |
previous="$RUNNER_TEMP/previous-registry.yaml"
if ! git show "$BEFORE:compatibility/registry.yaml" > "$previous"; then
echo "The previous registry is unavailable, so every reviewed release is dispatched."
: > "$previous"
fi
releases=$(python -m compatibility.workflow changed-releases --previous "$previous")
for release in $releases; do
printf 'Dispatching compatibility runs for DocumentDB %s\n' "$release"
gh workflow run compatibility.yml --ref "$GITHUB_REF_NAME" \
-f integration=all -f documentdb_version="$release" -f trigger=documentdb_release
done
57 changes: 57 additions & 0 deletions .github/workflows/compatibility-watcher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Upstream compatibility watcher

on:
schedule:
- cron: "23 8 * * *"
workflow_dispatch:

permissions: {}

concurrency:
group: compatibility-upstream-watcher
cancel-in-progress: false

jobs:
discover:
name: Discover eligible upstream releases
if: ${{ vars.COMPATIBILITY_WATCHER_ENABLED == 'true' && github.ref_name == github.event.repository.default_branch }}
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Install trusted watcher dependencies
run: python -m pip install -r compatibility/requirements.txt
- name: Discover and durably record eligible releases
env:
GITHUB_TOKEN: ${{ github.token }}
COMPATIBILITY_WATCHER_ENABLED: ${{ vars.COMPATIBILITY_WATCHER_ENABLED }}
run: python -m compatibility.watcher discover
dispatch:
name: Dispatch reviewed compatibility profiles
needs: discover
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: write
actions: write
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Install trusted watcher dependencies
run: python -m pip install -r compatibility/requirements.txt
- name: Reconcile receipts and dispatch at most three reviewed version pairs
env:
GITHUB_TOKEN: ${{ github.token }}
COMPATIBILITY_WATCHER_ENABLED: ${{ vars.COMPATIBILITY_WATCHER_ENABLED }}
run: python -m compatibility.watcher dispatch
199 changes: 199 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: Ecosystem compatibility
run-name: ${{ inputs.detection_id != '' && format('Ecosystem compatibility [watch:{0}:{1}]', inputs.detection_id, inputs.dispatch_id) || 'Ecosystem compatibility' }}

on:
workflow_dispatch:
inputs:
integration:
description: Integration, or all enabled registry entries
type: choice
options:
- all
- pymongo
- mongodb-node
- mongoose
default: all
required: true
version:
description: Upstream version override (single integration only; blank uses registry defaults)
type: string
required: false
documentdb_version:
description: Version key from compatibility/registry.yaml (e.g. 1.2.0), or all (blank uses the newest)
type: string
required: false
trigger:
description: Execution trigger recorded with the results
type: choice
options:
- manual
- documentdb_release
default: manual
required: true
detection_id:
description: Recorded upstream detection ID (leave blank for a manual run)
type: string
required: false
dispatch_id:
description: Recorded dispatch nonce (required with detection_id)
type: string
required: false
schedule:
- cron: "41 5 * * *"

permissions:
contents: read

jobs:
plan:
name: Select integrations
runs-on: ubuntu-24.04
timeout-minutes: 5
outputs:
matrix: ${{ steps.select.outputs.matrix }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Install trusted orchestration dependencies
run: python -m pip install -r compatibility/requirements.txt
- name: Resolve the reviewed integration matrix
id: select
env:
INTEGRATION: ${{ inputs.integration }}
VERSION: ${{ inputs.version }}
DOCUMENTDB_VERSION: ${{ github.event_name == 'schedule' && 'all' || inputs.documentdb_version }}
TRIGGER: ${{ github.event_name == 'schedule' && 'scheduled' || inputs.trigger }}
DETECTION_ID: ${{ inputs.detection_id }}
DISPATCH_ID: ${{ inputs.dispatch_id }}
GITHUB_TOKEN: ${{ github.token }}
COMPATIBILITY_WATCHER_ENABLED: ${{ vars.COMPATIBILITY_WATCHER_ENABLED }}
run: |
args=()
if [ -n "$INTEGRATION" ]; then args+=(--integration "$INTEGRATION"); fi
if [ -n "$DOCUMENTDB_VERSION" ]; then args+=(--documentdb-version "$DOCUMENTDB_VERSION"); fi
if [ -n "$VERSION" ]; then args+=(--version "$VERSION"); fi
if [ -n "$TRIGGER" ]; then args+=(--trigger "$TRIGGER"); fi
if [ -n "$DETECTION_ID" ] || [ -n "$DISPATCH_ID" ]; then
args+=(--detection-id "$DETECTION_ID" --dispatch-id "$DISPATCH_ID")
fi
matrix=$(python -m compatibility.workflow matrix "${args[@]}")
printf 'matrix=%s\n' "$matrix" >> "$GITHUB_OUTPUT"
test:
name: ${{ matrix.integration_label }} ${{ matrix.version }} on DocumentDB ${{ matrix.documentdb_release_tag }}
needs: plan
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Install trusted orchestration dependencies
run: python -m pip install -r compatibility/requirements.txt
- name: Run the isolated integration profile
id: suite
env:
INTEGRATION: ${{ matrix.integration }}
VERSION: ${{ matrix.version }}
DOCUMENTDB_VERSION: ${{ matrix.documentdb_version }}
TRIGGER: ${{ matrix.trigger }}
DETECTION_ID: ${{ matrix.detection_id }}
EXPECTED_ARTIFACTS: ${{ join(matrix.artifact_sha256s || fromJSON('[]'), ',') }}
NPM_BUNDLE: ${{ matrix.npm_bundle }}
EXPECTED_NPM_BUNDLE_SHA256: ${{ matrix.npm_bundle_sha256 }}
run: |
args=(
--integration "$INTEGRATION"
--version "$VERSION"
--documentdb-version "$DOCUMENTDB_VERSION"
--output "results/$INTEGRATION/$DOCUMENTDB_VERSION/result.json"
--run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/attempts/$GITHUB_RUN_ATTEMPT"
--trigger "$TRIGGER"
)
if [ -n "$DETECTION_ID" ]; then
args+=(--detection-id "$DETECTION_ID")
IFS=, read -r -a artifacts <<< "$EXPECTED_ARTIFACTS"
for artifact in "${artifacts[@]}"; do args+=(--expected-artifact-sha256 "$artifact"); done
if [ -n "$NPM_BUNDLE" ]; then
printf '%s' "$NPM_BUNDLE" > "$RUNNER_TEMP/compatibility-npm-candidate.json"
args+=(
--npm-bundle "$RUNNER_TEMP/compatibility-npm-candidate.json"
--expected-npm-bundle-sha256 "$EXPECTED_NPM_BUNDLE_SHA256"
)
fi
fi
python -m compatibility.runner "${args[@]}"
- name: Retain integration results and sanitized diagnostics
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: compatibility-results-${{ matrix.integration }}-${{ matrix.documentdb_version }}-${{ github.run_attempt }}
path: results/
if-no-files-found: error
retention-days: 30
report:
name: Combined compatibility report
needs: [plan, test]
if: always() && needs.plan.result == 'success'
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Install trusted reporting dependencies
run: python -m pip install -r compatibility/requirements.txt
- name: Collect this attempt's integration artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
pattern: compatibility-results-*-${{ github.run_attempt }}
path: incoming
merge-multiple: true
- name: Render combined results, including missing or failed integrations
if: always()
env:
INTEGRATION: ${{ inputs.integration }}
VERSION: ${{ inputs.version }}
DOCUMENTDB_VERSION: ${{ github.event_name == 'schedule' && 'all' || inputs.documentdb_version }}
TRIGGER: ${{ github.event_name == 'schedule' && 'scheduled' || inputs.trigger }}
DETECTION_ID: ${{ inputs.detection_id }}
DISPATCH_ID: ${{ inputs.dispatch_id }}
EXPECTED_NPM_BUNDLE_SHA256: ${{ fromJSON(needs.plan.outputs.matrix).include[0].npm_bundle_sha256 }}
run: |
args=(
--input incoming
--output report
--summary "$GITHUB_STEP_SUMMARY"
--expected-run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/attempts/$GITHUB_RUN_ATTEMPT"
)
if [ -n "$INTEGRATION" ]; then args+=(--integration "$INTEGRATION"); fi
if [ -n "$DOCUMENTDB_VERSION" ]; then args+=(--documentdb-version "$DOCUMENTDB_VERSION"); fi
if [ -n "$VERSION" ]; then args+=(--version "$VERSION"); fi
if [ -n "$TRIGGER" ]; then args+=(--trigger "$TRIGGER"); fi
if [ -n "$DETECTION_ID" ] || [ -n "$DISPATCH_ID" ]; then
args+=(--detection-id "$DETECTION_ID" --dispatch-id "$DISPATCH_ID")
fi
if [ -n "$EXPECTED_NPM_BUNDLE_SHA256" ]; then
args+=(--expected-npm-bundle-sha256 "$EXPECTED_NPM_BUNDLE_SHA256")
fi
python -m compatibility.workflow report "${args[@]}"
- name: Retain the combined summary and dashboard
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: compatibility-report-${{ github.run_attempt }}
path: report/
if-no-files-found: error
retention-days: 30
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ playground's README states what it needs.
## Compatibility status

[![PyMongo compatibility](/../compatibility-data/site/badges/pymongo.svg)](/../compatibility-data/site/README.md#pymongo)
[![mongodb-node compatibility](/../compatibility-data/site/badges/nodejs.svg)](/../compatibility-data/site/README.md#mongodb-node)
[![Mongoose compatibility](/../compatibility-data/site/badges/mongoose.svg)](/../compatibility-data/site/README.md#mongoose)

[Run details and accessible results](/../compatibility-data/site/README.md)
show tested versions, actual execution timestamps, and the latest attempt
Expand Down
Loading