heroku 10.0.1 → 10.0.2-beta.1
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.
|
@@ -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();
|
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;
|
package/oclif.manifest.json
CHANGED
|
@@ -14451,5 +14451,5 @@
|
|
|
14451
14451
|
]
|
|
14452
14452
|
}
|
|
14453
14453
|
},
|
|
14454
|
-
"version": "10.0.1"
|
|
14454
|
+
"version": "10.0.2-beta.1"
|
|
14455
14455
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heroku",
|
|
3
3
|
"description": "CLI to interact with Heroku",
|
|
4
|
-
"version": "10.0.1",
|
|
4
|
+
"version": "10.0.2-beta.1",
|
|
5
5
|
"author": "Heroku",
|
|
6
6
|
"bin": "./bin/run",
|
|
7
7
|
"bugs": "https://github.com/heroku/cli/issues",
|
|
@@ -390,5 +390,5 @@
|
|
|
390
390
|
"version": "oclif readme --multi && git add README.md ../../docs"
|
|
391
391
|
},
|
|
392
392
|
"types": "lib/index.d.ts",
|
|
393
|
-
"gitHead": "
|
|
393
|
+
"gitHead": "2bf5e1ce8005cac177c9aa0c1b027d6cace48df8"
|
|
394
394
|
}
|