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
50 changes: 0 additions & 50 deletions .github/actions/percy-exec/action.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/nitpix-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: nitpix approve

# Handles `/nitpix approve` comments on PRs: records the approved snapshot
# hashes on the nitpix-baselines branch and flips the `nitpix/visual` commit
# status to success — without re-running the test matrix. Only users with
# write access can approve.

on:
issue_comment:
types: [created]

permissions:
contents: write
pull-requests: write
statuses: write

jobs:
approve:
name: Approve visual changes
runs-on: ubuntu-latest
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/nitpix')
steps:
- uses: plotly/nitpix/approve@ab5cf6a797cd5d5d12821b1339cf429f7063edc3 # 2026-07-08, TODO: move to @v1 once released

Check warning on line 23 in .github/workflows/nitpix-approve.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=plotly_dash&issues=AaE2R3m4Ox06fwpoH6Sk&open=AaE2R3m4Ox06fwpoH6Sk&pullRequest=3873
with:
baseline-branch: nitpix-baselines
44 changes: 44 additions & 0 deletions .github/workflows/nitpix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: nitpix

# Visual diffing (replaces Percy). Runs in the base-repo context via
# workflow_run so it has a full-privilege token even for fork and Dependabot
# PRs (which get a read-only token in "Dash Testing" itself).
#
# - PR-triggered test runs: diff the uploaded nitpix-snapshots-* artifacts
# against baselines/<base-branch>/ on the nitpix-baselines orphan branch,
# post/update the review comment and the `nitpix/visual` commit status.
# Approve visual changes by commenting `/nitpix approve` on the PR
# (see nitpix-approve.yml).
# - push-triggered test runs (dev/master): promote that run's snapshots to
# the branch's baselines.
#
# SECURITY: never check out or execute PR code in this workflow — it runs
# with write permissions for all PRs. nitpix only handles PNG artifacts.

on:
workflow_run:
workflows: ["Dash Testing"]
types: [completed]

permissions:
actions: read # download the nitpix-snapshots-* artifacts from the test run
contents: write # push to the nitpix-baselines branch
pull-requests: write # the review comment
statuses: write # the nitpix/visual check

concurrency:
group: nitpix-${{ github.event.workflow_run.head_sha }}
cancel-in-progress: true

jobs:
visual-review:
name: Visual Review
runs-on: ubuntu-latest
if: |
github.event.workflow_run.conclusion == 'success' &&
(github.event.workflow_run.event == 'pull_request' ||
github.event.workflow_run.event == 'push')
steps:
- uses: plotly/nitpix@ab5cf6a797cd5d5d12821b1339cf429f7063edc3 # 2026-07-08, TODO: move to @v1 once released

Check warning on line 42 in .github/workflows/nitpix.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=plotly_dash&issues=AaE33pfBxyjeyssfDOmZ&open=AaE33pfBxyjeyssfDOmZ&pullRequest=3873
with:
baseline-branch: nitpix-baselines
40 changes: 3 additions & 37 deletions .github/workflows/post-test-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,43 +65,9 @@ jobs:
}
}

- name: Post Percy status for fork/Dependabot PRs
# Percy needs PERCY_TOKEN to run, which is unavailable to fork PRs (and to
# Dependabot unless added to Dependabot secrets). Without a build, the
# Percy GitHub App never posts the required `percy/dash` status and the PR
# is blocked. Post a success status here so the check resolves — but only
# if Percy hasn't already posted one, so a real Percy result is never
# clobbered (e.g. when Dependabot does have the token).
if: >
github.event.workflow_run.head_repository.full_name != github.repository ||
github.event.workflow_run.actor.login == 'dependabot[bot]'
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
const sha = context.payload.workflow_run.head_sha;
const statusContext = 'percy/dash';

const { data: { statuses } } = await github.rest.repos.getCombinedStatus({
owner,
repo,
ref: sha,
});

if (statuses.some(s => s.context === statusContext)) {
console.log(`'${statusContext}' already posted — leaving it untouched.`);
return;
}

await github.rest.repos.createCommitStatus({
owner,
repo,
sha,
state: 'success',
context: statusContext,
description: 'Skipped — Percy unavailable for fork/Dependabot PRs',
});
console.log(`Posted skipped status for ${statusContext}`);
# NOTE: the "Post Percy status for fork/Dependabot PRs" workaround that
# lived here was removed with the move to nitpix (nitpix.yml), which
# handles fork/Dependabot PRs natively via workflow_run.

test-report:
name: Consolidated Test Report (Fork PR)
Expand Down
Loading
Loading