netlify-plugin-cypress icon indicating copy to clipboard operation
netlify-plugin-cypress copied to clipboard

Not possible for external fork contributors to pass CI tests

Open MikeMcC399 opened this issue 2 years ago • 2 comments

This repository is not set up to allow external contributions.

It was already the case two years ago (https://github.com/cypress-io/netlify-plugin-cypress/pull/151#issuecomment-799353121).

The netlify site ID is not available in a fork. See for example https://app.circleci.com/pipelines/github/cypress-io/netlify-plugin-cypress/1299/workflows/f447020d-6112-4f8a-86f6-85f372bb35e1/jobs/13008

"Preparing environment variables" does not include the following section for a fork run

Using environment variables from project settings and/or contexts:
  CACHE_VERSION=**REDACTED**
  CYPRESS_RECORD_KEY=**REDACTED**
  GH_TOKEN=**REDACTED**
  NETLIFY_AUTH_TOKEN=**REDACTED**
  NETLIFY_SITE_ID=**REDACTED**
  NPM_TOKEN=**REDACTED**

leading to

#!/bin/bash -eo pipefail
npx netlify build
 ›   Warning: Error: Could not find the site ID. Please run netlify link.
 ›       at error (file:///home/circleci/project/node_modules/netlify-cli/src/utils/command-helpers.mjs:182:52)
 ›       at checkOptions (file:///home/circleci/project/node_modules/netlify-cli/src/commands/build/build.mjs:14:5)
 ›       at BaseCommand.build (file:///home/circleci/project/node_modules/netlify-cli/src/commands/build/build.mjs:71:5)
 ›       at processTicksAndRejections (node:internal/process/task_queues:96:5)
 ›       at async BaseCommand.parseAsync (/home/circleci/project/node_modules/netlify-cli/node_modules/commander/lib/command.js:935:5)
 ›       at async file:///home/circleci/project/node_modules/netlify-cli/bin/run.mjs:26:3

Exited with code exit status 1
CircleCI received exit code 1

According to https://answers.netlify.com/t/is-a-netlify-site-id-private/15238 the Site ID is not private, however other permissions may be missing.

Please update https://github.com/cypress-io/netlify-plugin-cypress/blob/master/CONTRIBUTING.md and add instructions for external contributors working in a fork.

Possibilities

  • Not possible to contribute from a fork by an external contributor?

  • Possible to contribute but needs collaboration from a Cypress.io sponsor?

  • Here is the Netlify site ID and the instructions about how to use it?

MikeMcC399 avatar May 11 '23 10:05 MikeMcC399

This is probably low priority, since it seems that there is no simple solution to updating the repo.

The instructions in https://github.com/cypress-io/netlify-plugin-cypress/blob/master/CONTRIBUTING.md in any case fail at the step

  • from every subfolder of tests execute npm run build

Only some of the subfolders of tests/ have a package.json defined, so this instruction can not be carried out for all subfolders.

MikeMcC399 avatar May 11 '23 15:05 MikeMcC399

Thanks for reporting this. It's definitely less than ideal that CI can't properly run for contributor PRs. We'll have to consider the priority of this and our capacity to look into fixing it.

chrisbreiding avatar May 12 '23 14:05 chrisbreiding