Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

ci: problem matchers (#8798)

Myles Scolnickb92b317f96fc
diff --git a/.github/actions/pr-comment-on-failure/action.yaml b/.github/actions/pr-comment-on-failure/action.yaml
index bbdc73bd16..d66ffde5ac 100644
--- a/.github/actions/pr-comment-on-failure/action.yaml
+++ b/.github/actions/pr-comment-on-failure/action.yaml
@@ -1,5 +1,5 @@
-name: "PR Comment on Failure"
-description: "Comments on PRs from forks when checks fail"
+name: "Job Summary on Failure"
+description: "Adds a job summary when checks fail, helping contributors fix issues"
inputs:
check-name:
description: "The name of the check that failed"
@@ -7,57 +7,14 @@ inputs:
command:
description: "The command that contributors should run"
required: true
- github-token:
- description: "GitHub token for commenting"
- required: true
runs:
using: "composite"
steps:
- - name: Comment on PR
- if: github.event.pull_request.head.repo.fork == true
- uses: actions/github-script@v7
- with:
- github-token: ${{ inputs.github-token }}
- script: |
- const checkName = '${{ inputs.check-name }}';
- const command = '${{ inputs.command }}';
-
- const body = `👋 It looks like the **${checkName}** check failed.
-
- To fix this locally, please run:
-
- \`\`\`bash
- ${command}
- \`\`\`
- `;
-
- // Check if we already commented
- const { data: comments } = await github.rest.issues.listComments({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- });
-
- const botComment = comments.find(comment =>
- comment.user.type === 'Bot' &&
- comment.body.includes(checkName)
- );
-
- if (botComment) {
- // Update existing comment
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: botComment.id,
- body: body
- });
- } else {
- // Create new comment
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- body: body
- });
- }
+ - name: Add failure summary
+ shell: bash
+ env:
+ CHECK_NAME: ${{ inputs.check-name }}
+ COMMAND: ${{ inputs.command }}
+ run: |
+ printf '### 👋 The **%s** check failed\n\nTo fix this locally, please run:\n\n```bash\n%s\n```\n' "$CHECK_NAME" "$COMMAND" >> "$GITHUB_STEP_SUMMARY"
diff --git a/.github/problemMatchers/mypy.json b/.github/problemMatchers/mypy.json
new file mode 100644
index 0000000000..a17bfa1b5e
--- /dev/null
+++ b/.github/problemMatchers/mypy.json
@@ -0,0 +1,17 @@
+{
+ "problemMatcher": [
+ {
+ "owner": "mypy",
+ "severity": "error",
+ "pattern": [
+ {
+ "regexp": "^([^:]+):(\\d+): (error|warning): (.+)$",
+ "file": 1,
+ "line": 2,
+ "severity": 3,
+ "message": 4
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/problemMatchers/tsc.json b/.github/problemMatchers/tsc.json
new file mode 100644
index 0000000000..ec32b558cd
--- /dev/null
+++ b/.github/problemMatchers/tsc.json
@@ -0,0 +1,19 @@
+{
+ "problemMatcher": [
+ {
+ "owner": "tsc",
+ "severity": "error",
+ "pattern": [
+ {
+ "regexp": "^.*?([^\\s(]+)\\((\\d+),(\\d+)\\): (error|warning) (TS\\d+): (.+)$",
+ "file": 1,
+ "line": 2,
+ "column": 3,
+ "severity": 4,
+ "code": 5,
+ "message": 6
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/workflows/test_be.yaml b/.github/workflows/test_be.yaml
index 0462dfce25..9e8987a62b 100644
--- a/.github/workflows/test_be.yaml
+++ b/.github/workflows/test_be.yaml
@@ -11,7 +11,6 @@ concurrency:
permissions:
contents: read
- pull-requests: write
env:
MARIMO_SKIP_UPDATE_CHECK: 1
@@ -51,13 +50,13 @@ jobs:
id: docs
run: uv run --group docs mkdocs build --strict
- - name: Comment on docs failure
+ - name: Summarize docs failure
if: failure() && steps.docs.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
+ continue-on-error: true
with:
check-name: "docs build"
command: "uv run --group docs mkdocs build --strict"
- github-token: ${{ secrets.GITHUB_TOKEN }}
test_check:
needs: changes
@@ -73,27 +72,30 @@ jobs:
- name: 🧹 Lint
id: lint
- run: uv run ruff check --fix
+ run: uv run ruff check --fix --output-format=github
+
+ - name: 📋 Register mypy problem matcher
+ run: echo "::add-matcher::.github/problemMatchers/mypy.json"
- name: 🔍 Typecheck
id: typecheck
run: uv run --only-group typecheck mypy marimo --exclude=marimo/_tutorials/
- - name: Comment on lint failure
+ - name: Summarize lint failure
if: failure() && steps.lint.outcome == 'failure'
+ continue-on-error: true
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "lint"
command: "uv run ruff check --fix"
- github-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Comment on typecheck failure
+ - name: Summarize typecheck failure
if: failure() && steps.typecheck.outcome == 'failure'
+ continue-on-error: true
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "typecheck"
command: "uv run --only-group typecheck mypy marimo --exclude=marimo/_tutorials/"
- github-token: ${{ secrets.GITHUB_TOKEN }}
# For PRs, we only run the tests for the changed files.
# If there is a `test-all` label, we run the tests across unchanged files as well.
diff --git a/.github/workflows/test_fe.yaml b/.github/workflows/test_fe.yaml
index 08410a310d..bc8079a682 100644
--- a/.github/workflows/test_fe.yaml
+++ b/.github/workflows/test_fe.yaml
@@ -11,7 +11,6 @@ concurrency:
permissions:
contents: read
- pull-requests: write
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
@@ -72,29 +71,26 @@ jobs:
exit 1
fi
- - name: Comment on lint failure
+ - name: Summarize lint failure
if: failure() && steps.lint.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "lint"
command: "pnpm turbo lint"
- github-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Comment on clean-tree failure after lint
+ - name: Summarize clean-tree failure after lint
if: failure() && steps.lint_clean_tree.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "clean-tree"
command: "pnpm turbo lint && git status --short"
- github-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Comment on dedupe failure
+ - name: Summarize dedupe failure
if: failure() && steps.dedupe.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "dedupe"
command: "pnpm dedupe"
- github-token: ${{ secrets.GITHUB_TOKEN }}
test_frontend:
needs: changes
@@ -116,6 +112,9 @@ jobs:
- name: 📥 Install repo
uses: ./.github/actions/install
+ - name: 📋 Register tsc problem matcher
+ run: echo "::add-matcher::${{ github.workspace }}/.github/problemMatchers/tsc.json"
+
- name: 🔎 Type check
id: typecheck
run: pnpm turbo typecheck
@@ -135,29 +134,26 @@ jobs:
id: test
run: pnpm turbo test
- - name: Comment on typecheck failure
+ - name: Summarize typecheck failure
if: failure() && steps.typecheck.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "typecheck"
command: "pnpm turbo typecheck"
- github-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Comment on test failure
+ - name: Summarize test failure
if: failure() && steps.test.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "test"
command: "pnpm turbo test"
- github-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Comment on clean-tree failure after typecheck
+ - name: Summarize clean-tree failure after typecheck
if: failure() && steps.typecheck_clean_tree.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "clean-tree"
command: "pnpm turbo typecheck && git status --short"
- github-token: ${{ secrets.GITHUB_TOKEN }}
build_frontend:
needs: changes
@@ -210,10 +206,9 @@ jobs:
pnpm turbo build:islands
./islands/validate.sh
- - name: Comment on build failure
+ - name: Summarize build failure
if: failure() && steps.build.outcome == 'failure'
uses: ./.github/actions/pr-comment-on-failure
with:
check-name: "build"
command: "pnpm turbo build"
- github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts
index ff11641d31..76e243796d 100644
--- a/frontend/vitest.config.ts
+++ b/frontend/vitest.config.ts
@@ -5,6 +5,10 @@ import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
+ reporters:
+ process.env.GITHUB_ACTIONS === "true"
+ ? ["default", "github-actions"]
+ : ["default"],
environment: "jsdom",
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
setupFiles: ["src/__tests__/setup.ts"],