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

about CYPRESS_DOWNLOAD_MIRROR and CYPRESS_DOWNLOAD_PATH_TEMPLATE #22864

Closed
cnmission opened this issue Jul 20, 2022 · 4 comments
Closed

about CYPRESS_DOWNLOAD_MIRROR and CYPRESS_DOWNLOAD_PATH_TEMPLATE #22864

cnmission opened this issue Jul 20, 2022 · 4 comments
Labels
type: enhancement Requested enhancement of existing feature

Comments

@cnmission
Copy link

What would you like?

when i set config
CYPRESS_DOWNLOAD_MIRROR https://cdn.npmmirror.com/binaries/cypress/
CYPRESS_DOWNLOAD_PATH_TEMPLATE ${endpoint}/${platform}-${arch}/cypress.zip

I got this:
https://cdn.npmmirror.com/binaries/cypress/desktop/10.3.0/linux-x64/cypress.zip
this url return 404 not found. (correct url without the word desktop like this: https://cdn.npmmirror.com/binaries/cypress/10.3.0/linux-x64/cypress.zip)

Why is this needed?

the word desktop in the download url is more like a magic word.

without the word desktop , we can better set the download address through variables

remove desktop from version desktop/10.3.0
then we can set defaultBaseUrl="https://download.cypress.io/desktop" forward compatibility
https://download.cypress.io/desktop/10.3.0?platform=win32&arch=x64

Other

No response

@mjhenkes
Copy link
Member

We need the endpoint to equal "desktop/10.3.0" for our own download filesystem, (I'm not sure why desktop is in there). But I think it would be possible to add passively a version option to the template so that you could do

CYPRESS_DOWNLOAD_MIRROR https://cdn.npmmirror.com/binaries/cypress/ CYPRESS_DOWNLOAD_PATH_TEMPLATE ${version}/${platform}-${arch}/cypress.zip

to get this:
https://cdn.npmmirror.com/binaries/cypress/10.3.0/linux-x64/cypress.zip

A contribution would probably be the fastest way to get this change.

@mjhenkes mjhenkes added type: enhancement Requested enhancement of existing feature E2E-core labels Jul 21, 2022
@cypress-bot cypress-bot bot added stage: routed to e2e-core and removed stage: investigating Someone from Cypress is looking into this labels Jul 21, 2022
@mjhenkes mjhenkes removed their assignment Jul 21, 2022
@abcfy2
Copy link
Contributor

abcfy2 commented Jul 22, 2022

No. ${version} was not replaced.

❯ CYPRESS_DOWNLOAD_MIRROR=https://cdn.npmmirror.com/binaries/cypress/ CYPRESS_DOWNLOAD_PATH_TEMPLATE='${version}/${platform}-${arch}/cypress.zip' npm i cypress
(##################) ⠦ reify:cypress: timing reifyNode:node_modules/lodash Completed in 672ms
> cypress@10.3.1 postinstall
> node index.js --exec install

Installing Cypress (version: 10.3.1)iming reifyNode:node_modules/cypress Completed in 686ms


The Cypress App could not be downloaded.

Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration

Otherwise, please check network connectivity and try again:

----------

URL: ${version}/linux-x64/cypress.zip
Error: Invalid URI "$%7Bversion%7D/linux-x64/cypress.zip"

----------

Platform: linux-x64 (Manjaro Linux - 21.3.5)
Cypress Version: 10.3.1
npm ERR! code 1
npm ERR! path /tmp/npm-test/node_modules/cypress
npm ERR! command failed
npm ERR! command sh -c node index.js --exec install

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/fengyu/.npm/_logs/2022-07-22T02_05_03_894Z-debug-0.log

const prepend = (arch, urlPath) => {
const endpoint = url.resolve(getBaseUrl(), urlPath)
const platform = os.platform()
const pathTemplate = util.getEnv('CYPRESS_DOWNLOAD_PATH_TEMPLATE', true)
return pathTemplate
? (
pathTemplate
.replace(/\\?\$\{endpoint\}/, endpoint)
.replace(/\\?\$\{platform\}/, platform)
.replace(/\\?\$\{arch\}/, arch)
)
: `${endpoint}?platform=${platform}&arch=${arch}`
}

Seems download task only replaced ${endpoint}, ${platform}, and ${arch}

ZachJW34 pushed a commit that referenced this issue Aug 16, 2022
…16976 #22864) (#23194)

Co-authored-by: Blue F <blue@cypress.io>
Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
@tbiethman
Copy link
Contributor

The code for this is done in #23194, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 16, 2022

Released in 10.6.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

4 participants