Skip to content
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

Link to artifact URL from PR when visual diffing fails #1547

Closed
wants to merge 2 commits into from
Closed
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: 1 addition & 1 deletion .github/workflows/approve-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
CYPRESS_TAKE_SNAPSHOTS: true

- name: Upload debug screenshots and diffs on failure 🖼️
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,32 @@ jobs:
CYPRESS_TAKE_SNAPSHOTS: true

- name: Upload debug screenshots and diffs on failure 🖼️
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
id: uploadSnapshots
with:
name: cypress
path: |
cypress/debug/
cypress/snapshots/**/__diff_output__/

outputs:
snapshotsUrl: ${{ steps.uploadSnapshots.outputs.artifact-url }}

report:
runs-on: ubuntu-latest
needs: e2e
if: github.event_name == 'pull_request' && needs.e2e.outputs.snapshotsUrl
steps:
- name: Provide download link in PR
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: github.event.pull_request.number
body: |
#### :flags: Visual changes detected!

Please [download and review the snapshot diffs](${{ needs.e2e.outputs.snapshotsUrl }}). If the changes are expected:

1. Comment with `/approve`.
1. Wait for the CI workflow _Approve snapshots_ to open a PR called _Update Cypress reference snapshots_.
1. Review and merge the updated snapshots into this PR, ideally with a rebase.
2 changes: 1 addition & 1 deletion packages/app/src/providers/mock/mock-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function makeMockFile(): GroupWithChildren {
nxData('nx_data', {
signal: array('twoD'),
silxStyle: { signalScaleType: ScaleType.SymLog },
title: scalar('title', 'NeXus 2D'),
title: scalar('title', 'NEXUS 2D'),
}),
nxGroup('absolute_default_path', 'NXentry', {
defaultPath: '/nexus_entry/nx_process/nx_data',
Expand Down