Skip to content

👷 DOP-5399 adds Osiris Coverage GHA #638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 11, 2025
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/add-netlify-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Add Netlify Links To Changed Pages
on:
workflow_call:
pull_request_target:
paths-ignore:
- "source/**/*.ast"
jobs:
get-pr-changes:
name: Get Changed Files & Update PR Description
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/osiris-subpar-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Coverage Check for Osiris Generated AST files
on:
pull_request:
paths:
- '**/*.ast' # Only trigger if .ast files are changed
branches:
- main

jobs:
check-coverage:
runs-on: ubuntu-latest
outputs:
site_coverage_list: ${{ steps.set_coverage.outputs.site_coverage_list }}
coverage_below_threshold: ${{ steps.set_coverage.outputs.coverage_below_threshold }}

steps:
- name: Checkout Repos
uses: actions/checkout@v4
# uncomment when running or testing locally using [act](https://github.com/nektos/act?tab=readme-ov-file)
# with:
# token: ${{ secrets.API_TOKEN_GITHUB }}
# ref: DOP-5399-placeholder

- name: Verify Branch Checkout
run: |
git branch --show-current # Print the current branch

- name: Install Wget
run: sudo apt-get update && sudo apt-get install -y wget

- name: Clone Osiris
run: git clone https://x-access-token:${{ secrets.API_TOKEN_GITHUB }}@github.com/10gen/osiris.git cloned-osiris-repo

- name: Run Coverage Check
id: run_coverage
uses: mongodb/docs-worker-actions/coverage-check@main
with:
repo-path: cloned-osiris-repo
required-coverage: '90'

- name: Set Workflow Outputs
id: set_coverage
run: |
echo "coverage_below_threshold=${coverage_below_threshold}" >> $GITHUB_OUTPUT
echo "site_coverage_list=${SITE_COVERAGE_LIST}" >> $GITHUB_OUTPUT

send-slack-notification:
runs-on: ubuntu-latest
needs: check-coverage
if: needs.check-coverage.outputs.coverage_below_threshold == 'true'

steps:
- name: Send Slack Notification
env:
SITE_COVERAGE_LIST: ${{ needs.check-coverage.outputs.site_coverage_list }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
REPOSITORY: ${{ github.repository }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
uses: mongodb/docs-worker-actions/coverage-report-to-slack@main
with:
required-coverage: '90'
site-coverage-list: $SITE_COVERAGE_LIST
slack-webhook-url: $SLACK_WEBHOOK_URL
repository: $REPOSITORY
pr-title: $PR_TITLE
pr-number: $PR_NUMBER
pr-url: $PR_URL
pr-sha: $PR_SHA
2 changes: 2 additions & 0 deletions .github/workflows/vale-tdbx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
pull_request:
paths:
- "source/**"
paths-ignore:
- "source/**/*.ast"

jobs:
vale:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ giza.log
.vscode*
*.swp
*.code-workspace

# GitHub Actions
.secrets
event.json
Loading