heroku 10.1.0-beta.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/analytics.d.ts +1 -0
- package/lib/analytics.js +2 -1
- package/lib/commands/addons/open.js +1 -1
- package/lib/commands/pg/settings/log-min-duration-statement.js +1 -1
- package/lib/commands/pipelines/diff.js +14 -11
- package/lib/commands/spaces/destroy.js +16 -2
- package/lib/commands/telemetry/add.js +1 -1
- package/lib/commands/telemetry/index.js +1 -1
- package/lib/file.d.ts +1 -1
- package/lib/file.js +2 -2
- package/lib/hooks/postrun/performance_analytics.js +1 -0
- package/lib/hooks/prerun/analytics.js +1 -1
- package/lib/lib/api.d.ts +5 -8
- package/lib/lib/apps/generation.js +2 -2
- package/oclif.manifest.json +900 -901
- package/package.json +16 -10
package/lib/analytics.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export default class AnalyticsCommand {
|
|
|
25
25
|
config: Interfaces.Config;
|
|
26
26
|
userConfig: typeof deps.UserConfig.prototype;
|
|
27
27
|
http: typeof deps.HTTP;
|
|
28
|
+
initialize: Promise<void>;
|
|
28
29
|
constructor(config: Interfaces.Config);
|
|
29
30
|
record(opts: RecordOpts): Promise<any>;
|
|
30
31
|
get url(): string;
|
package/lib/analytics.js
CHANGED
|
@@ -11,9 +11,10 @@ class AnalyticsCommand {
|
|
|
11
11
|
this.http = deps_1.default.HTTP.create({
|
|
12
12
|
headers: { 'user-agent': config.userAgent },
|
|
13
13
|
});
|
|
14
|
+
this.initialize = this.init();
|
|
14
15
|
}
|
|
15
16
|
async record(opts) {
|
|
16
|
-
await this.
|
|
17
|
+
await this.initialize;
|
|
17
18
|
const plugin = opts.Command.plugin;
|
|
18
19
|
if (!plugin) {
|
|
19
20
|
debug('no plugin found for analytics');
|
|
@@ -53,7 +53,7 @@ class Open extends command_1.Command {
|
|
|
53
53
|
const sso = await this.heroku.request(`/apps/${app}/addons/${args.addon}/sso`, {
|
|
54
54
|
method: 'GET',
|
|
55
55
|
headers: {
|
|
56
|
-
Accept: 'application/vnd.heroku+json; version=3.
|
|
56
|
+
Accept: 'application/vnd.heroku+json; version=3.sdk',
|
|
57
57
|
},
|
|
58
58
|
});
|
|
59
59
|
const { method, action } = sso.body;
|
|
@@ -23,13 +23,15 @@ async function diff(targetApp, downstreamApp, githubToken, herokuUserAgent) {
|
|
|
23
23
|
// Do the actual GitHub diff
|
|
24
24
|
try {
|
|
25
25
|
const path = `${targetApp.repo}/compare/${downstreamApp.hash}...${targetApp.hash}`;
|
|
26
|
-
const headers = {
|
|
26
|
+
const headers = {
|
|
27
|
+
authorization: 'token ' + githubToken,
|
|
28
|
+
'Content-Type': 'application/vnd.github+json',
|
|
29
|
+
'X-GitHub-Api-Version': '2022-11-28',
|
|
30
|
+
};
|
|
27
31
|
if (herokuUserAgent) {
|
|
28
|
-
headers
|
|
32
|
+
Reflect.set(headers, 'user-agent', herokuUserAgent);
|
|
29
33
|
}
|
|
30
|
-
const githubDiff = await http_call_1.default.get(`https://api.github.com/repos/${path}`, {
|
|
31
|
-
headers,
|
|
32
|
-
}).then(res => res.body);
|
|
34
|
+
const { body: githubDiff } = await http_call_1.default.get(`https://api.github.com/repos/${path}`, { headers });
|
|
33
35
|
core_1.ux.log('');
|
|
34
36
|
core_1.ux.styledHeader(`${color_1.default.app(targetApp.name)} is ahead of ${color_1.default.app(downstreamApp.name)} by ${githubDiff.ahead_by} commit${githubDiff.ahead_by === 1 ? '' : 's'}`);
|
|
35
37
|
const mapped = githubDiff.commits.map((commit) => {
|
|
@@ -49,7 +51,6 @@ async function diff(targetApp, downstreamApp, githubToken, herokuUserAgent) {
|
|
|
49
51
|
message: {},
|
|
50
52
|
});
|
|
51
53
|
core_1.ux.log(`\nhttps://github.com/${path}`);
|
|
52
|
-
// tslint:disable-next-line: no-unused
|
|
53
54
|
}
|
|
54
55
|
catch (_a) {
|
|
55
56
|
core_1.ux.log(`\n${color_1.default.app(targetApp.name)} was not compared to ${color_1.default.app(downstreamApp.name)} because we were unable to perform a diff`);
|
|
@@ -99,15 +100,17 @@ class PipelinesDiff extends command_1.Command {
|
|
|
99
100
|
async run() {
|
|
100
101
|
const { flags } = await this.parse(PipelinesDiff);
|
|
101
102
|
const targetAppName = flags.app;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
let coupling;
|
|
104
|
+
try {
|
|
105
|
+
({ body: coupling } = await (0, api_1.getCoupling)(this.heroku, targetAppName));
|
|
106
|
+
}
|
|
107
|
+
catch (_a) {
|
|
106
108
|
core_1.ux.error(`This app (${targetAppName}) does not seem to be a part of any pipeline`);
|
|
107
109
|
return;
|
|
108
110
|
}
|
|
111
|
+
const { body: pipeline } = await (0, api_1.getPipeline)(this.heroku, coupling.pipeline.id);
|
|
109
112
|
const targetAppId = coupling.app.id;
|
|
110
|
-
const generation =
|
|
113
|
+
const generation = pipeline.generation.name;
|
|
111
114
|
core_1.ux.action.start('Fetching apps from pipeline');
|
|
112
115
|
const allApps = await (0, api_1.listPipelineApps)(this.heroku, coupling.pipeline.id);
|
|
113
116
|
core_1.ux.action.stop();
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
-
const color_1 = require("@heroku-cli/color");
|
|
5
4
|
const command_1 = require("@heroku-cli/command");
|
|
6
5
|
const tsheredoc_1 = require("tsheredoc");
|
|
7
6
|
const confirmCommand_1 = require("../../lib/confirmCommand");
|
|
8
7
|
const spaces_1 = require("../../lib/spaces/spaces");
|
|
8
|
+
const color_1 = require("@heroku-cli/color");
|
|
9
9
|
class Destroy extends command_1.Command {
|
|
10
10
|
async run() {
|
|
11
|
+
var _a, _b;
|
|
11
12
|
const { flags, args } = await this.parse(Destroy);
|
|
12
13
|
const { confirm } = flags;
|
|
13
14
|
const spaceName = flags.space || args.space;
|
|
@@ -22,7 +23,20 @@ class Destroy extends command_1.Command {
|
|
|
22
23
|
if (space.state === 'allocated') {
|
|
23
24
|
({ body: space.outbound_ips } = await this.heroku.get(`/spaces/${spaceName}/nat`));
|
|
24
25
|
if (space.outbound_ips && space.outbound_ips.state === 'enabled') {
|
|
25
|
-
|
|
26
|
+
const ipv6 = ((_a = space.generation) === null || _a === void 0 ? void 0 : _a.name) === 'fir' ? ' and IPv6' : '';
|
|
27
|
+
natWarning = (0, tsheredoc_1.default) `
|
|
28
|
+
${color_1.default.dim('===')} ${color_1.default.bold('WARNING: Outbound IPs Will Be Reused')}
|
|
29
|
+
${color_1.default.yellow(`⚠️ Deleting this space frees up the following outbound IPv4${ipv6} IPs for reuse:`)}
|
|
30
|
+
${color_1.default.bold((_b = (0, spaces_1.displayNat)(space.outbound_ips)) !== null && _b !== void 0 ? _b : '')}
|
|
31
|
+
|
|
32
|
+
${color_1.default.dim('Update the following configurations:')}
|
|
33
|
+
${color_1.default.dim('=')} IP allowlists
|
|
34
|
+
${color_1.default.dim('=')} Firewall rules
|
|
35
|
+
${color_1.default.dim('=')} Security group configurations
|
|
36
|
+
${color_1.default.dim('=')} Network ACLs
|
|
37
|
+
|
|
38
|
+
${color_1.default.yellow(`Ensure that you remove the listed IPv4${ipv6} addresses from your security configurations.`)}
|
|
39
|
+
`;
|
|
26
40
|
}
|
|
27
41
|
}
|
|
28
42
|
await (0, confirmCommand_1.default)(spaceName, confirm, `Destructive Action\nThis command will destroy the space ${color_1.default.bold.red(spaceName)}\n${natWarning}\n`);
|
|
@@ -29,7 +29,7 @@ class Add extends command_1.Command {
|
|
|
29
29
|
signals: (0, util_1.validateAndFormatSignals)(signals),
|
|
30
30
|
exporter: {
|
|
31
31
|
endpoint,
|
|
32
|
-
type:
|
|
32
|
+
type: (transport === 'grpc') ? 'otlp' : 'otlphttp',
|
|
33
33
|
headers: JSON.parse(exporterHeaders),
|
|
34
34
|
},
|
|
35
35
|
};
|
|
@@ -44,6 +44,6 @@ Index.topic = 'telemetry';
|
|
|
44
44
|
Index.description = 'list telemetry drains';
|
|
45
45
|
Index.flags = {
|
|
46
46
|
space: command_1.flags.string({ char: 's', description: 'filter by space name', exactlyOne: ['app', 'space'] }),
|
|
47
|
-
app: command_1.flags.
|
|
47
|
+
app: command_1.flags.string({ description: 'filter by app name' }),
|
|
48
48
|
};
|
|
49
49
|
Index.example = '$ heroku telemetry';
|
package/lib/file.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export declare function ls(dir: string): Promise<{
|
|
|
10
10
|
}[]>;
|
|
11
11
|
export declare function removeEmptyDirs(dir: string): Promise<void>;
|
|
12
12
|
export declare function readJSON(file: string): Promise<any>;
|
|
13
|
-
export declare function outputJSON(file: string, data: any
|
|
13
|
+
export declare function outputJSON(file: string, data: any): Promise<void>;
|
|
14
14
|
export declare function realpathSync(p: string): string;
|
package/lib/file.js
CHANGED
|
@@ -53,9 +53,9 @@ async function readJSON(file) {
|
|
|
53
53
|
return deps_1.default.fs.readJSON(file);
|
|
54
54
|
}
|
|
55
55
|
exports.readJSON = readJSON;
|
|
56
|
-
async function outputJSON(file, data
|
|
56
|
+
async function outputJSON(file, data) {
|
|
57
57
|
debug('outputJSON', file);
|
|
58
|
-
return deps_1.default.fs.outputJSON(file, data,
|
|
58
|
+
return deps_1.default.fs.outputJSON(file, data, { spaces: 2 });
|
|
59
59
|
}
|
|
60
60
|
exports.outputJSON = outputJSON;
|
|
61
61
|
function realpathSync(p) {
|
|
@@ -8,5 +8,6 @@ const performance_analytics = async function () {
|
|
|
8
8
|
const cmdStartTime = global.cliTelemetry.commandRunDuration;
|
|
9
9
|
global.cliTelemetry.commandRunDuration = telemetry.computeDuration(cmdStartTime);
|
|
10
10
|
global.cliTelemetry.lifecycleHookCompletion.postrun = true;
|
|
11
|
+
await Reflect.get(globalThis, 'recordPromise');
|
|
11
12
|
};
|
|
12
13
|
exports.default = performance_analytics;
|
|
@@ -8,6 +8,6 @@ const analytics = async function (options) {
|
|
|
8
8
|
}
|
|
9
9
|
global.cliTelemetry = telemetry.setupTelemetry(this.config, options);
|
|
10
10
|
const analytics = new analytics_1.default(this.config);
|
|
11
|
-
|
|
11
|
+
Reflect.set(globalThis, 'recordPromise', analytics.record(options));
|
|
12
12
|
};
|
|
13
13
|
exports.default = analytics;
|
package/lib/lib/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIClient } from '@heroku-cli/command';
|
|
2
2
|
import * as Heroku from '@heroku-cli/schema';
|
|
3
|
-
import { App,
|
|
3
|
+
import { App, Pipeline, PipelineCoupling } from './types/fir';
|
|
4
4
|
export declare const V3_HEADER = "application/vnd.heroku+json; version=3";
|
|
5
5
|
export declare const SDK_HEADER = "application/vnd.heroku+json; version=3.sdk";
|
|
6
6
|
export declare const FILTERS_HEADER: string;
|
|
@@ -14,24 +14,21 @@ export declare function createPipeline(heroku: APIClient, name: any, owner: any)
|
|
|
14
14
|
export declare function createPipelineTransfer(heroku: APIClient, pipeline: Heroku.Pipeline): Promise<import("@heroku/http-call").HTTP<unknown>>;
|
|
15
15
|
export declare function destroyPipeline(heroku: APIClient, name: any, pipelineId: any): Promise<import("@heroku/http-call").HTTP<unknown>>;
|
|
16
16
|
export declare function findPipelineByName(heroku: APIClient, idOrName: string): Promise<import("@heroku/http-call").HTTP<Heroku.Pipeline[]>>;
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export declare function getCoupling(heroku: APIClient, app: string): Promise<import("@heroku/http-call").HTTP<PipelineCouplingSdk>>;
|
|
21
|
-
export declare function getPipeline(heroku: APIClient, id: string): Promise<import("@heroku/http-call").HTTP<Heroku.Pipeline>>;
|
|
17
|
+
export declare function getCoupling(heroku: APIClient, app: string): Promise<import("@heroku/http-call").HTTP<PipelineCoupling>>;
|
|
18
|
+
export declare function getPipeline(heroku: APIClient, id: string): Promise<import("@heroku/http-call").HTTP<Pipeline>>;
|
|
22
19
|
export declare function updatePipeline(heroku: APIClient, id: string, body: Heroku.Pipeline): Promise<import("@heroku/http-call").HTTP<Heroku.Pipeline>>;
|
|
23
20
|
export declare function getTeam(heroku: APIClient, teamId: any): Promise<import("@heroku/http-call").HTTP<Heroku.Team>>;
|
|
24
21
|
export declare function getAccountInfo(heroku: APIClient, id?: string): Promise<import("@heroku/http-call").HTTP<Heroku.Account>>;
|
|
25
22
|
export declare function getAppSetup(heroku: APIClient, buildId: any): Promise<import("@heroku/http-call").HTTP<Heroku.AppSetup>>;
|
|
26
23
|
export interface AppWithPipelineCoupling extends App {
|
|
27
|
-
pipelineCoupling:
|
|
24
|
+
pipelineCoupling: PipelineCoupling;
|
|
28
25
|
[k: string]: unknown;
|
|
29
26
|
}
|
|
30
27
|
export declare function listPipelineApps(heroku: APIClient, pipelineId: string): Promise<Array<AppWithPipelineCoupling>>;
|
|
31
28
|
export declare function patchCoupling(heroku: APIClient, id: string, stage: string): Promise<import("@heroku/http-call").HTTP<Heroku.PipelineCoupling>>;
|
|
32
29
|
export declare function removeCoupling(heroku: APIClient, app: string): Promise<import("@heroku/http-call").HTTP<unknown>>;
|
|
33
30
|
export declare function updateCoupling(heroku: APIClient, app: string, stage: string): Promise<import("@heroku/http-call").HTTP<Heroku.PipelineCoupling>>;
|
|
34
|
-
export declare function getReleases(heroku: APIClient, appId: string): Promise<import("@heroku/http-call").HTTP<Release[]>>;
|
|
31
|
+
export declare function getReleases(heroku: APIClient, appId: string): Promise<import("@heroku/http-call").HTTP<Heroku.Release[]>>;
|
|
35
32
|
export declare function getPipelineConfigVars(heroku: APIClient, pipelineID: string): Promise<import("@heroku/http-call").HTTP<Heroku.ConfigVars>>;
|
|
36
33
|
export declare function setPipelineConfigVars(heroku: APIClient, pipelineID: string, body: Heroku.ConfigVars | Record<string, null>): Promise<import("@heroku/http-call").HTTP<Heroku.ConfigVars>>;
|
|
37
34
|
export declare function createTestRun(heroku: APIClient, body: Heroku.TestRun): Promise<import("@heroku/http-call").HTTP<Heroku.TestRun>>;
|
|
@@ -14,11 +14,11 @@ async function getApp(appOrName, herokuApi) {
|
|
|
14
14
|
}
|
|
15
15
|
async function isFirApp(appOrName, herokuApi) {
|
|
16
16
|
const app = await getApp(appOrName, herokuApi);
|
|
17
|
-
return app.generation === 'fir';
|
|
17
|
+
return app.generation.name === 'fir';
|
|
18
18
|
}
|
|
19
19
|
exports.isFirApp = isFirApp;
|
|
20
20
|
async function isCedarApp(appOrName, herokuApi) {
|
|
21
21
|
const app = await getApp(appOrName, herokuApi);
|
|
22
|
-
return app.generation === 'cedar';
|
|
22
|
+
return app.generation.name === 'cedar';
|
|
23
23
|
}
|
|
24
24
|
exports.isCedarApp = isCedarApp;
|