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

feat(e2e): generate branch with the updated e2e screenshots #2915

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matthieu-crouzet
Copy link
Contributor

Proposed change

On PR event, create branch with updated screenshots if any and comment the PR to let the contributor know.

Related issues

🚀 Feature resolves #2701

@matthieu-crouzet matthieu-crouzet requested a review from a team as a code owner February 28, 2025 09:14
Copy link

nx-cloud bot commented Feb 28, 2025

View your CI Pipeline Execution ↗ for commit e5f7d4c.

Command Status Duration Result
nx run-many --target=test-int ✅ Succeeded 17m 28s View ↗
nx run-many --target=test-e2e ✅ Succeeded 9m 34s View ↗
nx run-many --target=build --projects=eslint-pl... ✅ Succeeded <1s View ↗
nx run-many --target=publish --nx-bail --userco... ✅ Succeeded 29s View ↗
nx run-many --target=prepare-publish --exclude-... ✅ Succeeded 1m 17s View ↗
nx run-many --target=build,build-swagger ✅ Succeeded 4m 45s View ↗
nx affected --target=test --collectCoverage ✅ Succeeded 19s View ↗
nx affected --target=lint ✅ Succeeded 2m 48s View ↗
Additional runs (3) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-02-28 18:00:38 UTC

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.95%. Comparing base (a902bec) to head (e5f7d4c).
Report is 10 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

id: vars
env:
# run_id and run_attempt are needed to avoid conflict in the branch name
BRANCH_NAME: ${{ github.head_ref }}${{ inputs.branchSuffix }}-${{ github.run_id }}-${{ github.run_attempt }}
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we update the previous branch when re-running a workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The action (stefanzweifel/git-auto-commit-action) does not support that from what I understood.
because we ask to create the branch so if the branch already exists it will failed

Copy link
Contributor

Choose a reason for hiding this comment

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

but what if we don't want to create billions of branches though?

commit_message: "fix: update e2e screenshots"
branch: ${{ steps.vars.outputs.BRANCH_NAME }}
file_pattern: ${{ inputs.screenshotsPattern }}
create_branch: true
Copy link
Contributor

Choose a reason for hiding this comment

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

we may want to also create a workflow to automatically delete the e2e-branches when the original branch has been deleted / merged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could be done in second time I think, you can open an issue to track that proposal

Copy link
Contributor

@fpaul-1A fpaul-1A Feb 28, 2025

Choose a reason for hiding this comment

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

I think it's better to that in place before we start creating branches, the workflow should not be that hard to write

@matthieu-crouzet matthieu-crouzet force-pushed the feat/generate-branch-e2e-screenshots branch from dddbca5 to 33115a0 Compare February 28, 2025 09:45
if: steps.update-e2e-screenshots.outputs.screenshots != '0'
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5.1.0
with:
commit_message: "fix: update e2e screenshots"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
commit_message: "fix: update e2e screenshots"
commit_message: "test: update e2e screenshots"

or chore since it's not actually a code fix.

Also, can you add something to the commit not to have the same message everytime (like the input branch)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a temporary commit
you have to cherry-pick it in your PR and squash it with your original commit

Copy link
Member

Choose a reason for hiding this comment

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

but you are not forced to squash it :-s

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 are used to accept PR with only 1 commit

@matthieu-crouzet matthieu-crouzet force-pushed the feat/generate-branch-e2e-screenshots branch from 33115a0 to e5f7d4c Compare February 28, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment