thoughtworks / build-your-own-radar

A library that generates an interactive radar, inspired by https://thoughtworks.com/radar/.
GNU Affero General Public License v3.0
2.21k stars 1.04k forks source link

Build failing on local for master #348

Closed davidbuchanan closed 1 year ago

davidbuchanan commented 1 year ago

I am having an issue when trying to build locally, prior to creating a PR.

Running off master and specifying e2e run command as

./run_e2e_tests.sh http://localhost:8080

FYI - docs state request a trailing '/', this also did not work for me.)

I receive a 403 error (Please see attached Cypress report output),

evidence-of-403-on-google-api-calls.zip

this appears to be when contacting the following URL during test run Google API call

I hope this is not due to my host platform being Linux. Please accept my apologies for wasting your time if that is the case.

I am simply trying to increase the Cypress version fro 13.1 to 13.2 to remove a [critical vulnerability preventing me from bringing this product into my workplace - CVE-2020-36632

Please let me know if you need anymore info.

devansh-sharma-tw commented 1 year ago

Hi @davidbuchanan , the Google Sheet tests in Cypress require the CLIENT_ID and API_KEY to be set, as trying to get data from a Google Sheet requires a manual Google login, which we cannot do with Cypress. The alternative is to set these variables which provide Cypress with an authenticated session for a public sheet (details here).

Could you confirm if you have these variables exported in the session you are running the tests ? If you do, could you please check if the Authorized JavaScript origins is set with http://localhost:8080 in GCP console ?

FYI - docs state request a trailing '/', this also did not work for me.)

Yeah, the / is not required, I'll update the README for it.

Thanks!

davidbuchanan commented 1 year ago

I confirm I did NOT! My bad RTFM totally on me.

I have tried to do as suggested but now hit an issue with GCP.

  1. Google Developer Console
  2. CLICK: 'Configure a project'
  3. SELECT: [my-test-project]
  4. SELECT: 'Web Browser' from 'Configure your OAuth Client'
  5. INPUT for 'Authorized Javascript Origin': 'http://localhost:8080'
  6. CLICK 'CREATE' Form renders validation error 'schema must be https'. This is in conflict with the google direction on the previous page which states 'When you configure the project, select the Web browser client type and specify the origin URI of your app. When you perform tests, both http://localhost and http://localhost: must be added to the Authorized JavaScript origins field.'

That said the form field description states https.

Again apologies if I am being dumb here. google-api-for-sheets_https-only

devansh-sharma-tw commented 1 year ago

Hi, no worries! I think what you might have landed on is very specific to Google Sign In related IDs.

Could you try creating a project directly on GCP console and create keys there ? Once on the console, you should be able to create the Client ID and API Key from APIs & Services section.

Thanks!

davidbuchanan commented 1 year ago

Yeah that worked! Thank you for your patience.

PR