Skip to content

Commit

Permalink
Switch request, request-promise to @cypress/ forks (#6777)
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Mar 19, 2020
1 parent 47410d5 commit d810950
Show file tree
Hide file tree
Showing 24 changed files with 71 additions and 77 deletions.
2 changes: 1 addition & 1 deletion cli/lib/tasks/download.js
Expand Up @@ -5,7 +5,7 @@ const os = require('os')
const url = require('url')
const path = require('path')
const debug = require('debug')('cypress:cli')
const request = require('request')
const request = require('@cypress/request')
const Promise = require('bluebird')
const requestProgress = require('request-progress')
const { stripIndent } = require('common-tags')
Expand Down
2 changes: 1 addition & 1 deletion cli/package.json
Expand Up @@ -21,6 +21,7 @@
},
"dependencies": {
"@cypress/listr-verbose-renderer": "0.4.1",
"@cypress/request": "2.88.5",
"@cypress/xvfb": "1.2.4",
"@types/blob-util": "1.3.3",
"@types/bluebird": "3.5.29",
Expand Down Expand Up @@ -59,7 +60,6 @@
"ospath": "1.2.2",
"pretty-bytes": "5.3.0",
"ramda": "0.26.1",
"request": "cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16",
"request-progress": "3.0.0",
"supports-color": "7.1.0",
"tmp": "0.1.0",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -83,6 +83,8 @@
"@cypress/eslint-plugin-dev": "5.0.0",
"@cypress/github-commit-status-check": "1.5.0",
"@cypress/questions-remain": "1.0.1",
"@cypress/request": "2.88.5",
"@cypress/request-promise": "4.2.6",
"@fellow/eslint-plugin-coffee": "0.4.13",
"@percy/cypress": "2.3.0",
"@types/bluebird": "3.5.29",
Expand Down Expand Up @@ -176,8 +178,6 @@
"print-arch": "1.0.0",
"proxyquire": "2.1.0",
"ramda": "0.24.1",
"request": "cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16",
"request-promise": "4.2.4",
"shelljs": "0.8.3",
"shx": "0.3.2",
"sinon": "7.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/https-proxy/package.json
Expand Up @@ -24,13 +24,13 @@
},
"devDependencies": {
"@cypress/debugging-proxy": "2.0.1",
"@cypress/request": "2.88.5",
"@cypress/request-promise": "4.2.6",
"@packages/network": "*",
"@packages/ts": "*",
"chai": "3.5.0",
"cross-env": "6.0.3",
"mocha": "3.5.3",
"request": "cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16",
"request-promise": "4.2.4",
"sinon": "1.17.7",
"sinon-as-promised": "4.0.3",
"sinon-chai": "3.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/https-proxy/test/spec_helper.js
Expand Up @@ -2,7 +2,7 @@ const chai = require('chai')
const sinon = require('sinon')
const Promise = require('bluebird')
const sinonChai = require('sinon-chai')
const request = require('request-promise')
const request = require('@cypress/request-promise')
const supertest = require('supertest')

require('sinon-as-promised')(Promise)
Expand Down
4 changes: 2 additions & 2 deletions packages/network/package.json
Expand Up @@ -21,14 +21,14 @@
},
"devDependencies": {
"@cypress/debugging-proxy": "2.0.1",
"@cypress/request": "2.88.5",
"@cypress/request-promise": "4.2.6",
"@packages/https-proxy": "*",
"@packages/socket": "*",
"@packages/ts": "*",
"@types/concat-stream": "1.6.0",
"express": "4.16.4",
"mocha": "6.2.2",
"request": "cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16",
"request-promise": "4.2.4",
"sinon": "7.3.1",
"sinon-chai": "3.3.0",
"typescript": "3.5.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/network/test/unit/agent_spec.ts
Expand Up @@ -3,7 +3,7 @@ import chai from 'chai'
import http from 'http'
import https from 'https'
import net from 'net'
import request from 'request-promise'
import request from '@cypress/request-promise'
import sinon from 'sinon'
import sinonChai from 'sinon-chai'
import tls from 'tls'
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/lib/http/error-middleware.ts
@@ -1,6 +1,6 @@
import debugModule from 'debug'
import { Readable } from 'stream'
import { Request } from 'request'
import { Request } from '@cypress/request'
import { HttpMiddleware } from './'

const debug = debugModule('cypress:proxy:http:error-middleware')
Expand Down
4 changes: 2 additions & 2 deletions packages/proxy/package.json
Expand Up @@ -22,10 +22,10 @@
"utf8-stream": "0.0.0"
},
"devDependencies": {
"@cypress/request": "2.88.5",
"@cypress/request-promise": "4.2.6",
"@cypress/sinon-chai": "2.9.0",
"@types/express": "4.17.2",
"request": "cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16",
"request-promise": "4.2.5",
"typescript": "3.5.3"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/test/unit/http/util/security.spec.ts
Expand Up @@ -3,7 +3,7 @@ import { concatStream } from '@packages/network'
import { expect } from 'chai'
import fs from 'fs'
import Promise from 'bluebird'
import rp from 'request-promise'
import rp from '@cypress/request-promise'
import * as security from '../../../../lib/http/util/security'

const original = `\
Expand Down
4 changes: 2 additions & 2 deletions packages/server/lib/api.coffee
@@ -1,8 +1,8 @@
_ = require("lodash")
os = require("os")
debug = require("debug")("cypress:server:api")
request = require("request-promise")
errors = require("request-promise/errors")
request = require("@cypress/request-promise")
errors = require("@cypress/request-promise/errors")
Promise = require("bluebird")
humanInterval = require("human-interval")
agent = require("@packages/network").agent
Expand Down
8 changes: 4 additions & 4 deletions packages/server/lib/request.coffee
@@ -1,6 +1,6 @@
_ = require("lodash")
r = require("request")
rp = require("request-promise")
r = require("@cypress/request")
rp = require("@cypress/request-promise")
url = require("url")
tough = require("tough-cookie")
debug = require("debug")("cypress:server:request")
Expand Down Expand Up @@ -376,9 +376,9 @@ module.exports = (options = {}) ->
rp = rp.defaults(defaults)

return {
r: require("request")
r: require("@cypress/request")

rp: require("request-promise")
rp: require("@cypress/request-promise")

getDelayForRetry

Expand Down
2 changes: 1 addition & 1 deletion packages/server/lib/updater.coffee
@@ -1,7 +1,7 @@
_ = require("lodash")
debug = require("debug")("cypress:server:updater")
semver = require("semver")
request = require("request")
request = require("@cypress/request")
NwUpdater = require("node-webkit-updater")
pkg = require("@packages/root")
agent = require("@packages/network").agent
Expand Down
4 changes: 2 additions & 2 deletions packages/server/lib/upload.coffee
@@ -1,5 +1,5 @@
r = require("request")
rp = require("request-promise")
r = require("@cypress/request")
rp = require("@cypress/request-promise")
Promise = require("bluebird")
fs = require("./util/fs")

Expand Down
2 changes: 1 addition & 1 deletion packages/server/lib/util/ensure-url.ts
@@ -1,7 +1,7 @@
import _ from 'lodash'
import Bluebird from 'bluebird'
import debugModule from 'debug'
import rp from 'request-promise'
import rp from '@cypress/request-promise'
import * as url from 'url'
import { agent, connect } from '@packages/network'

Expand Down
4 changes: 2 additions & 2 deletions packages/server/package.json
Expand Up @@ -27,6 +27,8 @@
"@cypress/get-windows-proxy": "1.6.0",
"@cypress/icons": "0.7.0",
"@cypress/mocha-teamcity-reporter": "1.0.0",
"@cypress/request": "2.88.5",
"@cypress/request-promise": "4.2.6",
"@ffmpeg-installer/ffmpeg": "1.0.20",
"ansi_up": "4.0.4",
"black-hole-stream": "0.0.1",
Expand Down Expand Up @@ -92,8 +94,6 @@
"pluralize": "8.0.0",
"ramda": "0.24.1",
"randomstring": "1.1.5",
"request": "cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16",
"request-promise": "4.2.4",
"return-deep-diff": "0.3.0",
"sanitize-filename": "1.6.3",
"semver": "6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/e2e/4_form_submissions_spec.coffee
@@ -1,4 +1,4 @@
rp = require("request-promise")
rp = require("@cypress/request-promise")
path = require("path")
Promise = require("bluebird")
bodyParser = require("body-parser")
Expand Down
Expand Up @@ -4,7 +4,7 @@ http = require("http")
https = require("https")
path = require("path")
net = require("net")
request = require("request")
request = require("@cypress/request")
stream = require("stream")
debug = require("debug")("cypress:server:network-error-handling-spec")
Promise = require("bluebird")
Expand Down
4 changes: 2 additions & 2 deletions packages/server/test/integration/http_requests_spec.coffee
@@ -1,8 +1,8 @@
require("../spec_helper")

_ = require("lodash")
r = require("request")
rp = require("request-promise")
r = require("@cypress/request")
rp = require("@cypress/request-promise")
compression = require("compression")
dns = require("dns")
express = require("express")
Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/integration/server_spec.coffee
Expand Up @@ -2,7 +2,7 @@ require("../spec_helper")

_ = require("lodash")
http = require("http")
rp = require("request-promise")
rp = require("@cypress/request-promise")
Promise = require("bluebird")
evilDns = require("evil-dns")
httpsServer = require("#{root}../https-proxy/test/helpers/https_server")
Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/support/helpers/performance.js
Expand Up @@ -2,7 +2,7 @@ const ciProvider = require('../../../lib/util/ci_provider')
const { commitInfo } = require('@cypress/commit-info')
const pkg = require('../../../../../package.json')
const Promise = require('bluebird')
const rp = require('request-promise')
const rp = require('@cypress/request-promise')
const debug = require('debug')('cypress:performance')
const R = require('ramda')

Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/unit/updater_spec.coffee
Expand Up @@ -2,7 +2,7 @@ require("../spec_helper")

nmi = require("node-machine-id")
cwd = require("#{root}lib/cwd")
request = require("request")
request = require("@cypress/request")
Updater = require("#{root}lib/updater")
pkg = require("@packages/root")
_ = require("lodash")
Expand Down
2 changes: 1 addition & 1 deletion scripts/binary/util/purge-cloudflare-cache.ts
@@ -1,7 +1,7 @@
import _ from 'lodash'
import check from 'check-more-types'
import la from 'lazy-ass'
import rp from 'request-promise'
import rp from '@cypress/request-promise'

function hasCloudflareEnvironmentVars () {
return _.chain([process.env.CF_TOKEN, process.env.CF_ZONEID])
Expand Down
80 changes: 37 additions & 43 deletions yarn.lock
Expand Up @@ -1464,6 +1464,42 @@
dependencies:
popper.js "^1.15.0"

"@cypress/request-promise@4.2.6":
version "4.2.6"
resolved "https://registry.yarnpkg.com/@cypress/request-promise/-/request-promise-4.2.6.tgz#e1d2a6c69bddc1f68fe70855f5c2d3d5fe800819"
integrity sha512-mdjZxp4V5x6I8kTZS2yX6IlmsFpfhvPPJqvrU3QI+hTEHP/HqECu048YOY/1aSudc9BCfb0jIN/8vdno+a5E6g==
dependencies:
bluebird "^3.5.0"
request-promise-core "1.1.3"
stealthy-require "^1.1.1"
tough-cookie "^2.3.3"

"@cypress/request@2.88.5":
version "2.88.5"
resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.5.tgz#8d7ecd17b53a849cfd5ab06d5abe7d84976375d7"
integrity sha512-TzEC1XMi1hJkywWpRfD2clreTa/Z+lOrXDCxxBTBPEcY5azdPi56A6Xw+O4tWJnaJH3iIE7G5aDXZC6JgRZLcA==
dependencies:
aws-sign2 "~0.7.0"
aws4 "^1.8.0"
caseless "~0.12.0"
combined-stream "~1.0.6"
extend "~3.0.2"
forever-agent "~0.6.1"
form-data "~2.3.2"
har-validator "~5.1.3"
http-signature "~1.2.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.19"
oauth-sign "~0.9.0"
performance-now "^2.1.0"
qs "~6.5.2"
safe-buffer "^5.1.2"
tough-cookie "~2.5.0"
tunnel-agent "^0.6.0"
uuid "^3.3.2"

"@cypress/schema-tools@4.7.3":
version "4.7.3"
resolved "https://registry.yarnpkg.com/@cypress/schema-tools/-/schema-tools-4.7.3.tgz#75b0c217fba998b4fb8cfb79f582299f0f7cb329"
Expand Down Expand Up @@ -20583,13 +20619,6 @@ request-progress@3.0.0:
dependencies:
throttleit "^1.0.0"

request-promise-core@1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346"
integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==
dependencies:
lodash "^4.17.11"

request-promise-core@1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.3.tgz#e9a3c081b51380dfea677336061fea879a829ee9"
Expand All @@ -20606,17 +20635,7 @@ request-promise-native@^1.0.5, request-promise-native@^1.0.8:
stealthy-require "^1.1.1"
tough-cookie "^2.3.3"

request-promise@4.2.4:
version "4.2.4"
resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.4.tgz#1c5ed0d71441e38ad58c7ce4ea4ea5b06d54b310"
integrity sha512-8wgMrvE546PzbR5WbYxUQogUnUDfM0S7QIFZMID+J73vdFARkFy+HElj4T+MWYhpXwlLp0EQ8Zoj8xUA0he4Vg==
dependencies:
bluebird "^3.5.0"
request-promise-core "1.1.2"
stealthy-require "^1.1.1"
tough-cookie "^2.3.3"

request-promise@4.2.5, request-promise@^4.2.2:
request-promise@^4.2.2:
version "4.2.5"
resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.5.tgz#186222c59ae512f3497dfe4d75a9c8461bd0053c"
integrity sha512-ZgnepCykFdmpq86fKGwqntyTiUrHycALuGggpyCZwMvGaZWgxW6yagT0FHkgo5LzYvOaCNvxYwWYIjevSH1EDg==
Expand Down Expand Up @@ -20680,31 +20699,6 @@ request-promise@4.2.5, request-promise@^4.2.2:
tunnel-agent "^0.6.0"
uuid "^3.0.0"

request@cypress-io/request#b5af0d1fa47eec97ba980cde90a13e69a2afcd16:
version "2.88.1"
resolved "https://codeload.github.com/cypress-io/request/tar.gz/b5af0d1fa47eec97ba980cde90a13e69a2afcd16"
dependencies:
aws-sign2 "~0.7.0"
aws4 "^1.8.0"
caseless "~0.12.0"
combined-stream "~1.0.6"
extend "~3.0.2"
forever-agent "~0.6.1"
form-data "~2.3.2"
har-validator "~5.1.3"
http-signature "~1.2.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.19"
oauth-sign "~0.9.0"
performance-now "^2.1.0"
qs "~6.5.2"
safe-buffer "^5.1.2"
tough-cookie "~2.5.0"
tunnel-agent "^0.6.0"
uuid "^3.3.2"

request@~2.64.0:
version "2.64.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.64.0.tgz#96a582423ce9b4b5c34e9b232e480173f14ba608"
Expand Down

7 comments on commit d810950

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d810950 Mar 19, 2020

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.2.1/linux-x64/circle-develop-d810950379ca4744748f8ec1735376af06db2441-286063/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.2.1/circle-develop-d810950379ca4744748f8ec1735376af06db2441-286044/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d810950 Mar 19, 2020

Choose a reason for hiding this comment

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

Circle has built the darwin x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.2.1/darwin-x64/circle-develop-d810950379ca4744748f8ec1735376af06db2441-286068/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.2.1/circle-develop-d810950379ca4744748f8ec1735376af06db2441-286064/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d810950 Mar 19, 2020

Choose a reason for hiding this comment

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

AppVeyor has built the win32 ia32 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.2.1/win32-ia32/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.2.1/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/4.2.1/win32-ia32/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.2.1/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.2.1/win32-ia32/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.2.1/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.2.1/win32-ia32/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.zip npm install https://cdn.cypress.io/beta/npm/4.2.1/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d810950 Mar 19, 2020

Choose a reason for hiding this comment

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

AppVeyor has built the win32 x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.2.1/win32-x64/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.2.1/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/4.2.1/win32-x64/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.2.1/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.2.1/win32-x64/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.2.1/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.2.1/win32-x64/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.zip npm install https://cdn.cypress.io/beta/npm/4.2.1/appveyor-develop-d810950379ca4744748f8ec1735376af06db2441-31567890/cypress.tgz

@johannesschobel
Copy link

Choose a reason for hiding this comment

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

I think, this commit causes lots of problem with the new 4.2.0 version, as it cannot be installed via remote scripts!?

@jennifer-shehane
Copy link
Member

Choose a reason for hiding this comment

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

@johannesschobel Yes, there is an existing issue #6752. The fix for this will be released today in our 4.3.0 release.

@johannesschobel
Copy link

Choose a reason for hiding this comment

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

Thank you very much!

Please sign in to comment.