Skip to content

Add GitHub workflow to detect apps affected by code changes [skip percy] #1458

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

CharlyMartin
Copy link
Collaborator

@CharlyMartin CharlyMartin commented May 21, 2025

📝 Description

This pull request adds a GitHub action apps-detect-changes.yml to determine whether an app is affected by code changes in a each PR. The output is then used by apps-cypress-percy-test.yml To only run the tests in the apps with code changes.

This PR also fixes the deps of the UXIT app as it was preventing the action from running properly.

🧪 How to Test

  1. Make a change in one or several apps
  2. Commit and push it to this PR
  3. Make sure that apps-detect-changes.yml picks up changes only in the relevant apps
  4. Revert the changes

(Tests previously made on a separate PR #1456)

🔖 Resources

Copy link

vercel bot commented May 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ffdweb-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2025 8:08am
filecoin-foundation-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2025 8:08am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
filecoin-foundation-uxit ⬜️ Skipped (Inspect) May 22, 2025 8:08am

Copy link

@CharlyMartin CharlyMartin changed the title UXIT-2691/optimize-cypress-clean Add GitHub workflow to detect apps affected by code changes May 21, 2025
@CharlyMartin CharlyMartin marked this pull request as ready for review May 21, 2025 15:22
@CharlyMartin CharlyMartin requested a review from mirhamasala May 21, 2025 15:22
@CharlyMartin CharlyMartin changed the title Add GitHub workflow to detect apps affected by code changes Add GitHub workflow to detect apps affected by code changes [skip percy] May 21, 2025
@@ -68,8 +73,10 @@ jobs:

- name: Run Cypress Tests without Percy
if: steps.test-type.outputs.skip_percy == 'true'
run: npm run test:cypress
run: npm run test:cypress || echo "Script missing, skipping this step..."
continue-on-error: true
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This morning I woke up and the first thing I thought was... Will this also cause the tests to fail silently if Cypress throws an error?? To be tested 😄

@CharlyMartin
Copy link
Collaborator Author

Important

On a broader note, I realized that this implementation only tracks changes in the apps folder, which is not enough in a monorepo environment. Changes in the packages folder also affect some or all the apps. Git alone won’t help here—we may need to use Turbo’s dependency graph to track that properly. Have a quick look at it now 👀

@CharlyMartin CharlyMartin removed the request for review from mirhamasala May 22, 2025 08:18
@CharlyMartin
Copy link
Collaborator Author

if [[ "${{ github.event_name }}" == "pull_request" ]]; then
  # For PRs, compare against the base branch
  TURBO_OUTPUT=$(npx turbo run build --filter=...[origin/${{ github.base_ref }}] --dry=json)
else
  # For pushes, compare against the previous commit
  TURBO_OUTPUT=$(npx turbo run build --filter=...[HEAD^] --dry=json)
fi

@CharlyMartin
Copy link
Collaborator Author

CharlyMartin commented May 22, 2025

We should rename the folder to the same name as package.json.

So we can add a npx turbo-ignore step to the Cypress test action

https://turborepo.com/docs/guides/skipping-tasks

@mirhamasala mirhamasala marked this pull request as draft May 22, 2025 19:31
@mirhamasala
Copy link
Collaborator

@CharlyMartin ~ I moved this to draft until we figured it out. 🙏🏼

@CharlyMartin
Copy link
Collaborator Author

@mirhamasala I'm hoping that something as simple as that will work: #1465

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