From 3ac89b236abe3392c185010c3b3851a6923d083a Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 3 Oct 2024 11:11:13 -0400 Subject: [PATCH 1/5] Remove dev dependency `@types/mixpanel` Change-type: patch --- npm-shrinkwrap.json | 7 ------- package.json | 1 - 2 files changed, 8 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 3ddfce3e..c86a9e33 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -118,7 +118,6 @@ "@types/klaw": "^3.0.6", "@types/lodash": "^4.14.178", "@types/mime": "^3.0.4", - "@types/mixpanel": "^2.14.3", "@types/mocha": "^10.0.7", "@types/mock-fs": "^4.13.4", "@types/mock-require": "^2.0.1", @@ -3846,12 +3845,6 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", "dev": true }, - "node_modules/@types/mixpanel": { - "version": "2.14.3", - "resolved": "https://registry.npmjs.org/@types/mixpanel/-/mixpanel-2.14.3.tgz", - "integrity": "sha512-pc/3bFJNX74nCVFyx4jd606k9hNi6rdeU9qyqbiws5/Q8YwoExdzpOl1qp7oLbSigl1jju1b/f0XcP/b/THj2A==", - "dev": true - }, "node_modules/@types/mocha": { "version": "10.0.7", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.7.tgz", diff --git a/package.json b/package.json index 7e5f4257..934de68b 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,6 @@ "@types/klaw": "^3.0.6", "@types/lodash": "^4.14.178", "@types/mime": "^3.0.4", - "@types/mixpanel": "^2.14.3", "@types/mocha": "^10.0.7", "@types/mock-fs": "^4.13.4", "@types/mock-require": "^2.0.1", From 09e653692b00777aa56625751110305223bc5917 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 3 Oct 2024 11:17:19 -0400 Subject: [PATCH 2/5] Remove no longer needed references and tests for mixpanel Change-type: patch --- automation/deploy-bin.ts | 215 ---------------------- automation/run.ts | 2 - src/events.ts | 4 - tests/commands/app/create.spec.ts | 1 - tests/commands/build.spec.ts | 2 - tests/commands/deploy.spec.ts | 2 - tests/commands/device/device-move.spec.ts | 1 - tests/commands/device/device.spec.ts | 1 - tests/commands/device/devices.spec.ts | 1 - tests/commands/device/supported.spec.ts | 1 - tests/commands/env/add.spec.ts | 1 - tests/commands/env/envs.spec.ts | 1 - tests/commands/env/rename.spec.ts | 1 - tests/commands/env/rm.spec.ts | 1 - tests/commands/help.spec.ts | 1 - tests/commands/logs.spec.ts | 1 - tests/commands/os/configure.spec.ts | 1 - tests/commands/push.spec.ts | 2 - tests/commands/release.spec.ts | 1 - tests/commands/ssh.spec.ts | 1 - tests/commands/tag/set.spec.ts | 1 - tests/commands/version.spec.ts | 1 - tests/commands/whoami.spec.ts | 1 - tests/deprecation.spec.ts | 1 - tests/nock/balena-api-mock.ts | 5 - 25 files changed, 250 deletions(-) delete mode 100644 automation/deploy-bin.ts diff --git a/automation/deploy-bin.ts b/automation/deploy-bin.ts deleted file mode 100644 index 4a345822..00000000 --- a/automation/deploy-bin.ts +++ /dev/null @@ -1,215 +0,0 @@ -/** - * @license - * Copyright 2019 Balena Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as _ from 'lodash'; -import * as semver from 'semver'; -import { Octokit } from '@octokit/rest'; -import { throttling } from '@octokit/plugin-throttling'; - -const { GITHUB_TOKEN } = process.env; - -/** Return a cached Octokit instance, creating a new one as needed. */ -const getOctokit = _.once(function () { - const OctokitConstructor = Octokit.plugin(throttling); - return new OctokitConstructor({ - auth: GITHUB_TOKEN, - throttle: { - onRateLimit: (retryAfter: number, options: any) => { - console.warn( - `Request quota exhausted for request ${options.method} ${options.url}`, - ); - // retries 3 times - if (options.request.retryCount < 3) { - console.log(`Retrying after ${retryAfter} seconds!`); - return true; - } - }, - onAbuseLimit: (_retryAfter: number, options: any) => { - // does not retry, only logs a warning - console.warn( - `Abuse detected for request ${options.method} ${options.url}`, - ); - }, - }, - }); -}); - -/** - * Extract pagination information (current page, total pages, ordinal number) - * from the 'link' response header (example below), using the parse-link-header - * npm package: - * "link": "; rel=\"next\", - * ; rel=\"last\"" - * - * @param response Octokit response object (including response.headers.link) - * @param perPageDefault Default per_page pagination value if missing in URL - * @return Object where 'page' is the current page number (1-based), - * 'pages' is the total number of pages, and 'ordinal' is the ordinal number - * (3rd, 4th, 5th...) of the first item in the current page. - */ -async function getPageNumbers( - response: any, - perPageDefault: number, -): Promise<{ page: number; pages: number; ordinal: number }> { - const res = { page: 1, pages: 1, ordinal: 1 }; - if (!response.headers.link) { - return res; - } - const parse = await import('parse-link-header'); - - const parsed = parse(response.headers.link); - if (parsed == null) { - throw new Error(`Failed to parse link header: '${response.headers.link}'`); - } - let perPage = perPageDefault; - if (parsed.next) { - if (parsed.next.per_page) { - perPage = parseInt(parsed.next.per_page, 10); - } - res.page = parseInt(parsed.next.page!, 10) - 1; - res.pages = parseInt(parsed.last!.page!, 10); - } else { - if (parsed.prev!.per_page) { - perPage = parseInt(parsed.prev!.per_page, 10); - } - res.page = res.pages = parseInt(parsed.prev!.page!, 10) + 1; - } - res.ordinal = (res.page - 1) * perPage + 1; - return res; -} - -/** - * Iterate over every GitHub release in the given owner/repo, check whether - * its tag_name matches against the affectedVersions semver spec, and if so - * replace its release description (body) with the given newDescription value. - * @param owner GitHub repo owner, e.g. 'balena-io' or 'pdcastro' - * @param repo GitHub repo, e.g. 'balena-cli' - * @param affectedVersions Semver spec, e.g. '2.6.1 - 7.10.9 || 8.0.0' - * @param newDescription New release description (body) - * @param editID Short string present in newDescription, e.g. '[AA101]', that - * can be searched to determine whether that release has already been updated. - */ -async function updateGitHubReleaseDescriptions( - owner: string, - repo: string, - affectedVersions: string, - newDescription: string, - editID: string, -) { - const perPage = 30; - const octokit = getOctokit(); - const options = octokit.repos.listReleases.endpoint.merge({ - owner, - repo, - per_page: perPage, - }); - let errCount = 0; - type Release = - import('@octokit/rest').RestEndpointMethodTypes['repos']['listReleases']['response']['data'][0]; - for await (const response of octokit.paginate.iterator(options)) { - const { - page: thisPage, - pages: totalPages, - ordinal, - } = await getPageNumbers(response, perPage); - let i = 0; - for (const cliRelease of response.data) { - const prefix = `[#${ordinal + i++} pg ${thisPage}/${totalPages}]`; - if (!cliRelease.id) { - console.error( - `${prefix} Error: missing release ID (errCount=${++errCount})`, - ); - continue; - } - const skipMsg = `${prefix} skipping release "${cliRelease.tag_name}" (${cliRelease.id})`; - if (cliRelease.draft === true) { - console.info(`${skipMsg}: draft release`); - continue; - } else if (cliRelease.body && cliRelease.body.includes(editID)) { - console.info(`${skipMsg}: already updated`); - continue; - } else if (!semver.satisfies(cliRelease.tag_name, affectedVersions)) { - console.info(`${skipMsg}: outside version range`); - continue; - } else { - const updatedRelease = { - owner, - repo, - release_id: cliRelease.id, - body: newDescription, - }; - let oldBodyPreview = cliRelease.body; - if (oldBodyPreview) { - oldBodyPreview = oldBodyPreview.replace(/\s+/g, ' ').trim(); - if (oldBodyPreview.length > 12) { - oldBodyPreview = oldBodyPreview.substring(0, 9) + '...'; - } - } - console.info( - `${prefix} updating release "${cliRelease.tag_name}" (${cliRelease.id}) old body="${oldBodyPreview}"`, - ); - try { - await octokit.repos.updateRelease(updatedRelease); - } catch (err) { - console.error( - `${skipMsg}: Error: ${err.message} (count=${++errCount})`, - ); - continue; - } - } - } - } -} - -/** - * Add a warning description to CLI releases affected by a mixpanel tracking - * security issue (#1359). This function can be executed "manually" with the - * following command line: - * - * npx ts-node --type-check -P automation/tsconfig.json automation/run.ts fix1359 - */ -export async function updateDescriptionOfReleasesAffectedByIssue1359() { - // Run only on Linux/Node10, instead of all platform/Node combinations. - // (It could have been any other platform, as long as it only runs once.) - if (process.platform !== 'linux' || semver.major(process.version) !== 10) { - return; - } - const owner = 'balena-io'; - const repo = 'balena-cli'; - const affectedVersions = - '2.6.1 - 7.10.9 || 8.0.0 - 8.1.0 || 9.0.0 - 9.15.6 || 10.0.0 - 10.17.5 || 11.0.0 - 11.7.2'; - const editID = '[AA100]'; - let newDescription = ` - Please note: the "login" command in this release is affected by a - security issue fixed in versions - [7.10.10](https://github.com/balena-io/balena-cli/releases/tag/v7.10.10), - [8.1.1](https://github.com/balena-io/balena-cli/releases/tag/v8.1.1), - [9.15.7](https://github.com/balena-io/balena-cli/releases/tag/v9.15.7), - [10.17.6](https://github.com/balena-io/balena-cli/releases/tag/v10.17.6), - [11.7.3](https://github.com/balena-io/balena-cli/releases/tag/v11.7.3) - and later. If you need to use this version, avoid passing your password, - keys or tokens as command-line arguments. ${editID}`; - // remove line breaks and collapse white space - newDescription = newDescription.replace(/\s+/g, ' ').trim(); - await updateGitHubReleaseDescriptions( - owner, - repo, - affectedVersions, - newDescription, - editID, - ); -} diff --git a/automation/run.ts b/automation/run.ts index f8fc0273..b0986f43 100644 --- a/automation/run.ts +++ b/automation/run.ts @@ -24,7 +24,6 @@ import { signFilesForNotarization, testShrinkwrap, } from './build-bin'; -import { updateDescriptionOfReleasesAffectedByIssue1359 } from './deploy-bin'; // DEBUG set to falsy for negative values else is truthy process.env.DEBUG = ['0', 'no', 'false', '', undefined].includes( @@ -54,7 +53,6 @@ async function parse(args?: string[]) { 'sign:binaries': signFilesForNotarization, 'catch-uncommitted': catchUncommitted, 'test-shrinkwrap': testShrinkwrap, - fix1359: updateDescriptionOfReleasesAffectedByIssue1359, }; for (const arg of args) { if (!Object.hasOwn(commands, arg)) { diff --git a/src/events.ts b/src/events.ts index 3aa2826a..aa6dcbed 100644 --- a/src/events.ts +++ b/src/events.ts @@ -59,7 +59,6 @@ export async function trackCommand(commandSignature: string) { }); }); } - // Don't actually call mixpanel.track() while running test cases, or if suppressed if ( !process.env.BALENA_CLI_TEST_TYPE && !process.env.BALENARC_NO_ANALYTICS @@ -75,9 +74,6 @@ export async function trackCommand(commandSignature: string) { const TIMEOUT = 4000; -/** - * Make the event tracking HTTPS request to balenaCloud's '/mixpanel' endpoint. - */ async function sendEvent(balenaUrl: string, event: string, username?: string) { const { default: got } = await import('got'); const trackData = { diff --git a/tests/commands/app/create.spec.ts b/tests/commands/app/create.spec.ts index ef1df249..290b5e37 100644 --- a/tests/commands/app/create.spec.ts +++ b/tests/commands/app/create.spec.ts @@ -36,7 +36,6 @@ describe('balena app create', function () { // Temporarily skipped because of parse/checking order issue with -h it.skip('should print help text with the -h flag', async () => { api.expectGetWhoAmI({ optional: true }); - api.expectGetMixpanel({ optional: true }); const { out, err } = await runCommand('app create -h'); diff --git a/tests/commands/build.spec.ts b/tests/commands/build.spec.ts index ec5400a0..cf503c6b 100644 --- a/tests/commands/build.spec.ts +++ b/tests/commands/build.spec.ts @@ -91,7 +91,6 @@ describe('balena build', function () { api = new BalenaAPIMock(); docker = new DockerMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); docker.expectGetPing(); docker.expectGetVersion({ persist: true }); }); @@ -619,7 +618,6 @@ describe('balena build: project validation', function () { this.beforeEach(() => { api = new BalenaAPIMock(); - api.expectGetMixpanel({ optional: true }); }); this.afterEach(() => { diff --git a/tests/commands/deploy.spec.ts b/tests/commands/deploy.spec.ts index b256bea6..cff67b75 100644 --- a/tests/commands/deploy.spec.ts +++ b/tests/commands/deploy.spec.ts @@ -82,7 +82,6 @@ describe('balena deploy', function () { api = new BalenaAPIMock(); docker = new DockerMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); api.expectGetApplication({ expandArchitecture: true }); api.expectGetRelease(); api.expectGetUser(); @@ -515,7 +514,6 @@ describe('balena deploy: project validation', function () { this.beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); }); this.afterEach(() => { diff --git a/tests/commands/device/device-move.spec.ts b/tests/commands/device/device-move.spec.ts index 7acdd2d1..aab0699a 100644 --- a/tests/commands/device/device-move.spec.ts +++ b/tests/commands/device/device-move.spec.ts @@ -25,7 +25,6 @@ describe('balena device move', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); }); afterEach(() => { diff --git a/tests/commands/device/device.spec.ts b/tests/commands/device/device.spec.ts index 7cd2c7a5..af6cbb43 100644 --- a/tests/commands/device/device.spec.ts +++ b/tests/commands/device/device.spec.ts @@ -27,7 +27,6 @@ describe('balena device', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); }); afterEach(() => { diff --git a/tests/commands/device/devices.spec.ts b/tests/commands/device/devices.spec.ts index 5c0ac5ba..ef2d032b 100644 --- a/tests/commands/device/devices.spec.ts +++ b/tests/commands/device/devices.spec.ts @@ -27,7 +27,6 @@ describe('balena devices', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); }); afterEach(() => { diff --git a/tests/commands/device/supported.spec.ts b/tests/commands/device/supported.spec.ts index 037f552c..eec1b379 100644 --- a/tests/commands/device/supported.spec.ts +++ b/tests/commands/device/supported.spec.ts @@ -26,7 +26,6 @@ describe('balena devices supported', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true }); - api.expectGetMixpanel({ optional: true }); }); afterEach(() => { diff --git a/tests/commands/env/add.spec.ts b/tests/commands/env/add.spec.ts index b8d3d095..c16489ed 100644 --- a/tests/commands/env/add.spec.ts +++ b/tests/commands/env/add.spec.ts @@ -28,7 +28,6 @@ describe('balena env add', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); }); afterEach(() => { diff --git a/tests/commands/env/envs.spec.ts b/tests/commands/env/envs.spec.ts index aec9e816..14f2df22 100644 --- a/tests/commands/env/envs.spec.ts +++ b/tests/commands/env/envs.spec.ts @@ -31,7 +31,6 @@ describe('balena envs', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); // Random device UUID used to frustrate _.memoize() in utils/cloud.ts fullUUID = randomBytes(16).toString('hex'); shortUUID = fullUUID.substring(0, 7); diff --git a/tests/commands/env/rename.spec.ts b/tests/commands/env/rename.spec.ts index fa461872..78e3cbb1 100644 --- a/tests/commands/env/rename.spec.ts +++ b/tests/commands/env/rename.spec.ts @@ -26,7 +26,6 @@ describe('balena env rename', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); }); afterEach(() => { diff --git a/tests/commands/env/rm.spec.ts b/tests/commands/env/rm.spec.ts index 51b910d4..b4ee159f 100644 --- a/tests/commands/env/rm.spec.ts +++ b/tests/commands/env/rm.spec.ts @@ -26,7 +26,6 @@ describe('balena env rm', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); }); afterEach(() => { diff --git a/tests/commands/help.spec.ts b/tests/commands/help.spec.ts index 945c6cad..d129728b 100644 --- a/tests/commands/help.spec.ts +++ b/tests/commands/help.spec.ts @@ -111,7 +111,6 @@ describe.skip('balena help', function () { this.beforeEach(() => { api = new BalenaAPIMock(); - api.expectGetMixpanel({ optional: true }); }); this.afterEach(() => { diff --git a/tests/commands/logs.spec.ts b/tests/commands/logs.spec.ts index 2b56b660..64670848 100644 --- a/tests/commands/logs.spec.ts +++ b/tests/commands/logs.spec.ts @@ -31,7 +31,6 @@ describe('balena logs', function () { api = new BalenaAPIMock(); supervisor = new SupervisorMock(); api.expectGetWhoAmI(); - api.expectGetMixpanel({ optional: true }); }); this.afterEach(() => { diff --git a/tests/commands/os/configure.spec.ts b/tests/commands/os/configure.spec.ts index 72688fee..e3bc3bd4 100644 --- a/tests/commands/os/configure.spec.ts +++ b/tests/commands/os/configure.spec.ts @@ -35,7 +35,6 @@ if (process.platform !== 'win32') { beforeEach(async () => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); tmpPath = (await tmpNameAsync()) as string; await fs.copyFile('./tests/test-data/dummy.img', tmpPath); }); diff --git a/tests/commands/push.spec.ts b/tests/commands/push.spec.ts index 5a2c4c24..9a40d17c 100644 --- a/tests/commands/push.spec.ts +++ b/tests/commands/push.spec.ts @@ -89,7 +89,6 @@ describe('balena push', function () { api = new BalenaAPIMock(); builder = new BuilderMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); api.expectGetApplication(); }); @@ -518,7 +517,6 @@ describe('balena push: project validation', function () { this.beforeEach(() => { api = new BalenaAPIMock(); - api.expectGetMixpanel({ optional: true }); }); this.afterEach(() => { diff --git a/tests/commands/release.spec.ts b/tests/commands/release.spec.ts index f977e950..6f42eba8 100644 --- a/tests/commands/release.spec.ts +++ b/tests/commands/release.spec.ts @@ -26,7 +26,6 @@ describe('balena release', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); }); afterEach(() => { diff --git a/tests/commands/ssh.spec.ts b/tests/commands/ssh.spec.ts index f2d05874..37a10e1e 100644 --- a/tests/commands/ssh.spec.ts +++ b/tests/commands/ssh.spec.ts @@ -76,7 +76,6 @@ describe('balena ssh', function () { this.beforeEach(function () { api = new BalenaAPIMock(); - api.expectGetMixpanel({ optional: true }); }); this.afterEach(function () { diff --git a/tests/commands/tag/set.spec.ts b/tests/commands/tag/set.spec.ts index 0ed18fde..2c106747 100644 --- a/tests/commands/tag/set.spec.ts +++ b/tests/commands/tag/set.spec.ts @@ -28,7 +28,6 @@ describe('balena tag set', function () { beforeEach(() => { api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); }); afterEach(() => { diff --git a/tests/commands/version.spec.ts b/tests/commands/version.spec.ts index 06cbb696..1cbf6696 100644 --- a/tests/commands/version.spec.ts +++ b/tests/commands/version.spec.ts @@ -30,7 +30,6 @@ describe('balena version', function () { this.beforeEach(() => { api = new BalenaAPIMock(); - api.expectGetMixpanel({ optional: true }); }); this.afterEach(() => { diff --git a/tests/commands/whoami.spec.ts b/tests/commands/whoami.spec.ts index 14140d19..958531aa 100644 --- a/tests/commands/whoami.spec.ts +++ b/tests/commands/whoami.spec.ts @@ -24,7 +24,6 @@ describe('balena whoami', function () { this.beforeEach(() => { api = new BalenaAPIMock(); - api.expectGetMixpanel({ optional: true }); }); this.afterEach(async () => { diff --git a/tests/deprecation.spec.ts b/tests/deprecation.spec.ts index f42b128b..d78f8b64 100644 --- a/tests/deprecation.spec.ts +++ b/tests/deprecation.spec.ts @@ -68,7 +68,6 @@ describe('DeprecationChecker', function () { npm = new NpmMock(); api = new BalenaAPIMock(); api.expectGetWhoAmI({ optional: true, persist: true }); - api.expectGetMixpanel({ optional: true }); checker = new DeprecationChecker(packageJSON.version); getStub = sandbox.stub(mockStorage, 'get').withArgs(checker.cacheFile); diff --git a/tests/nock/balena-api-mock.ts b/tests/nock/balena-api-mock.ts index 2dcaee39..add690e9 100644 --- a/tests/nock/balena-api-mock.ts +++ b/tests/nock/balena-api-mock.ts @@ -74,7 +74,6 @@ export class BalenaAPIMock extends NockMock { "vpnEndpoint":"vpn.balena-cloud.com", "registryEndpoint":"registry2.balena-cloud.com", "deltaEndpoint":"https://delta.balena-cloud.com", - "mixpanelToken":"", "apiKey":"nothingtoseehere" }`), ); @@ -465,10 +464,6 @@ export class BalenaAPIMock extends NockMock { public expectWhoAmIFail(opts: ScopeOpts = { optional: true }) { this.optGet('/actor/v1/whoami', opts).reply(401); } - - public expectGetMixpanel(opts: ScopeOpts = {}) { - this.optGet(/^\/mixpanel\/track/, opts).reply(200, {}); - } } const appServiceVarsByService: { [key: string]: any } = { From f6f6be8ee8be80048e621a4e75d2fbecacce47e4 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 3 Oct 2024 12:00:56 -0400 Subject: [PATCH 3/5] Remove dev dependency @octokit/plugin-throttling Change-type: patch --- npm-shrinkwrap.json | 20 -------------------- package.json | 1 - 2 files changed, 21 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c86a9e33..76e55933 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -92,7 +92,6 @@ "devDependencies": { "@balena/lint": "^8.0.0", "@electron/notarize": "^2.0.0", - "@octokit/plugin-throttling": "^3.5.1", "@octokit/rest": "^18.6.7", "@types/archiver": "^6.0.2", "@types/bluebird": "^3.5.36", @@ -2496,19 +2495,6 @@ "@octokit/core": ">=3" } }, - "node_modules/@octokit/plugin-throttling": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-3.5.1.tgz", - "integrity": "sha512-d2jh3/RZo98DRw2J0jFxhKz7nrTGalGdkfRtxM+pI5k1wRb4BKBjiuE9cuZnhZyj+zLC1EcIptj7K+28LJZ3eA==", - "dev": true, - "dependencies": { - "@octokit/types": "^6.0.1", - "bottleneck": "^2.15.3" - }, - "peerDependencies": { - "@octokit/core": "^3.5.0" - } - }, "node_modules/@octokit/request": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.0.tgz", @@ -5850,12 +5836,6 @@ "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.1.4.tgz", "integrity": "sha512-3hx0kwU3uzG6ReQ3pnaFQPSktpBw6RHN3/ivDKEuU8g1XSfafowyvDnadjv1xp8IZqhtSukxlwv9bF6FhX8m0w==" }, - "node_modules/bottleneck": { - "version": "2.19.5", - "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", - "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", - "dev": true - }, "node_modules/bowser": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", diff --git a/package.json b/package.json index 934de68b..6f7bf6a6 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,6 @@ "devDependencies": { "@balena/lint": "^8.0.0", "@electron/notarize": "^2.0.0", - "@octokit/plugin-throttling": "^3.5.1", "@octokit/rest": "^18.6.7", "@types/archiver": "^6.0.2", "@types/bluebird": "^3.5.36", From a3ec75c2c752f734f07e84e9213887b4aec4e7fd Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Thu, 3 Oct 2024 12:01:47 -0400 Subject: [PATCH 4/5] Remove dev dependency @octokit/rest Change-type: patch --- npm-shrinkwrap.json | 160 -------------------------------------------- package.json | 1 - 2 files changed, 161 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 76e55933..a3a5682b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -92,7 +92,6 @@ "devDependencies": { "@balena/lint": "^8.0.0", "@electron/notarize": "^2.0.0", - "@octokit/rest": "^18.6.7", "@types/archiver": "^6.0.2", "@types/bluebird": "^3.5.36", "@types/body-parser": "^1.19.2", @@ -2409,138 +2408,6 @@ "node": ">=18.0.0" } }, - "node_modules/@octokit/auth-token": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", - "integrity": "sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==", - "dev": true, - "dependencies": { - "@octokit/types": "^6.0.3" - } - }, - "node_modules/@octokit/core": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz", - "integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==", - "dev": true, - "dependencies": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.0", - "@octokit/request-error": "^2.0.5", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", - "dev": true, - "dependencies": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/graphql": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.6.4.tgz", - "integrity": "sha512-SWTdXsVheRmlotWNjKzPOb6Js6tjSqA2a8z9+glDJng0Aqjzti8MEWOtuT8ZSu6wHnci7LZNuarE87+WJBG4vg==", - "dev": true, - "dependencies": { - "@octokit/request": "^5.6.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/openapi-types": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-8.2.1.tgz", - "integrity": "sha512-BJz6kWuL3n+y+qM8Pv+UGbSxH6wxKf/SBs5yzGufMHwDefsa+Iq7ZGy1BINMD2z9SkXlIzk1qiu988rMuGXEMg==", - "dev": true - }, - "node_modules/@octokit/plugin-paginate-rest": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.14.0.tgz", - "integrity": "sha512-S2uEu2uHeI7Vf+Lvj8tv3O5/5TCAa8GHS0dUQN7gdM7vKA6ZHAbR6HkAVm5yMb1mbedLEbxOuQ+Fa0SQ7tCDLA==", - "dev": true, - "dependencies": { - "@octokit/types": "^6.18.0" - }, - "peerDependencies": { - "@octokit/core": ">=2" - } - }, - "node_modules/@octokit/plugin-request-log": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", - "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "dev": true, - "peerDependencies": { - "@octokit/core": ">=3" - } - }, - "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.4.1.tgz", - "integrity": "sha512-Nx0g7I5ayAYghsLJP4Q1Ch2W9jYYM0FlWWWZocUro8rNxVwuZXGfFd7Rcqi9XDWepSXjg1WByiNJnZza2hIOvQ==", - "dev": true, - "dependencies": { - "@octokit/types": "^6.18.1", - "deprecation": "^2.3.1" - }, - "peerDependencies": { - "@octokit/core": ">=3" - } - }, - "node_modules/@octokit/request": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.0.tgz", - "integrity": "sha512-4cPp/N+NqmaGQwbh3vUsYqokQIzt7VjsgTYVXiwpUP2pxd5YiZB2XuTedbb0SPtv9XS7nzAKjAuQxmY8/aZkiA==", - "dev": true, - "dependencies": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.1", - "universal-user-agent": "^6.0.0" - } - }, - "node_modules/@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", - "dev": true, - "dependencies": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "node_modules/@octokit/rest": { - "version": "18.6.7", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.6.7.tgz", - "integrity": "sha512-Kn6WrI2ZvmAztdx+HEaf88RuJn+LK72S8g6OpciE4kbZddAN84fu4fiPGxcEu052WmqKVnA/cnQsbNlrYC6rqQ==", - "dev": true, - "dependencies": { - "@octokit/core": "^3.5.0", - "@octokit/plugin-paginate-rest": "^2.6.2", - "@octokit/plugin-request-log": "^1.0.2", - "@octokit/plugin-rest-endpoint-methods": "5.4.1" - } - }, - "node_modules/@octokit/types": { - "version": "6.18.1", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.18.1.tgz", - "integrity": "sha512-5YsddjO1U+xC8ZYKV8yZYebW55PCc7qiEEeZ+wZRr6qyclynzfyD65KZ5FdtIeP0/cANyFaD7hV69qElf1nMsQ==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^8.2.1" - } - }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -5692,12 +5559,6 @@ "tweetnacl": "^0.14.3" } }, - "node_modules/before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", - "dev": true - }, "node_modules/binary": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", @@ -7283,12 +7144,6 @@ "node": ">= 0.8" } }, - "node_modules/deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", - "dev": true - }, "node_modules/deps-regex": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/deps-regex/-/deps-regex-0.2.0.tgz", @@ -11084,15 +10939,6 @@ "node": ">=8" } }, - "node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-promise": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", @@ -17260,12 +17106,6 @@ "moment": "^2.14.1" } }, - "node_modules/universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", - "dev": true - }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", diff --git a/package.json b/package.json index 6f7bf6a6..7211ee90 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,6 @@ "devDependencies": { "@balena/lint": "^8.0.0", "@electron/notarize": "^2.0.0", - "@octokit/rest": "^18.6.7", "@types/archiver": "^6.0.2", "@types/bluebird": "^3.5.36", "@types/body-parser": "^1.19.2", From da95baa70cc2dc72e6d529fa25c42cd2e1739c10 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Fri, 4 Oct 2024 08:30:22 -0400 Subject: [PATCH 5/5] Remove dev dependency `parse-link-header` Change-type: patch --- npm-shrinkwrap.json | 17 ----------------- package.json | 2 -- 2 files changed, 19 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a3a5682b..52c46dc2 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -122,7 +122,6 @@ "@types/ndjson": "^2.0.1", "@types/node": "^20.0.0", "@types/node-cleanup": "^2.1.2", - "@types/parse-link-header": "^2.0.3", "@types/prettyjson": "^0.0.33", "@types/progress-stream": "^2.0.2", "@types/request": "^2.48.7", @@ -161,7 +160,6 @@ "mock-require": "^3.0.3", "nock": "^13.2.1", "oclif": "^4.14.0", - "parse-link-header": "^2.0.0", "rewire": "^7.0.0", "simple-git": "^3.14.1", "sinon": "^18.0.0", @@ -3766,12 +3764,6 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "node_modules/@types/parse-link-header": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/parse-link-header/-/parse-link-header-2.0.3.tgz", - "integrity": "sha512-ffLAxD6Xqcf2gSbtEJehj8yJ5R/2OZqD4liodQvQQ+hhO4kg1mk9ToEZQPMtNTm/zIQj2GNleQbsjPp9+UQm4Q==", - "dev": true - }, "node_modules/@types/prettyjson": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/@types/prettyjson/-/prettyjson-0.0.33.tgz", @@ -13891,15 +13883,6 @@ "node": ">=4" } }, - "node_modules/parse-link-header": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/parse-link-header/-/parse-link-header-2.0.0.tgz", - "integrity": "sha512-xjU87V0VyHZybn2RrCX5TIFGxTVZE6zqqZWMPlIKiSKuWh/X5WZdt+w1Ki1nXB+8L/KtL+nZ4iq+sfI6MrhhMw==", - "dev": true, - "dependencies": { - "xtend": "~4.0.1" - } - }, "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", diff --git a/package.json b/package.json index 7211ee90..e30e1614 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,6 @@ "@types/ndjson": "^2.0.1", "@types/node": "^20.0.0", "@types/node-cleanup": "^2.1.2", - "@types/parse-link-header": "^2.0.3", "@types/prettyjson": "^0.0.33", "@types/progress-stream": "^2.0.2", "@types/request": "^2.48.7", @@ -182,7 +181,6 @@ "mock-require": "^3.0.3", "nock": "^13.2.1", "oclif": "^4.14.0", - "parse-link-header": "^2.0.0", "rewire": "^7.0.0", "simple-git": "^3.14.1", "sinon": "^18.0.0",