Skip to content

ci: deploy vrts on main branch correctly #5569

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

TarunAdobe
Copy link
Contributor

@TarunAdobe TarunAdobe commented Jun 25, 2025

Description

Updated CircleCI configuration to ensure Visual Regression Test (VRT) results are properly deployed to Azure blob storage when running on the main branch, not just on pull requests.

Motivation and context

Previously, VRT results were only being deployed for pull requests, but main branch VRT runs were not being deployed to the preview site. This made it difficult to access and review VRT results from main branch builds, which are important for baseline comparisons and debugging.

Related issue(s)

  • Internal CI/CD improvement for VRT workflow

Screenshots (if appropriate)

N/A


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • VRT deployment should work on main branch

    1. Pushed a test commit to this branch to send vrts to /main path if the branch name matches. check this.
    2. vrts are then deployed against /main path suggesting checking for branch name worked. verify the output of this job.
    3. Verify VRT results are deployed to https://swcpreviews.z13.web.core.windows.net/main/express-dark-large-rtl/review/

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

@TarunAdobe TarunAdobe requested a review from a team as a code owner June 25, 2025 15:28
Copy link

changeset-bot bot commented Jun 25, 2025

⚠️ No Changeset found

Latest commit: be038e7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

github-actions bot commented Jun 25, 2025

📚 Branch Preview

🔍 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5569

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link

Tachometer results

Currently, no packages are changed by this PR...

@Rajdeepc
Copy link
Contributor

@TarunAdobe How can i verify this? can you create a section on what was the issue and what is the fix for the context?

@TarunAdobe
Copy link
Contributor Author

@TarunAdobe How can i verify this? can you create a section on what was the issue and what is the fix for the context?

Yusss!! will do

# Get PR number from CircleCI environment
PR_NUMBER=""
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
PR_NUMBER=$(echo $CIRCLE_PULL_REQUEST | sed 's/.*\/pull\///')
Copy link
Contributor

@Rajdeepc Rajdeepc Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PR_NUMBER=$(echo $CIRCLE_PULL_REQUEST | sed 's/.*\/pull\///')
PR_NUMBER=$(echo "$CIRCLE_PULL_REQUEST" | sed 's/.*\/pull\///')

Unquoted variables can break if they contain spaces or special characters

elif [ -n "$CIRCLE_PR_NUMBER" ]; then
PR_NUMBER="$CIRCLE_PR_NUMBER"
echo "Deploying VRT for PR #$PR_NUMBER"
elif [[ "$CIRCLE_BRANCH" =~ ^pull/[0-9]+$ ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line assumes a format that may not always hold. CIRCLE_BRANCH for forked PRs is typically the branch name of the fork, not pull/xxx. You can consider removing if this condition even triggers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont run circleci on forks so idt we need to worry abt this

elif [ -n "$CIRCLE_PR_NUMBER" ]; then
PR_NUMBER="$CIRCLE_PR_NUMBER"
echo "Deploying HCM VRT for PR #$PR_NUMBER"
elif [[ "$CIRCLE_BRANCH" =~ ^pull/[0-9]+$ ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont run circleci on forks so idt we need to worry abt this

# GitHub API fallback
PR_NUMBER=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls?head=$CIRCLE_PROJECT_USERNAME:$CIRCLE_BRANCH&state=open" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub allows multiple PRs from different forks to use the same branch name.This can cause the query to match a different PR from a different user, leading to incorrect PR numbers being picked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't run circleci on forked branches

@TarunAdobe
Copy link
Contributor Author

@TarunAdobe How can i verify this? can you create a section on what was the issue and what is the fix for the context?

Added a test commit to verify that checking for branch name works.
Read the testing description now and it should work

@TarunAdobe TarunAdobe requested a review from Rajdeepc June 27, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants