-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Do not fail test run if recording without record key for pull requests from forked repos #1193
Comments
Examples of pull requests that fail because of |
Ok, version |
* server: do not fail if missing record key from fork PR, close #1193 * remove .only * fix white space * add e2e tests around forked PR's warning but running without recording
Released in |
Forks are failing because they do not have access to secrets. Cypress fixed this if `--key` is not used, but an environment variable is instead used: cypress-io/cypress#1193 Hopefully this fixes the issue. If not, we'll have to either use the Cypress key in plain text or disable recordings altogether.
* ci: Fix fork failures Forks are failing because they do not have access to secrets. Cypress fixed this if `--key` is not used, but an environment variable is instead used: cypress-io/cypress#1193 Hopefully this fixes the issue. If not, we'll have to either use the Cypress key in plain text or disable recordings altogether.
It seems fork detection is on a per-CI-provider-basis. We're using Github Actions which still fails since it is not detected. Should the If that seems reasonable, I can create a proposal. |
@NicholasBoll we kind of have this situation in several places - and we always been able to get around it using shell scripting, something like: if env variable |
@NicholasBoll maybe I can add GitHub Actions detection support to bahmutov/is-fork-pr#113 - then it will propagate into the Test Runner and do what you want? |
For now I'm just pretending to be Travis by setting Travis variables. You're right that the utility of Cypress is decreased without using the Dashboard. CI providers are trying to mature. CircleCI seems to be the most mature in terms of security and features. Cypress uses CircleCI and allows the Cypress key to be used in forks. It is still possible to revoke access to that key unless you use their new security contexts and involve a manual step to trust forks. Github Actions is not that mature yet. I have an open suggestion: https://github.jparrowsec.cnmunity/t5/GitHub-Actions/Make-secrets-available-to-builds-of-forks/m-p/33876/highlight/true#M1691 For now, I guess we'll just allow the key to be discoverable to those who really want to find it... If it becomes a problem, we'll revoke that key and make a new one. Hopefully soon enough, Github Actions will be mature enough to allow secret sharing with trusted actions. |
@NicholasBoll sure, but CircleCI has to explicitly allow environment variables to be passed to forked PRs so it is a security risk. Also, the security contexts are actually a weird thing on CircleCI, see our problem in #5312 - they stop entire job from running; there is no "run the job without context for external users" option. I like your hack of mimicking Travis CI to detect forked PR. I have opened bahmutov/is-fork-pr#114 to allow you to do this simpler. Also, on a personal note, I don't find typical CIs to improve much, except for CircleCI Orbs. Only other systems like GitHub Actions, AWS Amplify that build on top of CIs seem to be innovative. |
* ci: Fix fork failures Forks are failing because they do not have access to secrets. Cypress fixed this if `--key` is not used, but an environment variable is instead used: cypress-io/cypress#1193 Hopefully this fixes the issue. If not, we'll have to either use the Cypress key in plain text or disable recordings altogether.
improvement
We currently stop tests if the user wants to record the test run but has not passed record key. This becomes a problem when someone submits a pull request from a forked repository. Example in https://travis-ci.org/bahmutov/cypress-react-unit-test/builds/328887786
This is a very common case for public repos - and every pull request will have tests fail without even running.
Proposal
Maybe a better solution would be for the test runner to
--record
flag without record key.The text was updated successfully, but these errors were encountered: