heroku 10.0.0-beta.2 → 10.0.0-beta.4

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.
@@ -56,19 +56,11 @@ class Create extends command_1.Command {
56
56
  process.stderr.write(` ${color_1.default.yellow('›')} See https://devcenter.heroku.com/changelog-items/2925 for more info.\n`);
57
57
  }
58
58
  if (isInferenceAddon) {
59
- core_1.ux.warn('\n\nThis pilot feature is a Beta Service. You may opt to try such Beta Service in your sole discretion. ' +
60
- 'Any use of the Beta Service is subject to the applicable Beta Services Terms provided at ' +
61
- 'https://www.salesforce.com/company/legal/customer-agreements/. While use of the pilot feature itself is free, ' +
62
- 'to the extent such use consumes a generally available Service, you may be charged for that consumption as set ' +
63
- 'forth in the Documentation. Your continued use of this pilot feature constitutes your acceptance of the foregoing.\n\n' +
64
- 'For clarity and without limitation, the various third-party machine learning and generative artificial intelligence ' +
65
- '(AI) models and applications (each a “Platform”) integrated with the Beta Service are Non-SFDC Applications, ' +
66
- 'as that term is defined in the Beta Services Terms. Note that these third-party Platforms include features that use ' +
67
- 'generative AI technology. Due to the nature of generative AI, the output that a Platform generates may be ' +
68
- 'unpredictable, and may include inaccurate or harmful responses. Before using any generative AI output, Customer is ' +
69
- 'solely responsible for reviewing the output for accuracy, safety, and compliance with applicable laws and third-party ' +
70
- 'acceptable use policies. In addition, Customer’s use of each Platform may be subject to the Platform’s own terms and ' +
71
- 'conditions, compliance with which Customer is solely responsible.\n');
59
+ core_1.ux.warn((0, tsheredoc_1.default) `
60
+ Heroku Managed Inference and Agent is a pilot or beta service that is subject to the Beta Services Terms at https://www.salesforce.com/company/legal/customer-agreements/ or a written Unified Pilot Agreement if executed by Customer, and the Non-GA Gen AI and Non-GA Credit Consumption terms in the Product Terms Directory at https://ptd.salesforce.com. While use of this pilot or beta service is itself free, such use may consume GA Heroku credits and/or resources for which the Customer may have paid or be charged. Use of this pilot or beta is at the Customer's sole discretion.
61
+
62
+ For clarity and without limitation, the various third-party machine learning and generative artificial intelligence (AI) models and applications (each a “Platform”) integrated with the Beta Service are Non-SFDC Applications, as that term is defined in the Beta Services Terms. Note that these third-party Platforms include features that use generative AI technology. Due to the nature of generative AI, the output that a Platform generates may be unpredictable, and may include inaccurate or harmful responses. Before using any generative AI output, Customer is solely responsible for reviewing the output for accuracy, safety, and compliance with applicable laws and third-party acceptable use policies. In addition, Customer’s use of each Platform may be subject to the Platform’s own terms and conditions, compliance with which Customer is solely responsible.
63
+ `);
72
64
  }
73
65
  const config = parseConfig(argv);
74
66
  let addon;
@@ -62,7 +62,8 @@ function print(info, addons, collaborators, extended) {
62
62
  data['Git URL'] = info.app.git_url;
63
63
  data['Web URL'] = info.app.web_url;
64
64
  data['Repo Size'] = (0, filesize_1.filesize)(info.app.repo_size, { standard: 'jedec', round: 0 });
65
- data['Slug Size'] = (0, filesize_1.filesize)(info.app.slug_size, { standard: 'jedec', round: 0 });
65
+ if (info.app.generation.name !== 'fir')
66
+ data['Slug Size'] = (0, filesize_1.filesize)(info.app.slug_size, { standard: 'jedec', round: 0 });
66
67
  data.Owner = info.app.owner.email;
67
68
  data.Region = info.app.region.name;
68
69
  data.Dynos = countBy(info.dynos, 'type');
@@ -115,7 +116,8 @@ class AppsInfo extends command_1.Command {
115
116
  print('git_url', info.app.git_url);
116
117
  print('web_url', info.app.web_url);
117
118
  print('repo_size', (0, filesize_1.filesize)(info.app.repo_size, { standard: 'jedec', round: 0 }));
118
- print('slug_size', (0, filesize_1.filesize)(info.app.slug_size, { standard: 'jedec', round: 0 }));
119
+ if (info.app.generation.name !== 'fir')
120
+ print('slug_size', (0, filesize_1.filesize)(info.app.slug_size, { standard: 'jedec', round: 0 }));
119
121
  print('owner', info.app.owner.email);
120
122
  print('region', info.app.region.name);
121
123
  print('dynos', util.inspect(countBy(info.dynos, 'type')));
@@ -1,17 +1,18 @@
1
1
  import { Command } from '@heroku-cli/command';
2
2
  export default class RunInside extends Command {
3
3
  static description: string;
4
- static example: string;
4
+ static strict: boolean;
5
+ static args: {
6
+ dyno_name: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
7
+ command: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
8
+ };
5
9
  static flags: {
6
10
  app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
11
  'exit-code': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
12
  listen: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ 'no-launcher': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
15
  };
11
- static args: {
12
- DYNO_NAME: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
13
- COMMAND: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
14
- };
15
- static strict: boolean;
16
+ static examples: string[];
16
17
  run(): Promise<void>;
17
18
  }
@@ -3,20 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const command_1 = require("@heroku-cli/command");
4
4
  const core_1 = require("@oclif/core");
5
5
  const debug_1 = require("debug");
6
+ const tsheredoc_1 = require("tsheredoc");
6
7
  const dyno_1 = require("../../lib/run/dyno");
7
8
  const helpers_1 = require("../../lib/run/helpers");
8
- const tsheredoc_1 = require("tsheredoc");
9
9
  const debug = (0, debug_1.default)('heroku:run:inside');
10
10
  class RunInside extends command_1.Command {
11
11
  async run() {
12
- const { flags, args } = await this.parse(RunInside);
12
+ const { args, argv, flags } = await this.parse(RunInside);
13
+ const { dyno_name: dynoName } = args;
14
+ const { app: appName, 'exit-code': exitCode, listen, 'no-launcher': noLauncher } = flags;
15
+ const prependLauncher = !noLauncher;
16
+ const { body: app } = await this.heroku.get(`/apps/${appName}`, {
17
+ headers: { Accept: 'application/vnd.heroku+json; version=3.sdk' },
18
+ });
19
+ const appStackIsCnb = app.stack.name === 'cnb';
13
20
  const opts = {
14
- 'exit-code': flags['exit-code'],
15
- app: flags.app,
16
- command: (0, helpers_1.buildCommand)([args.COMMAND]),
17
- dyno: args.DYNO_NAME,
21
+ app: appName,
22
+ command: (0, helpers_1.buildCommand)(argv.slice(1), appStackIsCnb && prependLauncher),
23
+ dyno: dynoName,
24
+ 'exit-code': exitCode,
18
25
  heroku: this.heroku,
19
- listen: flags.listen,
26
+ listen,
20
27
  };
21
28
  const dyno = new dyno_1.default(opts);
22
29
  try {
@@ -34,23 +41,42 @@ class RunInside extends command_1.Command {
34
41
  }
35
42
  }
36
43
  exports.default = RunInside;
37
- RunInside.description = 'run a one-off process inside an existing heroku dyno (for Fir-generation apps only)';
38
- RunInside.example = (0, tsheredoc_1.default) `
39
- Run bash
40
- $ heroku run:inside web-848cd4f64d-pvpr2 bash
41
- Run a command supplied by a script
42
- $ heroku run:inside web-848cd4f64d-pvpr2 -- myscript.sh
43
- Run a command declared for the worker process type in a Procfile
44
- $ heroku run:inside worker
45
- `;
44
+ RunInside.description = 'run a command inside an existing dyno (for Fir-generation apps only)';
45
+ RunInside.strict = false;
46
+ RunInside.args = {
47
+ dyno_name: core_1.Args.string({
48
+ description: 'name of the dyno to run command inside',
49
+ required: true,
50
+ }),
51
+ command: core_1.Args.string({
52
+ description: 'command to run (Heroku automatically prepends ‘launcher’ to the command)',
53
+ required: true,
54
+ }),
55
+ };
46
56
  RunInside.flags = {
47
57
  app: command_1.flags.app({ required: true }),
48
- remote: command_1.flags.remote(),
49
- 'exit-code': command_1.flags.boolean({ char: 'x', description: 'passthrough the exit code of the remote command' }),
58
+ 'exit-code': command_1.flags.boolean({
59
+ char: 'x',
60
+ description: 'passthrough the exit code of the remote command',
61
+ }),
50
62
  listen: command_1.flags.boolean({ description: 'listen on a local port', hidden: true }),
63
+ 'no-launcher': command_1.flags.boolean({
64
+ description: 'don’t prepend ‘launcher’ before a command',
65
+ default: false,
66
+ }),
67
+ remote: command_1.flags.remote(),
51
68
  };
52
- RunInside.args = {
53
- DYNO_NAME: core_1.Args.string({ required: true, description: 'name of the dyno to run command inside' }),
54
- COMMAND: core_1.Args.string({ required: true, description: 'command to run' }),
55
- };
56
- RunInside.strict = false;
69
+ RunInside.examples = [
70
+ (0, tsheredoc_1.default) `
71
+ Run bash
72
+ heroku run:inside web-848cd4f64d-pvpr2 bash -a my-app
73
+ `,
74
+ (0, tsheredoc_1.default) `
75
+ Run a command supplied by a script taking option flags
76
+ heroku run:inside web-848cd4f64d-pvpr2 -a my-app -- myscript.sh -x --log-level=warn
77
+ `,
78
+ (0, tsheredoc_1.default) `
79
+ Run a command declared for the worker process type in a Procfile
80
+ heroku run:inside web-848cd4f64d-pvpr2 worker -a my-app
81
+ `,
82
+ ];
@@ -206,6 +206,7 @@ class Dyno extends stream_1.Duplex {
206
206
  });
207
207
  }
208
208
  _handle(localServer) {
209
+ var _a;
209
210
  const addr = localServer.address();
210
211
  const host = addr.address;
211
212
  const port = addr.port;
@@ -235,13 +236,26 @@ class Dyno extends stream_1.Duplex {
235
236
  sshProc.stdout.setEncoding('utf8');
236
237
  sshProc.stdout.on('data', this._readData());
237
238
  }
238
- // @ts-ignore
239
- sshProc.stderr.on('data', data => {
240
- lastErr = data;
239
+ (_a = sshProc.stderr) === null || _a === void 0 ? void 0 : _a.on('data', data => {
240
+ var _a;
241
+ lastErr = data.toString();
241
242
  // suppress host key and permission denied messages
242
- if (this._isDebug() || (data.includes("Warning: Permanently added '[127.0.0.1]") && data.includes('Permission denied (publickey).'))) {
243
+ const messages = [
244
+ "Warning: Permanently added '[127.0.0.1]"
245
+ ];
246
+ const killMessages = [
247
+ 'too many authentication failures',
248
+ 'No more authentication methods to try',
249
+ 'Permission denied (publickey).',
250
+ ];
251
+ if (this._isDebug() || [...killMessages, ...messages].some(message => data.includes(message))) {
243
252
  process.stderr.write(data);
244
253
  }
254
+ if (killMessages.some(message => data.includes(message))) {
255
+ sshProc.kill();
256
+ localServer.close();
257
+ (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, lastErr);
258
+ }
245
259
  });
246
260
  sshProc.on('close', () => {
247
261
  // there was a problem connecting with the ssh key
@@ -1,3 +1,3 @@
1
1
  export declare function revertSortedArgs(processArgs: Array<string>, argv: Array<string>): string[];
2
- export declare function buildCommand(args: Array<string>): string;
2
+ export declare function buildCommand(args: Array<string>, prependLauncher?: boolean): string;
3
3
  export declare function buildEnvFromFlag(flag: string): {};
@@ -26,11 +26,12 @@ function revertSortedArgs(processArgs, argv) {
26
26
  return originalInputOrder;
27
27
  }
28
28
  exports.revertSortedArgs = revertSortedArgs;
29
- function buildCommand(args) {
29
+ function buildCommand(args, prependLauncher = false) {
30
+ const prependText = prependLauncher ? 'launcher ' : '';
30
31
  if (args.length === 1) {
31
32
  // do not add quotes around arguments if there is only one argument
32
33
  // `heroku run "rake test"` should work like `heroku run rake test`
33
- return args[0];
34
+ return `${prependText}${args[0]}`;
34
35
  }
35
36
  let cmd = '';
36
37
  for (let arg of args) {
@@ -39,7 +40,7 @@ function buildCommand(args) {
39
40
  }
40
41
  cmd = cmd + ' ' + arg;
41
42
  }
42
- return cmd.trim();
43
+ return `${prependText}${cmd.trim()}`;
43
44
  }
44
45
  exports.buildCommand = buildCommand;
45
46
  function buildEnvFromFlag(flag) {
@@ -30,7 +30,7 @@ function renderInfo(space, json) {
30
30
  State: space.state,
31
31
  Shield: displayShieldState(space),
32
32
  'Outbound IPs': displayNat(space.outbound_ips),
33
- Generation: space.generation,
33
+ Generation: space.generation.name,
34
34
  'Created at': space.created_at,
35
35
  }, ['ID', 'Team', 'Region', 'CIDR', 'Data CIDR', 'State', 'Shield', 'Outbound IPs', 'Generation', 'Created at']);
36
36
  }