Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a262fec
feat: boot collocated vr project for react-text
Hotell Feb 24, 2025
d9f6df1
feat(visual-regression-utilities): bootstrap package
Hotell Feb 24, 2025
e452f49
feat(react-text-vr): use vr-utilities package and migrate to new SW api
Hotell Feb 24, 2025
9aa178c
feat(react-text-vr): add proper deps and sb config for VR
Hotell Feb 24, 2025
588d5d6
feat(rt-vr): migrate to CSF3
Hotell Feb 24, 2025
d020577
feat(vr-utilities): support only CSF3
Hotell Feb 24, 2025
fbfe89e
feat(rt-vr): store snapshots
Hotell Feb 24, 2025
6b1c456
feat(rt-vr): add playwright VR testing
Hotell Feb 24, 2025
964b3eb
feat(vr-utilities): enforce explicit name definition on CSF3 for vari…
Hotell Feb 24, 2025
f18b107
fix(rt-vr): explitly define name prop for CSF3 variants
Hotell Feb 24, 2025
b4a03f9
chore(rt-vr): delete screenshots before generating
Hotell Feb 24, 2025
59731d9
feat(rt-vr): use only 1 file generated pw test case that stores image…
Hotell Feb 25, 2025
a73dbb3
chore: update gitignore to ignore playwrigt-report
Hotell Feb 25, 2025
c962b9f
docs: add readme and todos
Hotell Feb 25, 2025
61da8f6
chore: bump storywright
Hotell Mar 3, 2025
2d9b6cd
fix(vr-utils): use unified monorepo @swc/helpers version
Hotell Mar 3, 2025
d876b06
feat(workspac-plugin): bootstrap vr executor
Hotell Mar 3, 2025
94f0ae1
feat(workspac-plugin): implement vr executor with storywright and pla…
Hotell Mar 3, 2025
f47e4d6
chore(rt-vr): use new executor to run test-vr
Hotell Mar 3, 2025
265e379
feat(vr-assert): bootstrap package
Hotell Mar 4, 2025
df01bb8
feat(vr-assert): implement cli
Hotell Mar 4, 2025
f4b636d
feat(vr-assert): implement cli 2
Hotell Mar 4, 2025
23abf28
chore(rt-vr): use new cli to run test-vr
Hotell Mar 4, 2025
d89a748
docs(rt-vr): update readme
Hotell Mar 5, 2025
f553a31
chore(rt-vr): tweak storybook setup
Hotell Mar 5, 2025
e5d4057
ci: add vrt
Hotell Mar 5, 2025
acae603
feat(vr-assert): implement reporters
Hotell Mar 5, 2025
aae7ea1
fix(vr-assert): make -u work for diff regressions
Hotell Mar 5, 2025
92ad1aa
chore(rt-vr): fix rm path within nx target
Hotell Mar 5, 2025
d45f740
ci: use feature branch as main for nx shas for testing
Hotell Mar 5, 2025
026fa15
ci: undo - tmp switch to ubuntu runner for vrt poc
Hotell Mar 5, 2025
1a57879
ci: vrt fix summary report and artifact upload
Hotell Mar 5, 2025
b130b3e
ci: fix workflow name for vrt poc comment
Hotell Mar 5, 2025
bff9808
ci:always run vrt poc comment
Hotell Mar 6, 2025
a5d6c4d
ci: run vrt poc comment report based on affected outcome
Hotell Mar 6, 2025
2abad94
fixup! ci: vrt fix summary report and artifact upload
Hotell Mar 6, 2025
0aa3a0e
ci: commit and push updated baseline
Hotell Mar 6, 2025
bdcb9b6
fixup! fixup! ci: vrt fix summary report and artifact upload
Hotell Mar 6, 2025
eae915d
feat(vra): implement commands and report aggregator for ci
Hotell Mar 6, 2025
5b3cbfe
ci: use new report apis for vrt-poc workflow
Hotell Mar 6, 2025
9f9f5f3
fixup! feat(vra): implement commands and report aggregator for ci
Hotell Mar 6, 2025
42b84d8
fixup! ci: use new report apis for vrt-poc workflow
Hotell Mar 6, 2025
b870584
fixup! fixup! feat(vra): implement commands and report aggregator for ci
Hotell Mar 6, 2025
e99fbc4
ci: make sure to upload PR id and add debugging logs for upload repor…
Hotell Mar 6, 2025
b4f5e91
fixup! ci: make sure to upload PR id and add debugging logs for uploa…
Hotell Mar 6, 2025
63b18c8
chore: update ts config base all
Hotell Mar 6, 2025
82d0ae3
fixup! fixup! ci: make sure to upload PR id and add debugging logs fo…
Hotell Mar 6, 2025
6f85a68
fixup! fixup! fixup! ci: make sure to upload PR id and add debugging …
Hotell Mar 6, 2025
c6c36fa
fixup! fixup! fixup! fixup! ci: make sure to upload PR id and add deb…
Hotell Mar 7, 2025
db752ae
feat(vra): add cli reporter
Hotell Mar 7, 2025
175c4c1
chore(rt-vr): build vr assert before target run
Hotell Mar 7, 2025
692bd63
feat(vr-assert): provide better api and output when assertion failed
Hotell Mar 7, 2025
31001b9
ci: fix number reference on comment step for pr-vrt-poc-comment workflow
Hotell Mar 7, 2025
5676c13
ci: use html_url and add workflow_run debug output to pr-vrt-poc-comm…
Hotell Mar 7, 2025
58397ad
feat(vra): render image within report if the change type is add or re…
Hotell Mar 10, 2025
9ee2880
chore(rt-vr): use new vra api
Hotell Mar 10, 2025
9581099
feat(vra): implement new api
Hotell Mar 10, 2025
2f92981
chore: update vrt baseline
Mar 10, 2025
8fb727f
feat(workspace-plugin): add initial inferred target creation for visu…
Hotell Mar 10, 2025
827b27d
chore(rt-vr): tweak targets to used inferred plugin
Hotell Mar 10, 2025
0152eca
ci: add more debug output for vrt baseline update job and remove noop…
Hotell Mar 11, 2025
322e74b
feat(react-tabs-vr): bootsrap vr testing project
Hotell Mar 12, 2025
386074e
feat(react-tabs-vr): migrate vr scenarios from app and convert to csf3
Hotell Mar 12, 2025
f87bde6
fix(vr-utils): undo the required name for storyVariant fn as SB infer…
Hotell Mar 12, 2025
92fec52
fix(react-tabs-vr): use click instead mousdown to properly capture pr…
Hotell Mar 12, 2025
cb213ec
fix(react-tabs-vr): narrow down the VR area to improve diff experienc…
Hotell Mar 12, 2025
c19125b
fix(vra): throw error if no actual images are provided and dont copy …
Hotell Mar 12, 2025
75d3d16
chore: update vrt baseline
Mar 12, 2025
aa575d3
ci: dont bail pr-vrt-poc PR job so the report is complete
Hotell Mar 12, 2025
5401ddd
fix(react-tabs-vr): provide missing name property for scenarios
Hotell Mar 12, 2025
36a92d5
fix(vr-utils): undo removal of required name prop for storyVariant fn
Hotell Mar 12, 2025
c2f198b
chore: update vrt baseline
Mar 12, 2025
d1977f4
feat(vra): coolocate reports to changed and unchagned to reduce outpu…
Hotell Mar 12, 2025
bc417ad
test(rt-vr): add new test
Hotell Mar 5, 2025
457e90f
test(tabs-vr): add new test
Hotell Mar 12, 2025
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ packages/react-components/react-tabs/library @microsoft/cxe-prg @dmytrokirpa
packages/react-components/react-tabs/stories @microsoft/cxe-prg @dmytrokirpa
packages/react-components/react-text/library @microsoft/cxe-prg @marcosmoura
packages/react-components/react-text/stories @microsoft/cxe-prg @marcosmoura
packages/react-components/react-text/visual-regression @microsoft/cxe-prg @marcosmoura
packages/react-components/react-textarea/library @microsoft/cxe-prg
packages/react-components/react-textarea/stories @microsoft/cxe-prg
packages/react-components/react-tooltip/library @microsoft/cxe-prg
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/pr-vrt-poc-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: VRT POC | Comment on PR
on:
workflow_run:
workflows: ['VRT POC']
types:
- completed

concurrency:
# see https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NX_PARALLEL: 4 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM
NX_PREFER_TS_NODE: true
NX_VERBOSE_LOGGING: true

jobs:
run_vr_diff:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' }} && ${{ github.event.workflow_run.event == 'pull_request' }}
outputs:
pr_number: ${{ steps.pr_number.outputs.result }}
permissions:
# necessary to write comments to the PR from the vr-approval-cli
pull-requests: write
# id-token: write
steps:
# - uses: actions/checkout@v4
# with:
# sparse-checkout: |
# .github

# - uses: actions/download-artifact@v4
# with:
# name: vrt_report
# path: ./vrt_report
# run-id: ${{ github.event.workflow_run.id }}
# github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Debug
run: |
echo $W_RUN
env:
W_RUN: ${{ toJSON(github.event.workflow_run) }}

- uses: actions/download-artifact@v4
with:
name: pr-number
path: ./results
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Load PR number
id: pr_number
run: echo "id=$(cat pr.txt)" >> $GITHUB_OUTPUT
working-directory: ./results

- name: 'Comment on PR'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: vr-report-comment
number: ${{ steps.pr_number.outputs.id }}
message: |
VR Regression Report:
- status: ${{ github.event.workflow_run.conclusion }}
- check whole [report](${{github.event.workflow_run.html_url}}) to review visual differences
165 changes: 165 additions & 0 deletions .github/workflows/pr-vrt-poc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: VRT POC
on:
push:
branches:
- hotell/fhl-spring-25
pull_request:
# TODO: once testing is done enable pull_request on all branches again
branches:
- hotell/fhl-spring-25
issue_comment:
types: [created]

concurrency:
# see https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NX_PARALLEL: 6 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM
NX_PREFER_TS_NODE: true
NX_VERBOSE_LOGGING: true

jobs:
# TODO: it's not possible to update another JOB result to "success" in order to make PR mergeable
#
approve_vrt_diff:
if: github.event.issue.pull_request && contains(github.event.comment.body,'/approve-snapshots')
runs-on: ubuntu-latest
# permissions:
# statuses: write
steps:
- run: echo "Hello"
# - name: Approve VRT Diff
# uses: actions/github-script@v7
# with:
# script: |
# const run = require('./.github/scripts/approve-pr-vrt-diff');
# const config = { prId: context.payload.issue.number };
# await run({github,context,core,config});

vrt_baseline:
if: ${{ github.repository_owner == 'microsoft' && github.event_name == 'push' && github.event_name!='pull_request' }}
# NOTE: there is an issue on GH atm obtaining large runner - undo this change once resolved
# runs-on: macos-14-xlarge
runs-on: ubuntu-latest
permissions:
contents: 'write'
actions: 'write'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'hotell/fhl-spring-25'

- uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version: '20'

- run: yarn install --frozen-lockfile
- run: yarn playwright install --with-deps
- run: yarn nx run visual-regression-assert:build

- name: Update VR tests baseline
run: yarn nx affected -t test-vr-cli -u --nxBail

- name: Affected Projects
id: affected_projects_count
run: |
yarn --silent nx show projects -t test-vr-cli --affected --verbose false
affected_count=$(yarn --silent nx show projects -t test-vr-cli --affected --verbose false | wc -l | tr -d ' ')
echo "value=$affected_count" >> $GITHUB_OUTPUT

- name: Affected Projects Count
run: echo ${{steps.affected_projects_count.outputs.value}}

- name: Update Baseline
if: steps.affected_projects_count.outputs.value > 0
run: |
git config user.name "Fluent UI Build"
git config user.email "fluentui-internal@service.microsoft.com"
git add *.png
if [[ -n $(git status --porcelain) ]]; then
git commit -m "chore: update vrt baseline"
git push origin HEAD:${{ github.ref_name }}
else
echo "No PNG changes to commit."
fi

- name: Report Updated Baseline
if: steps.affected_projects_count.outputs.value > 0
run: |
yarn visual-regression-assert report --outputPath dist/vrt
cat dist/vrt/vrt-report.md >> $GITHUB_STEP_SUMMARY

vrt_pr:
if: ${{ github.repository_owner == 'microsoft' && github.event_name == 'pull_request' }}
# NOTE: there is an issue on GH atm obtaining large runner - undo this change once resolved
# runs-on: macos-14-xlarge
runs-on: ubuntu-latest
permissions:
contents: 'read'
actions: 'read'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: 'hotell/fhl-spring-25'

- uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version: '20'

- run: yarn install --frozen-lockfile
- run: yarn playwright install --with-deps
- run: yarn nx run visual-regression-assert:build

- name: Run VR tests
run: yarn nx affected -t test-vr-cli

- name: Report
if: always()
id: report
run: |
yarn visual-regression-assert report --outputPath dist/vrt
cat dist/vrt/vrt-report.md >> $GITHUB_STEP_SUMMARY
echo "value=true" >> $GITHUB_OUTPUT

- name: Upload Report
if: ${{ always() && steps.report.outputs.value == 'true' }}
uses: actions/upload-artifact@v4
with:
name: vrt_report
retention-days: 1
if-no-files-found: error
path: |
dist/vrt/

- name: Save PR number
if: always()
run: echo ${{ github.event.number }} > pr.txt
- uses: actions/upload-artifact@v4
if: always()
with:
name: pr-number
retention-days: 1
if-no-files-found: error
path: |
pr.txt

# - name: Upload VR screenshots
# uses: actions/upload-artifact@v4
# with:
# name: vrscreenshot
# retention-days: 1
# path: ${{steps.screenshots_root.outputs.result}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ $RECYCLE.BIN/

# Generated files
*.scss.ts
playwright-report

# Files that might appear on external disk
.Spotlight-V100
Expand Down
Loading
Loading