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

fix: updating branch name fallbacks for GitHub Actions recordings #27409

Merged
merged 5 commits into from
Jul 27, 2023

Conversation

tbiethman
Copy link
Contributor

@tbiethman tbiethman commented Jul 27, 2023

Additional details

Note from the above issue:

We have also had some discussion related to normalizing the environment's raw git data and environment variables within the recording service directly, essentially offloading the offending logic here into the cloud. This would give Cypress a better avenue to respond to changes in the various CI environments in the future without requiring a specific app release. A spike has been logged internally to investigate that option and any potential tradeoffs. The proposal described above seems like a quick enough win to get the correct data recorded in the meantime.

Steps to test

Unit tests have been updated to validate the expected environment mappings. It will be difficult to test this end-to-end without some mocking, but given the changes made, I feel like the unit tests provide good coverage.

How has the user experience changed?

If a user:

  • Is recording cypress runs as part of a GitHubAction workflow, and
  • Is not specifying a branch name with the COMMIT_INFO_BRANCH env, and
  • Is not using the cypress/github-action (and thus not setting the GH_BRANCH env)

Then the Cypress recorded cypress runs will be attributed to a branch's short name (tbiethman/fix/gha-branch) rather than a PR's ref name (refs/pulls/merge/27409) or a commit's ref name (refs/heads/tbiethman/fix/gha-branch).

PR Tasks

'GITHUB_BASE_REF',
'GITHUB_HEAD_REF',
'GITHUB_REF_NAME',
'GITHUB_REF',
Copy link
Contributor Author

@tbiethman tbiethman Jul 27, 2023

Choose a reason for hiding this comment

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

While I was in here, I added the GHA variables we use for commit fallbacks (+ GITHUB_REF for completeness) to the ci_params mapping. These additions aren't necessary to correct the current fallback values, but they may be useful in the future for further inspection of the recordings.

@tbiethman tbiethman marked this pull request as ready for review July 27, 2023 17:37
@cypress
Copy link

cypress bot commented Jul 27, 2023

6 flaky tests on run #49256 ↗︎

0 5266 137 0 Flakiness 6

Details:

Updating telemetry too
Project: cypress Commit: 3114c3e0ff
Status: Passed Duration: 12:35 💡
Started: Jul 27, 2023 7:04 PM Ended: Jul 27, 2023 7:16 PM
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse Output
Flakiness  e2e/origin/commands/navigation.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test Artifacts
cy.origin navigation > #consoleProps > .go() Output
Flakiness  e2e/origin/basic_login.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test Artifacts
Multi-step Auth > final-auth redirects back to localhost - flat Output
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-firefox

View Output Video

Test Artifacts
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@tbiethman tbiethman merged commit d0fbd29 into develop Jul 27, 2023
8 checks passed
@tbiethman tbiethman deleted the tbiethman/fix/gha-branch branch July 27, 2023 19:37
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 1, 2023

Released in 12.17.3.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v12.17.3, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Aug 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected branch values are used for recordings produced by GitHub Actions
3 participants