2022-07-12 13:45:03 +00:00
|
|
|
// source: pulumi/language.proto
|
2017-11-17 02:21:41 +00:00
|
|
|
/**
|
|
|
|
* @fileoverview
|
|
|
|
* @enhanceable
|
2022-05-31 14:41:40 +00:00
|
|
|
* @suppress {missingRequire} reports error on implicit type usages.
|
2017-11-17 02:21:41 +00:00
|
|
|
* @suppress {messageConventions} JS Compiler reports an error if a variable or
|
|
|
|
* field starts with 'MSG_' and isn't a translatable message.
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
// GENERATED CODE -- DO NOT EDIT!
|
2022-05-31 14:41:40 +00:00
|
|
|
/* eslint-disable */
|
|
|
|
// @ts-nocheck
|
2017-11-17 02:21:41 +00:00
|
|
|
|
|
|
|
var jspb = require('google-protobuf');
|
|
|
|
var goog = jspb;
|
2023-11-10 13:31:14 +00:00
|
|
|
var proto = { pulumirpc: { codegen: { }, testing: { } } }, global = proto;
|
2017-11-17 02:21:41 +00:00
|
|
|
|
2022-10-17 14:21:11 +00:00
|
|
|
var pulumi_codegen_hcl_pb = require('./codegen/hcl_pb.js');
|
|
|
|
goog.object.extend(proto, pulumi_codegen_hcl_pb);
|
2022-07-12 13:45:03 +00:00
|
|
|
var pulumi_plugin_pb = require('./plugin_pb.js');
|
|
|
|
goog.object.extend(proto, pulumi_plugin_pb);
|
2017-12-01 21:50:32 +00:00
|
|
|
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
|
2020-02-28 11:53:47 +00:00
|
|
|
goog.object.extend(proto, google_protobuf_empty_pb);
|
2023-10-20 10:44:16 +00:00
|
|
|
var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
|
|
|
|
goog.object.extend(proto, google_protobuf_struct_pb);
|
2024-06-06 08:21:46 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.AboutRequest', null, global);
|
2022-07-25 11:35:16 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.AboutResponse', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.DependencyInfo', null, global);
|
2022-10-17 14:21:11 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.GeneratePackageRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.GeneratePackageResponse', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.GenerateProgramRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.GenerateProgramResponse', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.GenerateProjectRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.GenerateProjectResponse', null, global);
|
2022-07-25 11:35:16 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.GetProgramDependenciesRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.GetProgramDependenciesResponse', null, global);
|
2018-02-06 17:57:32 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.GetRequiredPluginsRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.GetRequiredPluginsResponse', null, global);
|
2022-04-03 14:54:59 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.InstallDependenciesRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.InstallDependenciesResponse', null, global);
|
2023-07-27 21:39:36 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.PackRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.PackResponse', null, global);
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.ProgramInfo', null, global);
|
2022-10-04 08:58:01 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.RunPluginRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.RunPluginResponse', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.RunPluginResponse.OutputCase', null, global);
|
2017-11-17 02:21:41 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.RunRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.RunResponse', null, global);
|
2024-06-17 17:10:55 +00:00
|
|
|
goog.exportSymbol('proto.pulumirpc.RuntimeOptionPrompt', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.RuntimeOptionsRequest', null, global);
|
|
|
|
goog.exportSymbol('proto.pulumirpc.RuntimeOptionsResponse', null, global);
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.ProgramInfo, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.displayName = 'proto.pulumirpc.ProgramInfo';
|
|
|
|
}
|
2024-06-06 08:21:46 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.AboutRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.displayName = 'proto.pulumirpc.AboutRequest';
|
|
|
|
}
|
2022-07-25 11:35:16 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.AboutResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.displayName = 'proto.pulumirpc.AboutResponse';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GetProgramDependenciesRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.displayName = 'proto.pulumirpc.GetProgramDependenciesRequest';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.DependencyInfo, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.displayName = 'proto.pulumirpc.DependencyInfo';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GetProgramDependenciesResponse.repeatedFields_, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GetProgramDependenciesResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.displayName = 'proto.pulumirpc.GetProgramDependenciesResponse';
|
|
|
|
}
|
2018-02-06 17:57:32 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GetRequiredPluginsRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
2018-02-06 17:57:32 +00:00
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.displayName = 'proto.pulumirpc.GetRequiredPluginsRequest';
|
|
|
|
}
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GetRequiredPluginsResponse.repeatedFields_, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GetRequiredPluginsResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.displayName = 'proto.pulumirpc.GetRequiredPluginsResponse';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RunRequest.repeatedFields_, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.RunRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.displayName = 'proto.pulumirpc.RunRequest';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.RunResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse.displayName = 'proto.pulumirpc.RunResponse';
|
|
|
|
}
|
2022-04-03 14:54:59 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.InstallDependenciesRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.displayName = 'proto.pulumirpc.InstallDependenciesRequest';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.InstallDependenciesResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.displayName = 'proto.pulumirpc.InstallDependenciesResponse';
|
|
|
|
}
|
2024-06-17 17:10:55 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.RuntimeOptionsRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.displayName = 'proto.pulumirpc.RuntimeOptionsRequest';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RuntimeOptionPrompt.repeatedFields_, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.RuntimeOptionPrompt, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.displayName = 'proto.pulumirpc.RuntimeOptionPrompt';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.displayName = 'proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RuntimeOptionsResponse.repeatedFields_, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.RuntimeOptionsResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.displayName = 'proto.pulumirpc.RuntimeOptionsResponse';
|
|
|
|
}
|
2022-10-04 08:58:01 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.RunPluginRequest.repeatedFields_, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.RunPluginRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.displayName = 'proto.pulumirpc.RunPluginRequest';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.pulumirpc.RunPluginResponse.oneofGroups_);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.RunPluginResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.displayName = 'proto.pulumirpc.RunPluginResponse';
|
|
|
|
}
|
2022-10-17 14:21:11 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GenerateProgramRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.displayName = 'proto.pulumirpc.GenerateProgramRequest';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GenerateProgramResponse.repeatedFields_, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GenerateProgramResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.displayName = 'proto.pulumirpc.GenerateProgramResponse';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GenerateProjectRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.displayName = 'proto.pulumirpc.GenerateProjectRequest';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse = function(opt_data) {
|
2023-05-26 10:32:19 +00:00
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GenerateProjectResponse.repeatedFields_, null);
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GenerateProjectResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.displayName = 'proto.pulumirpc.GenerateProjectResponse';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GeneratePackageRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.displayName = 'proto.pulumirpc.GeneratePackageRequest';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse = function(opt_data) {
|
2023-12-05 17:47:52 +00:00
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.GeneratePackageResponse.repeatedFields_, null);
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.GeneratePackageResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.displayName = 'proto.pulumirpc.GeneratePackageResponse';
|
|
|
|
}
|
2023-07-27 21:39:36 +00:00
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.PackRequest, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.displayName = 'proto.pulumirpc.PackRequest';
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Generated by JsPbCodeGenerator.
|
|
|
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
|
|
* server response, or constructed directly in Javascript. The array is used
|
|
|
|
* in place and becomes part of the constructed object. It is not cloned.
|
|
|
|
* If no data is provided, the constructed object will be empty, but still
|
|
|
|
* valid.
|
|
|
|
* @extends {jspb.Message}
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse = function(opt_data) {
|
|
|
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
|
|
};
|
|
|
|
goog.inherits(proto.pulumirpc.PackResponse, jspb.Message);
|
|
|
|
if (goog.DEBUG && !COMPILED) {
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse.displayName = 'proto.pulumirpc.PackResponse';
|
|
|
|
}
|
2020-02-28 11:53:47 +00:00
|
|
|
|
2018-02-06 17:57:32 +00:00
|
|
|
|
|
|
|
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.ProgramInfo.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.ProgramInfo} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
rootDirectory: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
programDirectory: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
|
|
entryPoint: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
|
|
options: (f = msg.getOptions()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.ProgramInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.ProgramInfo;
|
|
|
|
return proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.ProgramInfo} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.ProgramInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setRootDirectory(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setProgramDirectory(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setEntryPoint(value);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
var value = new google_protobuf_struct_pb.Struct;
|
|
|
|
reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
|
|
|
|
msg.setOptions(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.ProgramInfo.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.ProgramInfo} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getRootDirectory();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getProgramDirectory();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getEntryPoint();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getOptions();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
4,
|
|
|
|
f,
|
|
|
|
google_protobuf_struct_pb.Struct.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string root_directory = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.getRootDirectory = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.ProgramInfo} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.setRootDirectory = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string program_directory = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.getProgramDirectory = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.ProgramInfo} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.setProgramDirectory = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string entry_point = 3;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.getEntryPoint = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.ProgramInfo} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.setEntryPoint = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 3, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional google.protobuf.Struct options = 4;
|
|
|
|
* @return {?proto.google.protobuf.Struct}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.getOptions = function() {
|
|
|
|
return /** @type{?proto.google.protobuf.Struct} */ (
|
|
|
|
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 4));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.google.protobuf.Struct|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.ProgramInfo} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.setOptions = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 4, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.ProgramInfo} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.clearOptions = function() {
|
|
|
|
return this.setOptions(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.ProgramInfo.prototype.hasOptions = function() {
|
|
|
|
return jspb.Message.getField(this, 4) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-06 08:21:46 +00:00
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.AboutRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.AboutRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.AboutRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.AboutRequest;
|
|
|
|
return proto.pulumirpc.AboutRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.AboutRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.AboutRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = new proto.pulumirpc.ProgramInfo;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader);
|
|
|
|
msg.setInfo(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.AboutRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.AboutRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getInfo();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
1,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.ProgramInfo.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional ProgramInfo info = 1;
|
|
|
|
* @return {?proto.pulumirpc.ProgramInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.prototype.getInfo = function() {
|
|
|
|
return /** @type{?proto.pulumirpc.ProgramInfo} */ (
|
|
|
|
jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 1));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.pulumirpc.ProgramInfo|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.AboutRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.prototype.setInfo = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.AboutRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.prototype.clearInfo = function() {
|
|
|
|
return this.setInfo(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutRequest.prototype.hasInfo = function() {
|
|
|
|
return jspb.Message.getField(this, 1) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-25 11:35:16 +00:00
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.AboutResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.AboutResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
executable: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
version: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
|
|
metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : []
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.AboutResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.AboutResponse;
|
|
|
|
return proto.pulumirpc.AboutResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.AboutResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.AboutResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setExecutable(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setVersion(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
var value = msg.getMetadataMap();
|
|
|
|
reader.readMessage(value, function(message, reader) {
|
|
|
|
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.AboutResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.AboutResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getExecutable();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getVersion();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getMetadataMap(true);
|
|
|
|
if (f && f.getLength() > 0) {
|
|
|
|
f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string executable = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.prototype.getExecutable = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.AboutResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.prototype.setExecutable = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string version = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.prototype.getVersion = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.AboutResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.prototype.setVersion = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* map<string, string> metadata = 3;
|
|
|
|
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
|
|
|
* empty, instead returning `undefined`
|
|
|
|
* @return {!jspb.Map<string,string>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.prototype.getMetadataMap = function(opt_noLazyCreate) {
|
|
|
|
return /** @type {!jspb.Map<string,string>} */ (
|
|
|
|
jspb.Message.getMapField(this, 3, opt_noLazyCreate,
|
|
|
|
null));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears values from the map. The map will be non-null.
|
|
|
|
* @return {!proto.pulumirpc.AboutResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.AboutResponse.prototype.clearMetadataMap = function() {
|
|
|
|
this.getMetadataMap().clear();
|
|
|
|
return this;};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GetProgramDependenciesRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GetProgramDependenciesRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
project: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
pwd: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
|
|
program: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
transitivedependencies: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
|
|
|
|
info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f)
|
2022-07-25 11:35:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GetProgramDependenciesRequest;
|
|
|
|
return proto.pulumirpc.GetProgramDependenciesRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GetProgramDependenciesRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setProject(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setPwd(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setProgram(value);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
var value = /** @type {boolean} */ (reader.readBool());
|
|
|
|
msg.setTransitivedependencies(value);
|
|
|
|
break;
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
case 5:
|
|
|
|
var value = new proto.pulumirpc.ProgramInfo;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader);
|
|
|
|
msg.setInfo(value);
|
|
|
|
break;
|
2022-07-25 11:35:16 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GetProgramDependenciesRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getProject();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getPwd();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getProgram();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getTransitivedependencies();
|
|
|
|
if (f) {
|
|
|
|
writer.writeBool(
|
|
|
|
4,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
f = message.getInfo();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
5,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.ProgramInfo.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
2022-07-25 11:35:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string project = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.getProject = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.setProject = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string pwd = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.getPwd = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.setPwd = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string program = 3;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.getProgram = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.setProgram = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 3, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bool transitiveDependencies = 4;
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.getTransitivedependencies = function() {
|
|
|
|
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {boolean} value
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.setTransitivedependencies = function(value) {
|
|
|
|
return jspb.Message.setProto3BooleanField(this, 4, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
/**
|
|
|
|
* optional ProgramInfo info = 5;
|
|
|
|
* @return {?proto.pulumirpc.ProgramInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.getInfo = function() {
|
|
|
|
return /** @type{?proto.pulumirpc.ProgramInfo} */ (
|
|
|
|
jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 5));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.pulumirpc.ProgramInfo|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.setInfo = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 5, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.clearInfo = function() {
|
|
|
|
return this.setInfo(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesRequest.prototype.hasInfo = function() {
|
|
|
|
return jspb.Message.getField(this, 5) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-07-25 11:35:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.DependencyInfo.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.DependencyInfo} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
version: jspb.Message.getFieldWithDefault(msg, 2, "")
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.DependencyInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.DependencyInfo;
|
|
|
|
return proto.pulumirpc.DependencyInfo.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.DependencyInfo} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.DependencyInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setName(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setVersion(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.DependencyInfo.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.DependencyInfo} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getName();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getVersion();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string name = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.prototype.getName = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.DependencyInfo} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.prototype.setName = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string version = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.prototype.getVersion = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.DependencyInfo} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.DependencyInfo.prototype.setVersion = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List of repeated fields within this message type.
|
|
|
|
* @private {!Array<number>}
|
|
|
|
* @const
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.repeatedFields_ = [1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GetProgramDependenciesResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GetProgramDependenciesResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
dependenciesList: jspb.Message.toObjectList(msg.getDependenciesList(),
|
|
|
|
proto.pulumirpc.DependencyInfo.toObject, includeInstance)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GetProgramDependenciesResponse;
|
|
|
|
return proto.pulumirpc.GetProgramDependenciesResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GetProgramDependenciesResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = new proto.pulumirpc.DependencyInfo;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.DependencyInfo.deserializeBinaryFromReader);
|
|
|
|
msg.addDependencies(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GetProgramDependenciesResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getDependenciesList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedMessage(
|
|
|
|
1,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.DependencyInfo.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated DependencyInfo dependencies = 1;
|
|
|
|
* @return {!Array<!proto.pulumirpc.DependencyInfo>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.prototype.getDependenciesList = function() {
|
|
|
|
return /** @type{!Array<!proto.pulumirpc.DependencyInfo>} */ (
|
|
|
|
jspb.Message.getRepeatedWrapperField(this, proto.pulumirpc.DependencyInfo, 1));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!Array<!proto.pulumirpc.DependencyInfo>} value
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.prototype.setDependenciesList = function(value) {
|
|
|
|
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!proto.pulumirpc.DependencyInfo=} opt_value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.DependencyInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.prototype.addDependencies = function(opt_value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.DependencyInfo, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.GetProgramDependenciesResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetProgramDependenciesResponse.prototype.clearDependenciesList = function() {
|
|
|
|
return this.setDependenciesList([]);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-06 17:57:32 +00:00
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
2020-02-28 11:53:47 +00:00
|
|
|
* Creates an object representation of this proto.
|
2018-02-06 17:57:32 +00:00
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
2020-02-28 11:53:47 +00:00
|
|
|
* Optional fields that are not set will be set to undefined.
|
2018-02-06 17:57:32 +00:00
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
2020-02-28 11:53:47 +00:00
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
2018-02-06 17:57:32 +00:00
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GetRequiredPluginsRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
2020-02-28 11:53:47 +00:00
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
2018-02-06 17:57:32 +00:00
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GetRequiredPluginsRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
project: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
pwd: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
program: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
|
|
info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f)
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GetRequiredPluginsRequest;
|
|
|
|
return proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GetRequiredPluginsRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setProject(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setPwd(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setProgram(value);
|
|
|
|
break;
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
case 4:
|
|
|
|
var value = new proto.pulumirpc.ProgramInfo;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader);
|
|
|
|
msg.setInfo(value);
|
|
|
|
break;
|
2018-02-06 17:57:32 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GetRequiredPluginsRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getProject();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getPwd();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getProgram();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
f = message.getInfo();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
4,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.ProgramInfo.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string project = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.getProject = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this
|
|
|
|
*/
|
2018-02-06 17:57:32 +00:00
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.setProject = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string pwd = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.getPwd = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this
|
|
|
|
*/
|
2018-02-06 17:57:32 +00:00
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.setPwd = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string program = 3;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.getProgram = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this
|
|
|
|
*/
|
2018-02-06 17:57:32 +00:00
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.setProgram = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 3, value);
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
/**
|
|
|
|
* optional ProgramInfo info = 4;
|
|
|
|
* @return {?proto.pulumirpc.ProgramInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.getInfo = function() {
|
|
|
|
return /** @type{?proto.pulumirpc.ProgramInfo} */ (
|
|
|
|
jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 4));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.pulumirpc.ProgramInfo|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.setInfo = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 4, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.clearInfo = function() {
|
|
|
|
return this.setInfo(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsRequest.prototype.hasInfo = function() {
|
|
|
|
return jspb.Message.getField(this, 4) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-02-06 17:57:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* List of repeated fields within this message type.
|
|
|
|
* @private {!Array<number>}
|
|
|
|
* @const
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.repeatedFields_ = [1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
2020-02-28 11:53:47 +00:00
|
|
|
* Creates an object representation of this proto.
|
2018-02-06 17:57:32 +00:00
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
2020-02-28 11:53:47 +00:00
|
|
|
* Optional fields that are not set will be set to undefined.
|
2018-02-06 17:57:32 +00:00
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
2020-02-28 11:53:47 +00:00
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
2018-02-06 17:57:32 +00:00
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GetRequiredPluginsResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
2020-02-28 11:53:47 +00:00
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
2018-02-06 17:57:32 +00:00
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GetRequiredPluginsResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
pluginsList: jspb.Message.toObjectList(msg.getPluginsList(),
|
2022-07-12 13:45:03 +00:00
|
|
|
pulumi_plugin_pb.PluginDependency.toObject, includeInstance)
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GetRequiredPluginsResponse;
|
|
|
|
return proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GetRequiredPluginsResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
2022-07-12 13:45:03 +00:00
|
|
|
var value = new pulumi_plugin_pb.PluginDependency;
|
|
|
|
reader.readMessage(value,pulumi_plugin_pb.PluginDependency.deserializeBinaryFromReader);
|
2018-02-06 17:57:32 +00:00
|
|
|
msg.addPlugins(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GetRequiredPluginsResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getPluginsList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedMessage(
|
|
|
|
1,
|
|
|
|
f,
|
2022-07-12 13:45:03 +00:00
|
|
|
pulumi_plugin_pb.PluginDependency.serializeBinaryToWriter
|
2018-02-06 17:57:32 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated PluginDependency plugins = 1;
|
2020-02-28 11:53:47 +00:00
|
|
|
* @return {!Array<!proto.pulumirpc.PluginDependency>}
|
2018-02-06 17:57:32 +00:00
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.prototype.getPluginsList = function() {
|
2020-02-28 11:53:47 +00:00
|
|
|
return /** @type{!Array<!proto.pulumirpc.PluginDependency>} */ (
|
2022-07-12 13:45:03 +00:00
|
|
|
jspb.Message.getRepeatedWrapperField(this, pulumi_plugin_pb.PluginDependency, 1));
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {!Array<!proto.pulumirpc.PluginDependency>} value
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsResponse} returns this
|
|
|
|
*/
|
2018-02-06 17:57:32 +00:00
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.prototype.setPluginsList = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!proto.pulumirpc.PluginDependency=} opt_value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.PluginDependency}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.prototype.addPlugins = function(opt_value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.PluginDependency, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.GetRequiredPluginsResponse} returns this
|
|
|
|
*/
|
2018-02-06 17:57:32 +00:00
|
|
|
proto.pulumirpc.GetRequiredPluginsResponse.prototype.clearPluginsList = function() {
|
2020-02-28 11:53:47 +00:00
|
|
|
return this.setPluginsList([]);
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-17 02:21:41 +00:00
|
|
|
/**
|
|
|
|
* List of repeated fields within this message type.
|
|
|
|
* @private {!Array<number>}
|
|
|
|
* @const
|
|
|
|
*/
|
2021-05-18 16:48:08 +00:00
|
|
|
proto.pulumirpc.RunRequest.repeatedFields_ = [5,11];
|
2017-11-17 02:21:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
2020-02-28 11:53:47 +00:00
|
|
|
* Creates an object representation of this proto.
|
2017-11-17 02:21:41 +00:00
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
2020-02-28 11:53:47 +00:00
|
|
|
* Optional fields that are not set will be set to undefined.
|
2017-11-17 02:21:41 +00:00
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
2020-02-28 11:53:47 +00:00
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
2017-11-17 02:21:41 +00:00
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.RunRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
2020-02-28 11:53:47 +00:00
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
2017-11-17 02:21:41 +00:00
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.RunRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
project: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
stack: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
|
|
pwd: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
|
|
program: jspb.Message.getFieldWithDefault(msg, 4, ""),
|
2020-02-28 11:53:47 +00:00
|
|
|
argsList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f,
|
2017-11-17 02:21:41 +00:00
|
|
|
configMap: (f = msg.getConfigMap()) ? f.toObject(includeInstance, undefined) : [],
|
2020-02-28 11:53:47 +00:00
|
|
|
dryrun: jspb.Message.getBooleanFieldWithDefault(msg, 7, false),
|
2018-02-06 17:57:32 +00:00
|
|
|
parallel: jspb.Message.getFieldWithDefault(msg, 8, 0),
|
2019-05-01 01:09:02 +00:00
|
|
|
monitorAddress: jspb.Message.getFieldWithDefault(msg, 9, ""),
|
2021-05-18 16:48:08 +00:00
|
|
|
querymode: jspb.Message.getBooleanFieldWithDefault(msg, 10, false),
|
2022-08-31 09:33:29 +00:00
|
|
|
configsecretkeysList: (f = jspb.Message.getRepeatedField(msg, 11)) == null ? undefined : f,
|
2023-10-20 10:44:16 +00:00
|
|
|
organization: jspb.Message.getFieldWithDefault(msg, 12, ""),
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
configpropertymap: (f = msg.getConfigpropertymap()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
|
|
|
|
info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f)
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.RunRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.RunRequest;
|
|
|
|
return proto.pulumirpc.RunRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.RunRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.RunRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setProject(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setStack(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setPwd(value);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setProgram(value);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.addArgs(value);
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
var value = msg.getConfigMap();
|
|
|
|
reader.readMessage(value, function(message, reader) {
|
2020-02-28 11:53:47 +00:00
|
|
|
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
|
2017-11-17 02:21:41 +00:00
|
|
|
});
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
var value = /** @type {boolean} */ (reader.readBool());
|
|
|
|
msg.setDryrun(value);
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
var value = /** @type {number} */ (reader.readInt32());
|
|
|
|
msg.setParallel(value);
|
|
|
|
break;
|
2018-02-06 17:57:32 +00:00
|
|
|
case 9:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setMonitorAddress(value);
|
|
|
|
break;
|
2019-05-01 01:09:02 +00:00
|
|
|
case 10:
|
|
|
|
var value = /** @type {boolean} */ (reader.readBool());
|
|
|
|
msg.setQuerymode(value);
|
|
|
|
break;
|
2021-05-18 16:48:08 +00:00
|
|
|
case 11:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.addConfigsecretkeys(value);
|
|
|
|
break;
|
2022-08-31 09:33:29 +00:00
|
|
|
case 12:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setOrganization(value);
|
|
|
|
break;
|
2023-10-20 10:44:16 +00:00
|
|
|
case 13:
|
|
|
|
var value = new google_protobuf_struct_pb.Struct;
|
|
|
|
reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
|
|
|
|
msg.setConfigpropertymap(value);
|
|
|
|
break;
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
case 14:
|
|
|
|
var value = new proto.pulumirpc.ProgramInfo;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader);
|
|
|
|
msg.setInfo(value);
|
|
|
|
break;
|
2017-11-17 02:21:41 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.RunRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.RunRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getProject();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getStack();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getPwd();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getProgram();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
4,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getArgsList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedString(
|
|
|
|
5,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getConfigMap(true);
|
|
|
|
if (f && f.getLength() > 0) {
|
|
|
|
f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
|
|
|
|
}
|
|
|
|
f = message.getDryrun();
|
|
|
|
if (f) {
|
|
|
|
writer.writeBool(
|
|
|
|
7,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getParallel();
|
|
|
|
if (f !== 0) {
|
|
|
|
writer.writeInt32(
|
|
|
|
8,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2018-02-06 17:57:32 +00:00
|
|
|
f = message.getMonitorAddress();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
9,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2019-05-01 01:09:02 +00:00
|
|
|
f = message.getQuerymode();
|
|
|
|
if (f) {
|
|
|
|
writer.writeBool(
|
|
|
|
10,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2021-05-18 16:48:08 +00:00
|
|
|
f = message.getConfigsecretkeysList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedString(
|
|
|
|
11,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2022-08-31 09:33:29 +00:00
|
|
|
f = message.getOrganization();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
12,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2023-10-20 10:44:16 +00:00
|
|
|
f = message.getConfigpropertymap();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
13,
|
|
|
|
f,
|
|
|
|
google_protobuf_struct_pb.Struct.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
f = message.getInfo();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
14,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.ProgramInfo.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string project = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getProject = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.setProject = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string stack = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getStack = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.setStack = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string pwd = 3;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getPwd = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.setPwd = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 3, value);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string program = 4;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getProgram = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.setProgram = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 4, value);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated string args = 5;
|
2020-02-28 11:53:47 +00:00
|
|
|
* @return {!Array<string>}
|
2017-11-17 02:21:41 +00:00
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getArgsList = function() {
|
2020-02-28 11:53:47 +00:00
|
|
|
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 5));
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {!Array<string>} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.setArgsList = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setField(this, 5, value || []);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2020-02-28 11:53:47 +00:00
|
|
|
* @param {string} value
|
2017-11-17 02:21:41 +00:00
|
|
|
* @param {number=} opt_index
|
2020-02-28 11:53:47 +00:00
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
2017-11-17 02:21:41 +00:00
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.addArgs = function(value, opt_index) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.addToRepeatedField(this, 5, value, opt_index);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.clearArgsList = function() {
|
2020-02-28 11:53:47 +00:00
|
|
|
return this.setArgsList([]);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* map<string, string> config = 6;
|
|
|
|
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
|
|
|
* empty, instead returning `undefined`
|
|
|
|
* @return {!jspb.Map<string,string>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getConfigMap = function(opt_noLazyCreate) {
|
|
|
|
return /** @type {!jspb.Map<string,string>} */ (
|
|
|
|
jspb.Message.getMapField(this, 6, opt_noLazyCreate,
|
|
|
|
null));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* Clears values from the map. The map will be non-null.
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.clearConfigMap = function() {
|
|
|
|
this.getConfigMap().clear();
|
2020-02-28 11:53:47 +00:00
|
|
|
return this;};
|
2017-11-17 02:21:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bool dryRun = 7;
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getDryrun = function() {
|
2020-02-28 11:53:47 +00:00
|
|
|
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false));
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {boolean} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.setDryrun = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3BooleanField(this, 7, value);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional int32 parallel = 8;
|
|
|
|
* @return {number}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getParallel = function() {
|
|
|
|
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {number} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.setParallel = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3IntField(this, 8, value);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-02-06 17:57:32 +00:00
|
|
|
/**
|
|
|
|
* optional string monitor_address = 9;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getMonitorAddress = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2018-02-06 17:57:32 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.setMonitorAddress = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 9, value);
|
2018-02-06 17:57:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-05-01 01:09:02 +00:00
|
|
|
/**
|
|
|
|
* optional bool queryMode = 10;
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getQuerymode = function() {
|
2020-02-28 11:53:47 +00:00
|
|
|
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false));
|
2019-05-01 01:09:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {boolean} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
2019-05-01 01:09:02 +00:00
|
|
|
proto.pulumirpc.RunRequest.prototype.setQuerymode = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3BooleanField(this, 10, value);
|
2019-05-01 01:09:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-05-18 16:48:08 +00:00
|
|
|
/**
|
|
|
|
* repeated string configSecretKeys = 11;
|
|
|
|
* @return {!Array<string>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getConfigsecretkeysList = function() {
|
|
|
|
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 11));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!Array<string>} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.setConfigsecretkeysList = function(value) {
|
|
|
|
return jspb.Message.setField(this, 11, value || []);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.addConfigsecretkeys = function(value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedField(this, 11, value, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.clearConfigsecretkeysList = function() {
|
|
|
|
return this.setConfigsecretkeysList([]);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-08-31 09:33:29 +00:00
|
|
|
/**
|
|
|
|
* optional string organization = 12;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getOrganization = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.setOrganization = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 12, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-10-20 10:44:16 +00:00
|
|
|
/**
|
|
|
|
* optional google.protobuf.Struct configPropertyMap = 13;
|
|
|
|
* @return {?proto.google.protobuf.Struct}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getConfigpropertymap = function() {
|
|
|
|
return /** @type{?proto.google.protobuf.Struct} */ (
|
|
|
|
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 13));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.google.protobuf.Struct|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.setConfigpropertymap = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 13, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.clearConfigpropertymap = function() {
|
|
|
|
return this.setConfigpropertymap(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.hasConfigpropertymap = function() {
|
|
|
|
return jspb.Message.getField(this, 13) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
/**
|
|
|
|
* optional ProgramInfo info = 14;
|
|
|
|
* @return {?proto.pulumirpc.ProgramInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.getInfo = function() {
|
|
|
|
return /** @type{?proto.pulumirpc.ProgramInfo} */ (
|
|
|
|
jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 14));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.pulumirpc.ProgramInfo|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.setInfo = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 14, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.RunRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.clearInfo = function() {
|
|
|
|
return this.setInfo(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunRequest.prototype.hasInfo = function() {
|
|
|
|
return jspb.Message.getField(this, 14) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-11-17 02:21:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
2020-02-28 11:53:47 +00:00
|
|
|
* Creates an object representation of this proto.
|
2017-11-17 02:21:41 +00:00
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
2020-02-28 11:53:47 +00:00
|
|
|
* Optional fields that are not set will be set to undefined.
|
2017-11-17 02:21:41 +00:00
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
2020-02-28 11:53:47 +00:00
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
2017-11-17 02:21:41 +00:00
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.RunResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
2020-02-28 11:53:47 +00:00
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
2017-11-17 02:21:41 +00:00
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.RunResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
2019-03-20 18:54:32 +00:00
|
|
|
error: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
2020-02-28 11:53:47 +00:00
|
|
|
bail: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.RunResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.RunResponse;
|
|
|
|
return proto.pulumirpc.RunResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.RunResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.RunResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setError(value);
|
|
|
|
break;
|
2019-03-20 18:54:32 +00:00
|
|
|
case 2:
|
|
|
|
var value = /** @type {boolean} */ (reader.readBool());
|
|
|
|
msg.setBail(value);
|
|
|
|
break;
|
2017-11-17 02:21:41 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.RunResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.RunResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getError();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2019-03-20 18:54:32 +00:00
|
|
|
f = message.getBail();
|
|
|
|
if (f) {
|
|
|
|
writer.writeBool(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string error = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse.prototype.getError = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RunResponse} returns this
|
|
|
|
*/
|
2017-11-17 02:21:41 +00:00
|
|
|
proto.pulumirpc.RunResponse.prototype.setError = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
2017-11-17 02:21:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-03-20 18:54:32 +00:00
|
|
|
/**
|
|
|
|
* optional bool bail = 2;
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunResponse.prototype.getBail = function() {
|
2020-02-28 11:53:47 +00:00
|
|
|
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
|
2019-03-20 18:54:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-28 11:53:47 +00:00
|
|
|
/**
|
|
|
|
* @param {boolean} value
|
|
|
|
* @return {!proto.pulumirpc.RunResponse} returns this
|
|
|
|
*/
|
2019-03-20 18:54:32 +00:00
|
|
|
proto.pulumirpc.RunResponse.prototype.setBail = function(value) {
|
2020-02-28 11:53:47 +00:00
|
|
|
return jspb.Message.setProto3BooleanField(this, 2, value);
|
2019-03-20 18:54:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-04-03 14:54:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.InstallDependenciesRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.InstallDependenciesRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
directory: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
isTerminal: jspb.Message.getBooleanFieldWithDefault(msg, 2, false),
|
|
|
|
info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f)
|
2022-04-03 14:54:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.InstallDependenciesRequest;
|
|
|
|
return proto.pulumirpc.InstallDependenciesRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.InstallDependenciesRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setDirectory(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {boolean} */ (reader.readBool());
|
|
|
|
msg.setIsTerminal(value);
|
|
|
|
break;
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
case 3:
|
|
|
|
var value = new proto.pulumirpc.ProgramInfo;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader);
|
|
|
|
msg.setInfo(value);
|
|
|
|
break;
|
2022-04-03 14:54:59 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.InstallDependenciesRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getDirectory();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getIsTerminal();
|
|
|
|
if (f) {
|
|
|
|
writer.writeBool(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
f = message.getInfo();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
3,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.ProgramInfo.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
2022-04-03 14:54:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string directory = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.getDirectory = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.setDirectory = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bool is_terminal = 2;
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.getIsTerminal = function() {
|
|
|
|
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {boolean} value
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.setIsTerminal = function(value) {
|
|
|
|
return jspb.Message.setProto3BooleanField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
/**
|
|
|
|
* optional ProgramInfo info = 3;
|
|
|
|
* @return {?proto.pulumirpc.ProgramInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.getInfo = function() {
|
|
|
|
return /** @type{?proto.pulumirpc.ProgramInfo} */ (
|
|
|
|
jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 3));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.pulumirpc.ProgramInfo|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.setInfo = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 3, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.clearInfo = function() {
|
|
|
|
return this.setInfo(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesRequest.prototype.hasInfo = function() {
|
|
|
|
return jspb.Message.getField(this, 3) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-04-03 14:54:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.InstallDependenciesResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.InstallDependenciesResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
stdout: msg.getStdout_asB64(),
|
|
|
|
stderr: msg.getStderr_asB64()
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.InstallDependenciesResponse;
|
|
|
|
return proto.pulumirpc.InstallDependenciesResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.InstallDependenciesResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
|
|
|
msg.setStdout(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
|
|
|
msg.setStderr(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.InstallDependenciesResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getStdout_asU8();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeBytes(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getStderr_asU8();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeBytes(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stdout = 1;
|
|
|
|
* @return {!(string|Uint8Array)}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout = function() {
|
|
|
|
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stdout = 1;
|
|
|
|
* This is a type-conversion wrapper around `getStdout()`
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout_asB64 = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
|
|
|
this.getStdout()));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stdout = 1;
|
|
|
|
* Note that Uint8Array is not supported on all browsers.
|
|
|
|
* @see http://caniuse.com/Uint8Array
|
|
|
|
* This is a type-conversion wrapper around `getStdout()`
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.getStdout_asU8 = function() {
|
|
|
|
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
|
|
|
this.getStdout()));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!(string|Uint8Array)} value
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.setStdout = function(value) {
|
|
|
|
return jspb.Message.setProto3BytesField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stderr = 2;
|
|
|
|
* @return {!(string|Uint8Array)}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr = function() {
|
|
|
|
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stderr = 2;
|
|
|
|
* This is a type-conversion wrapper around `getStderr()`
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr_asB64 = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
|
|
|
this.getStderr()));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stderr = 2;
|
|
|
|
* Note that Uint8Array is not supported on all browsers.
|
|
|
|
* @see http://caniuse.com/Uint8Array
|
|
|
|
* This is a type-conversion wrapper around `getStderr()`
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.getStderr_asU8 = function() {
|
|
|
|
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
|
|
|
this.getStderr()));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!(string|Uint8Array)} value
|
|
|
|
* @return {!proto.pulumirpc.InstallDependenciesResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.InstallDependenciesResponse.prototype.setStderr = function(value) {
|
|
|
|
return jspb.Message.setProto3BytesField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-10-04 08:58:01 +00:00
|
|
|
|
2024-06-17 17:10:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.RuntimeOptionsRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionsRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionsRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.RuntimeOptionsRequest;
|
|
|
|
return proto.pulumirpc.RuntimeOptionsRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionsRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionsRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = new proto.pulumirpc.ProgramInfo;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader);
|
|
|
|
msg.setInfo(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionsRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getInfo();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
1,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.ProgramInfo.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional ProgramInfo info = 1;
|
|
|
|
* @return {?proto.pulumirpc.ProgramInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.prototype.getInfo = function() {
|
|
|
|
return /** @type{?proto.pulumirpc.ProgramInfo} */ (
|
|
|
|
jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 1));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.pulumirpc.ProgramInfo|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionsRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.prototype.setInfo = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionsRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.prototype.clearInfo = function() {
|
|
|
|
return this.setInfo(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsRequest.prototype.hasInfo = function() {
|
|
|
|
return jspb.Message.getField(this, 1) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List of repeated fields within this message type.
|
|
|
|
* @private {!Array<number>}
|
|
|
|
* @const
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.repeatedFields_ = [4];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.RuntimeOptionPrompt.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
key: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
description: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
|
|
prompttype: jspb.Message.getFieldWithDefault(msg, 3, 0),
|
|
|
|
choicesList: jspb.Message.toObjectList(msg.getChoicesList(),
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.toObject, includeInstance),
|
|
|
|
pb_default: (f = msg.getDefault()) && proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.toObject(includeInstance, f)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.RuntimeOptionPrompt;
|
|
|
|
return proto.pulumirpc.RuntimeOptionPrompt.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setKey(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setDescription(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
var value = /** @type {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType} */ (reader.readEnum());
|
|
|
|
msg.setPrompttype(value);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
var value = new proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.deserializeBinaryFromReader);
|
|
|
|
msg.addChoices(value);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
var value = new proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.deserializeBinaryFromReader);
|
|
|
|
msg.setDefault(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getKey();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getDescription();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getPrompttype();
|
|
|
|
if (f !== 0.0) {
|
|
|
|
writer.writeEnum(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getChoicesList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedMessage(
|
|
|
|
4,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getDefault();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
5,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @enum {number}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType = {
|
|
|
|
STRING: 0,
|
|
|
|
INT32: 1
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
prompttype: jspb.Message.getFieldWithDefault(msg, 1, 0),
|
|
|
|
stringvalue: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
2024-06-28 23:21:55 +00:00
|
|
|
int32value: jspb.Message.getFieldWithDefault(msg, 3, 0),
|
|
|
|
displayname: jspb.Message.getFieldWithDefault(msg, 4, "")
|
2024-06-17 17:10:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue;
|
|
|
|
return proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType} */ (reader.readEnum());
|
|
|
|
msg.setPrompttype(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setStringvalue(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
var value = /** @type {number} */ (reader.readInt32());
|
|
|
|
msg.setInt32value(value);
|
|
|
|
break;
|
2024-06-28 23:21:55 +00:00
|
|
|
case 4:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setDisplayname(value);
|
|
|
|
break;
|
2024-06-17 17:10:55 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getPrompttype();
|
|
|
|
if (f !== 0.0) {
|
|
|
|
writer.writeEnum(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getStringvalue();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getInt32value();
|
|
|
|
if (f !== 0) {
|
|
|
|
writer.writeInt32(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2024-06-28 23:21:55 +00:00
|
|
|
f = message.getDisplayname();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
4,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2024-06-17 17:10:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional RuntimeOptionType promptType = 1;
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.getPrompttype = function() {
|
|
|
|
return /** @type {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.setPrompttype = function(value) {
|
|
|
|
return jspb.Message.setProto3EnumField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string stringValue = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.getStringvalue = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.setStringvalue = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional int32 int32Value = 3;
|
|
|
|
* @return {number}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.getInt32value = function() {
|
|
|
|
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {number} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.setInt32value = function(value) {
|
|
|
|
return jspb.Message.setProto3IntField(this, 3, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2024-06-28 23:21:55 +00:00
|
|
|
/**
|
|
|
|
* optional string displayName = 4;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.getDisplayname = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue.prototype.setDisplayname = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 4, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2024-06-17 17:10:55 +00:00
|
|
|
/**
|
|
|
|
* optional string key = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.getKey = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.setKey = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string description = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.getDescription = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.setDescription = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional RuntimeOptionType promptType = 3;
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.getPrompttype = function() {
|
|
|
|
return /** @type {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionType} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.setPrompttype = function(value) {
|
|
|
|
return jspb.Message.setProto3EnumField(this, 3, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated RuntimeOptionValue choices = 4;
|
|
|
|
* @return {!Array<!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.getChoicesList = function() {
|
|
|
|
return /** @type{!Array<!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue>} */ (
|
|
|
|
jspb.Message.getRepeatedWrapperField(this, proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue, 4));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!Array<!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue>} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.setChoicesList = function(value) {
|
|
|
|
return jspb.Message.setRepeatedWrapperField(this, 4, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue=} opt_value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.addChoices = function(opt_value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.clearChoicesList = function() {
|
|
|
|
return this.setChoicesList([]);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional RuntimeOptionValue default = 5;
|
|
|
|
* @return {?proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.getDefault = function() {
|
|
|
|
return /** @type{?proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue} */ (
|
|
|
|
jspb.Message.getWrapperField(this, proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue, 5));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.pulumirpc.RuntimeOptionPrompt.RuntimeOptionValue|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.setDefault = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 5, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.clearDefault = function() {
|
|
|
|
return this.setDefault(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.prototype.hasDefault = function() {
|
|
|
|
return jspb.Message.getField(this, 5) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List of repeated fields within this message type.
|
|
|
|
* @private {!Array<number>}
|
|
|
|
* @const
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.repeatedFields_ = [1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.RuntimeOptionsResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionsResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
promptsList: jspb.Message.toObjectList(msg.getPromptsList(),
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.toObject, includeInstance)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionsResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.RuntimeOptionsResponse;
|
|
|
|
return proto.pulumirpc.RuntimeOptionsResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionsResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionsResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = new proto.pulumirpc.RuntimeOptionPrompt;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.RuntimeOptionPrompt.deserializeBinaryFromReader);
|
|
|
|
msg.addPrompts(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionsResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getPromptsList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedMessage(
|
|
|
|
1,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.RuntimeOptionPrompt.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated RuntimeOptionPrompt prompts = 1;
|
|
|
|
* @return {!Array<!proto.pulumirpc.RuntimeOptionPrompt>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.prototype.getPromptsList = function() {
|
|
|
|
return /** @type{!Array<!proto.pulumirpc.RuntimeOptionPrompt>} */ (
|
|
|
|
jspb.Message.getRepeatedWrapperField(this, proto.pulumirpc.RuntimeOptionPrompt, 1));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!Array<!proto.pulumirpc.RuntimeOptionPrompt>} value
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionsResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.prototype.setPromptsList = function(value) {
|
|
|
|
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!proto.pulumirpc.RuntimeOptionPrompt=} opt_value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionPrompt}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.prototype.addPrompts = function(opt_value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.RuntimeOptionPrompt, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.RuntimeOptionsResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RuntimeOptionsResponse.prototype.clearPromptsList = function() {
|
|
|
|
return this.setPromptsList([]);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-04 08:58:01 +00:00
|
|
|
/**
|
|
|
|
* List of repeated fields within this message type.
|
|
|
|
* @private {!Array<number>}
|
|
|
|
* @const
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.repeatedFields_ = [3,4];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.RunPluginRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.RunPluginRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
pwd: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
program: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
|
|
argsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
envList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f,
|
|
|
|
info: (f = msg.getInfo()) && proto.pulumirpc.ProgramInfo.toObject(includeInstance, f)
|
2022-10-04 08:58:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.RunPluginRequest;
|
|
|
|
return proto.pulumirpc.RunPluginRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.RunPluginRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setPwd(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setProgram(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.addArgs(value);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.addEnv(value);
|
|
|
|
break;
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
case 5:
|
|
|
|
var value = new proto.pulumirpc.ProgramInfo;
|
|
|
|
reader.readMessage(value,proto.pulumirpc.ProgramInfo.deserializeBinaryFromReader);
|
|
|
|
msg.setInfo(value);
|
|
|
|
break;
|
2022-10-04 08:58:01 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.RunPluginRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.RunPluginRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getPwd();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getProgram();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getArgsList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedString(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getEnvList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedString(
|
|
|
|
4,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
f = message.getInfo();
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeMessage(
|
|
|
|
5,
|
|
|
|
f,
|
|
|
|
proto.pulumirpc.ProgramInfo.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
2022-10-04 08:58:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string pwd = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.getPwd = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.setPwd = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string program = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.getProgram = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.setProgram = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated string args = 3;
|
|
|
|
* @return {!Array<string>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.getArgsList = function() {
|
|
|
|
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!Array<string>} value
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.setArgsList = function(value) {
|
|
|
|
return jspb.Message.setField(this, 3, value || []);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.addArgs = function(value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedField(this, 3, value, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.clearArgsList = function() {
|
|
|
|
return this.setArgsList([]);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated string env = 4;
|
|
|
|
* @return {!Array<string>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.getEnvList = function() {
|
|
|
|
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 4));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!Array<string>} value
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.setEnvList = function(value) {
|
|
|
|
return jspb.Message.setField(this, 4, value || []);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.addEnv = function(value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedField(this, 4, value, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.clearEnvList = function() {
|
|
|
|
return this.setEnvList([]);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Pass root and main info to language host methods (#14654)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This is two changes rolled together in a way.
Firstly passing some of the data that we pass on language runtime
startup to also pass it to Run/GetRequiredPlugins/etc. This is needed
for matrix testing, as we only get to start the language runtime up once
for that but want to execute multiple programs with it.
I feel it's also a little more consistent as we use the language
runtimes in other contexts (codegen) where there isn't really a root
directory, and aren't any options (and if we did do options the options
for codegen are not going to be the same as for execution). It also
means we can reuse a language host for shimless and substack programs,
as before they heavily relied on their current working directory to
calculate paths, and obviosly could only take one set of options at
startup. Imagine a shimless python package + a python root program, that
would have needed two startups of the python language host to deal with,
this unblocks it so we can make the engine smarter and only use one.
Secondly renaming some of the fields we pass to
Run/GetRequiredPlugins/etc today. `Pwd` and `Program` were not very
descriptive and had pretty non-obvious documentation:
```
string pwd = 3; // the program's working directory.
string program = 4; // the path to the program to execute.
```
`pwd` will remain, although probably rename it to `working_directory` at
some point, because while today we always start programs up with the
working directory equal to the program directory that definitely is
going to change in the future (at least for MLCs and substack programs).
But the name `pwd` doesn't make it clear that this was intended to be
the working directory _and_ the directory which contains the program.
`program` was in fact nearly always ".", and if it wasn't that it was
just a filename. The engine never sent a path for `program` (although we
did have some unit tests to check how that worked for the nodejs and
python hosts).
These are now replaced by a new structure with (I think) more clearly
named and documented fields (see ProgramInfo in langauge.proto).
The engine still sends the old data for now, we need to update
dotnet/yaml/java before we break the old interface and give Virtus Labs
a chance to update [besom](https://github.com/VirtusLab/besom).
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [ ] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-12-10 17:30:51 +00:00
|
|
|
/**
|
|
|
|
* optional ProgramInfo info = 5;
|
|
|
|
* @return {?proto.pulumirpc.ProgramInfo}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.getInfo = function() {
|
|
|
|
return /** @type{?proto.pulumirpc.ProgramInfo} */ (
|
|
|
|
jspb.Message.getWrapperField(this, proto.pulumirpc.ProgramInfo, 5));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {?proto.pulumirpc.ProgramInfo|undefined} value
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.setInfo = function(value) {
|
|
|
|
return jspb.Message.setWrapperField(this, 5, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the message field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.clearInfo = function() {
|
|
|
|
return this.setInfo(undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginRequest.prototype.hasInfo = function() {
|
|
|
|
return jspb.Message.getField(this, 5) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-10-04 08:58:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Oneof group definitions for this message. Each group defines the field
|
|
|
|
* numbers belonging to that group. When of these fields' value is set, all
|
|
|
|
* other fields in the group are cleared. During deserialization, if multiple
|
|
|
|
* fields are encountered for a group, only the last value seen will be kept.
|
|
|
|
* @private {!Array<!Array<number>>}
|
|
|
|
* @const
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.oneofGroups_ = [[1,2,3]];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @enum {number}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.OutputCase = {
|
|
|
|
OUTPUT_NOT_SET: 0,
|
|
|
|
STDOUT: 1,
|
|
|
|
STDERR: 2,
|
|
|
|
EXITCODE: 3
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return {proto.pulumirpc.RunPluginResponse.OutputCase}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.getOutputCase = function() {
|
|
|
|
return /** @type {proto.pulumirpc.RunPluginResponse.OutputCase} */(jspb.Message.computeOneofCase(this, proto.pulumirpc.RunPluginResponse.oneofGroups_[0]));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.RunPluginResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.RunPluginResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
stdout: msg.getStdout_asB64(),
|
|
|
|
stderr: msg.getStderr_asB64(),
|
|
|
|
exitcode: jspb.Message.getFieldWithDefault(msg, 3, 0)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.RunPluginResponse;
|
|
|
|
return proto.pulumirpc.RunPluginResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.RunPluginResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
|
|
|
msg.setStdout(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
|
|
|
msg.setStderr(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
var value = /** @type {number} */ (reader.readInt32());
|
|
|
|
msg.setExitcode(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.RunPluginResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.RunPluginResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1));
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeBytes(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2));
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeBytes(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = /** @type {number} */ (jspb.Message.getField(message, 3));
|
|
|
|
if (f != null) {
|
|
|
|
writer.writeInt32(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stdout = 1;
|
|
|
|
* @return {!(string|Uint8Array)}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.getStdout = function() {
|
|
|
|
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stdout = 1;
|
|
|
|
* This is a type-conversion wrapper around `getStdout()`
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.getStdout_asB64 = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
|
|
|
this.getStdout()));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stdout = 1;
|
|
|
|
* Note that Uint8Array is not supported on all browsers.
|
|
|
|
* @see http://caniuse.com/Uint8Array
|
|
|
|
* This is a type-conversion wrapper around `getStdout()`
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.getStdout_asU8 = function() {
|
|
|
|
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
|
|
|
this.getStdout()));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!(string|Uint8Array)} value
|
|
|
|
* @return {!proto.pulumirpc.RunPluginResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.setStdout = function(value) {
|
|
|
|
return jspb.Message.setOneofField(this, 1, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.clearStdout = function() {
|
|
|
|
return jspb.Message.setOneofField(this, 1, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.hasStdout = function() {
|
|
|
|
return jspb.Message.getField(this, 1) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stderr = 2;
|
|
|
|
* @return {!(string|Uint8Array)}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.getStderr = function() {
|
|
|
|
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stderr = 2;
|
|
|
|
* This is a type-conversion wrapper around `getStderr()`
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.getStderr_asB64 = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
|
|
|
this.getStderr()));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional bytes stderr = 2;
|
|
|
|
* Note that Uint8Array is not supported on all browsers.
|
|
|
|
* @see http://caniuse.com/Uint8Array
|
|
|
|
* This is a type-conversion wrapper around `getStderr()`
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.getStderr_asU8 = function() {
|
|
|
|
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
|
|
|
this.getStderr()));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!(string|Uint8Array)} value
|
|
|
|
* @return {!proto.pulumirpc.RunPluginResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.setStderr = function(value) {
|
|
|
|
return jspb.Message.setOneofField(this, 2, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.clearStderr = function() {
|
|
|
|
return jspb.Message.setOneofField(this, 2, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.hasStderr = function() {
|
|
|
|
return jspb.Message.getField(this, 2) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional int32 exitcode = 3;
|
|
|
|
* @return {number}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.getExitcode = function() {
|
|
|
|
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {number} value
|
|
|
|
* @return {!proto.pulumirpc.RunPluginResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.setExitcode = function(value) {
|
|
|
|
return jspb.Message.setOneofField(this, 3, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the field making it undefined.
|
|
|
|
* @return {!proto.pulumirpc.RunPluginResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.clearExitcode = function() {
|
|
|
|
return jspb.Message.setOneofField(this, 3, proto.pulumirpc.RunPluginResponse.oneofGroups_[0], undefined);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this field is set.
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.RunPluginResponse.prototype.hasExitcode = function() {
|
|
|
|
return jspb.Message.getField(this, 3) != null;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-10-17 14:21:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GenerateProgramRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GenerateProgramRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
2023-07-27 09:27:07 +00:00
|
|
|
sourceMap: (f = msg.getSourceMap()) ? f.toObject(includeInstance, undefined) : [],
|
[cli/import] Fix undefined variable errors in code generation when imported resources use a parent or provider (#16786)
Fixes #15410 Fixes #13339
## Problem Context
When using `pulumi import` we generate code snippets for the resources
that were imported. Sometimes the user specifies `--parent
parentName=URN` or `--provider providerName=URN` which tweak the parent
or provider that the imported resources uses. When using `--parent` or
`--provider` the generated code emits a resource option `parent =
parentName` (in case of using `--parent`) where `parentName` is an
unbound variable.
Usually unbound variables would result in a _bind_ error such as `error:
undefined variable parentName` when type-checking the program however in
the import code generation we specify the bind option
`pcl.AllowMissingVariables` which turns that unbound variable errors
into warnings and code generation can continue to emit code.
This is all good and works as expected. However in the issues linked
above, we do get an _error_ for unbound variables in generated code even
though we specified `AllowMissingVariables`.
The problem as it turns out is when we are trying to generate code via
dynamically loaded `LangaugeRuntime` plugins. Specifically for NodeJS
and Python, we load `pulumi-language-nodejs` or `pulumi-language-python`
and call `GenerateProgram` to get the generated program. That function
`GenerateProgram` takes the text _SOURCE_ of the a bound program (one
that was bound using option `AllowMissingVariables`) and re-binds again
inside the implementation of the language plugin. The second time we
bind the program, we don't pass it the option `AllowMissingVariables`
and so it fails with `unboud variable` error.
I've verified that the issue above don't repro when doing an import for
dotnet (probably same for java/yaml) because we use the statically
linked function `codegen/{lang}/gen_program.go -> GenerateProgram`
## Solution
The problem can be solved by propagating the bind options from the CLI
to the language hosts during import so that they know how to bind the
program. I've extended the gRPC interface in `GenerateProgramRequest`
with a property `Strict` which follows the same logic from `pulumi
convert --strict` and made it such that the import command sends
`strict=false` to the language plugins when doing `GenerateProgram`.
This is consistent with `GenerateProject` that uses the same flag. When
`strict=false` we use `pcl.NonStrictBindOptions()` which includes
`AllowMissingVariables` .
## Repro
Once can test the before and after behaviour by running `pulumi up
--yes` on the following TypeScript program:
```ts
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
export class MyComponent extends pulumi.ComponentResource {
public readonly randomPetId: pulumi.Output<string>;
constructor(name: string, opts?: pulumi.ComponentResourceOptions) {
super("example:index:MyComponent", name, {}, opts);
const randomPet = new random.RandomPet("randomPet", {}, {
parent: this
});
this.randomPetId = randomPet.id;
this.registerOutputs({
randomPetId: randomPet.id,
});
}
}
const example = new MyComponent("example");
export const randomPetId = example.randomPetId;
```
Then running `pulumi import -f import.json` where `import.json` contains
a resource to be imported under the created component (stack=`dev`,
project=`importerrors`)
```ts
{
"nameTable": {
"parentComponent": "urn:pulumi:dev::importerrors::example:index:MyComponent::example"
},
"resources": [
{
"type": "random:index/randomPassword:RandomPassword",
"name": "randomPassword",
"id": "supersecret",
"parent": "parentComponent"
}
]
}
```
Running this locally I get the following generated code (which
previously failed to generate)
```ts
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
const randomPassword = new random.RandomPassword("randomPassword", {
length: 11,
lower: true,
number: true,
numeric: true,
special: true,
upper: true,
}, {
parent: parentComponent,
});
```
2024-07-25 13:53:44 +00:00
|
|
|
loaderTarget: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
|
|
strict: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GenerateProgramRequest;
|
|
|
|
return proto.pulumirpc.GenerateProgramRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GenerateProgramRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = msg.getSourceMap();
|
|
|
|
reader.readMessage(value, function(message, reader) {
|
|
|
|
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
|
|
|
|
});
|
|
|
|
break;
|
2023-07-27 09:27:07 +00:00
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setLoaderTarget(value);
|
|
|
|
break;
|
[cli/import] Fix undefined variable errors in code generation when imported resources use a parent or provider (#16786)
Fixes #15410 Fixes #13339
## Problem Context
When using `pulumi import` we generate code snippets for the resources
that were imported. Sometimes the user specifies `--parent
parentName=URN` or `--provider providerName=URN` which tweak the parent
or provider that the imported resources uses. When using `--parent` or
`--provider` the generated code emits a resource option `parent =
parentName` (in case of using `--parent`) where `parentName` is an
unbound variable.
Usually unbound variables would result in a _bind_ error such as `error:
undefined variable parentName` when type-checking the program however in
the import code generation we specify the bind option
`pcl.AllowMissingVariables` which turns that unbound variable errors
into warnings and code generation can continue to emit code.
This is all good and works as expected. However in the issues linked
above, we do get an _error_ for unbound variables in generated code even
though we specified `AllowMissingVariables`.
The problem as it turns out is when we are trying to generate code via
dynamically loaded `LangaugeRuntime` plugins. Specifically for NodeJS
and Python, we load `pulumi-language-nodejs` or `pulumi-language-python`
and call `GenerateProgram` to get the generated program. That function
`GenerateProgram` takes the text _SOURCE_ of the a bound program (one
that was bound using option `AllowMissingVariables`) and re-binds again
inside the implementation of the language plugin. The second time we
bind the program, we don't pass it the option `AllowMissingVariables`
and so it fails with `unboud variable` error.
I've verified that the issue above don't repro when doing an import for
dotnet (probably same for java/yaml) because we use the statically
linked function `codegen/{lang}/gen_program.go -> GenerateProgram`
## Solution
The problem can be solved by propagating the bind options from the CLI
to the language hosts during import so that they know how to bind the
program. I've extended the gRPC interface in `GenerateProgramRequest`
with a property `Strict` which follows the same logic from `pulumi
convert --strict` and made it such that the import command sends
`strict=false` to the language plugins when doing `GenerateProgram`.
This is consistent with `GenerateProject` that uses the same flag. When
`strict=false` we use `pcl.NonStrictBindOptions()` which includes
`AllowMissingVariables` .
## Repro
Once can test the before and after behaviour by running `pulumi up
--yes` on the following TypeScript program:
```ts
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
export class MyComponent extends pulumi.ComponentResource {
public readonly randomPetId: pulumi.Output<string>;
constructor(name: string, opts?: pulumi.ComponentResourceOptions) {
super("example:index:MyComponent", name, {}, opts);
const randomPet = new random.RandomPet("randomPet", {}, {
parent: this
});
this.randomPetId = randomPet.id;
this.registerOutputs({
randomPetId: randomPet.id,
});
}
}
const example = new MyComponent("example");
export const randomPetId = example.randomPetId;
```
Then running `pulumi import -f import.json` where `import.json` contains
a resource to be imported under the created component (stack=`dev`,
project=`importerrors`)
```ts
{
"nameTable": {
"parentComponent": "urn:pulumi:dev::importerrors::example:index:MyComponent::example"
},
"resources": [
{
"type": "random:index/randomPassword:RandomPassword",
"name": "randomPassword",
"id": "supersecret",
"parent": "parentComponent"
}
]
}
```
Running this locally I get the following generated code (which
previously failed to generate)
```ts
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
const randomPassword = new random.RandomPassword("randomPassword", {
length: 11,
lower: true,
number: true,
numeric: true,
special: true,
upper: true,
}, {
parent: parentComponent,
});
```
2024-07-25 13:53:44 +00:00
|
|
|
case 3:
|
|
|
|
var value = /** @type {boolean} */ (reader.readBool());
|
|
|
|
msg.setStrict(value);
|
|
|
|
break;
|
2022-10-17 14:21:11 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GenerateProgramRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getSourceMap(true);
|
|
|
|
if (f && f.getLength() > 0) {
|
|
|
|
f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
|
|
|
|
}
|
2023-07-27 09:27:07 +00:00
|
|
|
f = message.getLoaderTarget();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
[cli/import] Fix undefined variable errors in code generation when imported resources use a parent or provider (#16786)
Fixes #15410 Fixes #13339
## Problem Context
When using `pulumi import` we generate code snippets for the resources
that were imported. Sometimes the user specifies `--parent
parentName=URN` or `--provider providerName=URN` which tweak the parent
or provider that the imported resources uses. When using `--parent` or
`--provider` the generated code emits a resource option `parent =
parentName` (in case of using `--parent`) where `parentName` is an
unbound variable.
Usually unbound variables would result in a _bind_ error such as `error:
undefined variable parentName` when type-checking the program however in
the import code generation we specify the bind option
`pcl.AllowMissingVariables` which turns that unbound variable errors
into warnings and code generation can continue to emit code.
This is all good and works as expected. However in the issues linked
above, we do get an _error_ for unbound variables in generated code even
though we specified `AllowMissingVariables`.
The problem as it turns out is when we are trying to generate code via
dynamically loaded `LangaugeRuntime` plugins. Specifically for NodeJS
and Python, we load `pulumi-language-nodejs` or `pulumi-language-python`
and call `GenerateProgram` to get the generated program. That function
`GenerateProgram` takes the text _SOURCE_ of the a bound program (one
that was bound using option `AllowMissingVariables`) and re-binds again
inside the implementation of the language plugin. The second time we
bind the program, we don't pass it the option `AllowMissingVariables`
and so it fails with `unboud variable` error.
I've verified that the issue above don't repro when doing an import for
dotnet (probably same for java/yaml) because we use the statically
linked function `codegen/{lang}/gen_program.go -> GenerateProgram`
## Solution
The problem can be solved by propagating the bind options from the CLI
to the language hosts during import so that they know how to bind the
program. I've extended the gRPC interface in `GenerateProgramRequest`
with a property `Strict` which follows the same logic from `pulumi
convert --strict` and made it such that the import command sends
`strict=false` to the language plugins when doing `GenerateProgram`.
This is consistent with `GenerateProject` that uses the same flag. When
`strict=false` we use `pcl.NonStrictBindOptions()` which includes
`AllowMissingVariables` .
## Repro
Once can test the before and after behaviour by running `pulumi up
--yes` on the following TypeScript program:
```ts
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
export class MyComponent extends pulumi.ComponentResource {
public readonly randomPetId: pulumi.Output<string>;
constructor(name: string, opts?: pulumi.ComponentResourceOptions) {
super("example:index:MyComponent", name, {}, opts);
const randomPet = new random.RandomPet("randomPet", {}, {
parent: this
});
this.randomPetId = randomPet.id;
this.registerOutputs({
randomPetId: randomPet.id,
});
}
}
const example = new MyComponent("example");
export const randomPetId = example.randomPetId;
```
Then running `pulumi import -f import.json` where `import.json` contains
a resource to be imported under the created component (stack=`dev`,
project=`importerrors`)
```ts
{
"nameTable": {
"parentComponent": "urn:pulumi:dev::importerrors::example:index:MyComponent::example"
},
"resources": [
{
"type": "random:index/randomPassword:RandomPassword",
"name": "randomPassword",
"id": "supersecret",
"parent": "parentComponent"
}
]
}
```
Running this locally I get the following generated code (which
previously failed to generate)
```ts
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
const randomPassword = new random.RandomPassword("randomPassword", {
length: 11,
lower: true,
number: true,
numeric: true,
special: true,
upper: true,
}, {
parent: parentComponent,
});
```
2024-07-25 13:53:44 +00:00
|
|
|
f = message.getStrict();
|
|
|
|
if (f) {
|
|
|
|
writer.writeBool(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* map<string, string> source = 1;
|
|
|
|
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
|
|
|
* empty, instead returning `undefined`
|
|
|
|
* @return {!jspb.Map<string,string>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.prototype.getSourceMap = function(opt_noLazyCreate) {
|
|
|
|
return /** @type {!jspb.Map<string,string>} */ (
|
|
|
|
jspb.Message.getMapField(this, 1, opt_noLazyCreate,
|
|
|
|
null));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears values from the map. The map will be non-null.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.prototype.clearSourceMap = function() {
|
|
|
|
this.getSourceMap().clear();
|
|
|
|
return this;};
|
|
|
|
|
|
|
|
|
2023-07-27 09:27:07 +00:00
|
|
|
/**
|
|
|
|
* optional string loader_target = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.prototype.getLoaderTarget = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.prototype.setLoaderTarget = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
[cli/import] Fix undefined variable errors in code generation when imported resources use a parent or provider (#16786)
Fixes #15410 Fixes #13339
## Problem Context
When using `pulumi import` we generate code snippets for the resources
that were imported. Sometimes the user specifies `--parent
parentName=URN` or `--provider providerName=URN` which tweak the parent
or provider that the imported resources uses. When using `--parent` or
`--provider` the generated code emits a resource option `parent =
parentName` (in case of using `--parent`) where `parentName` is an
unbound variable.
Usually unbound variables would result in a _bind_ error such as `error:
undefined variable parentName` when type-checking the program however in
the import code generation we specify the bind option
`pcl.AllowMissingVariables` which turns that unbound variable errors
into warnings and code generation can continue to emit code.
This is all good and works as expected. However in the issues linked
above, we do get an _error_ for unbound variables in generated code even
though we specified `AllowMissingVariables`.
The problem as it turns out is when we are trying to generate code via
dynamically loaded `LangaugeRuntime` plugins. Specifically for NodeJS
and Python, we load `pulumi-language-nodejs` or `pulumi-language-python`
and call `GenerateProgram` to get the generated program. That function
`GenerateProgram` takes the text _SOURCE_ of the a bound program (one
that was bound using option `AllowMissingVariables`) and re-binds again
inside the implementation of the language plugin. The second time we
bind the program, we don't pass it the option `AllowMissingVariables`
and so it fails with `unboud variable` error.
I've verified that the issue above don't repro when doing an import for
dotnet (probably same for java/yaml) because we use the statically
linked function `codegen/{lang}/gen_program.go -> GenerateProgram`
## Solution
The problem can be solved by propagating the bind options from the CLI
to the language hosts during import so that they know how to bind the
program. I've extended the gRPC interface in `GenerateProgramRequest`
with a property `Strict` which follows the same logic from `pulumi
convert --strict` and made it such that the import command sends
`strict=false` to the language plugins when doing `GenerateProgram`.
This is consistent with `GenerateProject` that uses the same flag. When
`strict=false` we use `pcl.NonStrictBindOptions()` which includes
`AllowMissingVariables` .
## Repro
Once can test the before and after behaviour by running `pulumi up
--yes` on the following TypeScript program:
```ts
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
export class MyComponent extends pulumi.ComponentResource {
public readonly randomPetId: pulumi.Output<string>;
constructor(name: string, opts?: pulumi.ComponentResourceOptions) {
super("example:index:MyComponent", name, {}, opts);
const randomPet = new random.RandomPet("randomPet", {}, {
parent: this
});
this.randomPetId = randomPet.id;
this.registerOutputs({
randomPetId: randomPet.id,
});
}
}
const example = new MyComponent("example");
export const randomPetId = example.randomPetId;
```
Then running `pulumi import -f import.json` where `import.json` contains
a resource to be imported under the created component (stack=`dev`,
project=`importerrors`)
```ts
{
"nameTable": {
"parentComponent": "urn:pulumi:dev::importerrors::example:index:MyComponent::example"
},
"resources": [
{
"type": "random:index/randomPassword:RandomPassword",
"name": "randomPassword",
"id": "supersecret",
"parent": "parentComponent"
}
]
}
```
Running this locally I get the following generated code (which
previously failed to generate)
```ts
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
const randomPassword = new random.RandomPassword("randomPassword", {
length: 11,
lower: true,
number: true,
numeric: true,
special: true,
upper: true,
}, {
parent: parentComponent,
});
```
2024-07-25 13:53:44 +00:00
|
|
|
/**
|
|
|
|
* optional bool strict = 3;
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.prototype.getStrict = function() {
|
|
|
|
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {boolean} value
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramRequest.prototype.setStrict = function(value) {
|
|
|
|
return jspb.Message.setProto3BooleanField(this, 3, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-10-17 14:21:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* List of repeated fields within this message type.
|
|
|
|
* @private {!Array<number>}
|
|
|
|
* @const
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.repeatedFields_ = [1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GenerateProgramResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GenerateProgramResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
diagnosticsList: jspb.Message.toObjectList(msg.getDiagnosticsList(),
|
|
|
|
pulumi_codegen_hcl_pb.Diagnostic.toObject, includeInstance),
|
|
|
|
sourceMap: (f = msg.getSourceMap()) ? f.toObject(includeInstance, undefined) : []
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GenerateProgramResponse;
|
|
|
|
return proto.pulumirpc.GenerateProgramResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GenerateProgramResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = new pulumi_codegen_hcl_pb.Diagnostic;
|
|
|
|
reader.readMessage(value,pulumi_codegen_hcl_pb.Diagnostic.deserializeBinaryFromReader);
|
|
|
|
msg.addDiagnostics(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = msg.getSourceMap();
|
|
|
|
reader.readMessage(value, function(message, reader) {
|
|
|
|
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", "");
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GenerateProgramResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getDiagnosticsList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedMessage(
|
|
|
|
1,
|
|
|
|
f,
|
|
|
|
pulumi_codegen_hcl_pb.Diagnostic.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getSourceMap(true);
|
|
|
|
if (f && f.getLength() > 0) {
|
|
|
|
f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated codegen.Diagnostic diagnostics = 1;
|
|
|
|
* @return {!Array<!proto.pulumirpc.codegen.Diagnostic>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.prototype.getDiagnosticsList = function() {
|
|
|
|
return /** @type{!Array<!proto.pulumirpc.codegen.Diagnostic>} */ (
|
|
|
|
jspb.Message.getRepeatedWrapperField(this, pulumi_codegen_hcl_pb.Diagnostic, 1));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!Array<!proto.pulumirpc.codegen.Diagnostic>} value
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.prototype.setDiagnosticsList = function(value) {
|
|
|
|
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!proto.pulumirpc.codegen.Diagnostic=} opt_value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.codegen.Diagnostic}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.prototype.addDiagnostics = function(opt_value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.codegen.Diagnostic, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.prototype.clearDiagnosticsList = function() {
|
|
|
|
return this.setDiagnosticsList([]);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* map<string, bytes> source = 2;
|
|
|
|
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
|
|
|
* empty, instead returning `undefined`
|
|
|
|
* @return {!jspb.Map<string,!(string|Uint8Array)>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.prototype.getSourceMap = function(opt_noLazyCreate) {
|
|
|
|
return /** @type {!jspb.Map<string,!(string|Uint8Array)>} */ (
|
|
|
|
jspb.Message.getMapField(this, 2, opt_noLazyCreate,
|
|
|
|
null));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears values from the map. The map will be non-null.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProgramResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProgramResponse.prototype.clearSourceMap = function() {
|
|
|
|
this.getSourceMap().clear();
|
|
|
|
return this;};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GenerateProjectRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GenerateProjectRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
2023-05-26 10:32:19 +00:00
|
|
|
sourceDirectory: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
targetDirectory: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
2023-06-07 17:17:59 +00:00
|
|
|
project: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
2023-07-27 09:27:07 +00:00
|
|
|
strict: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
|
2023-08-03 10:40:05 +00:00
|
|
|
loaderTarget: jspb.Message.getFieldWithDefault(msg, 5, ""),
|
|
|
|
localDependenciesMap: (f = msg.getLocalDependenciesMap()) ? f.toObject(includeInstance, undefined) : []
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GenerateProjectRequest;
|
|
|
|
return proto.pulumirpc.GenerateProjectRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GenerateProjectRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
2023-05-26 10:32:19 +00:00
|
|
|
msg.setSourceDirectory(value);
|
2022-10-17 14:21:11 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
2023-05-26 10:32:19 +00:00
|
|
|
msg.setTargetDirectory(value);
|
2022-10-17 14:21:11 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2023-05-26 10:32:19 +00:00
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setProject(value);
|
2022-10-17 14:21:11 +00:00
|
|
|
break;
|
2023-06-07 17:17:59 +00:00
|
|
|
case 4:
|
|
|
|
var value = /** @type {boolean} */ (reader.readBool());
|
|
|
|
msg.setStrict(value);
|
|
|
|
break;
|
2023-07-27 09:27:07 +00:00
|
|
|
case 5:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setLoaderTarget(value);
|
|
|
|
break;
|
2023-08-03 10:40:05 +00:00
|
|
|
case 6:
|
|
|
|
var value = msg.getLocalDependenciesMap();
|
|
|
|
reader.readMessage(value, function(message, reader) {
|
|
|
|
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
|
|
|
|
});
|
|
|
|
break;
|
2022-10-17 14:21:11 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GenerateProjectRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
2023-05-26 10:32:19 +00:00
|
|
|
f = message.getSourceDirectory();
|
2022-10-17 14:21:11 +00:00
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2023-05-26 10:32:19 +00:00
|
|
|
f = message.getTargetDirectory();
|
2022-10-17 14:21:11 +00:00
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2023-05-26 10:32:19 +00:00
|
|
|
f = message.getProject();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
3,
|
|
|
|
f
|
|
|
|
);
|
2022-10-17 14:21:11 +00:00
|
|
|
}
|
2023-06-07 17:17:59 +00:00
|
|
|
f = message.getStrict();
|
|
|
|
if (f) {
|
|
|
|
writer.writeBool(
|
|
|
|
4,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2023-07-27 09:27:07 +00:00
|
|
|
f = message.getLoaderTarget();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
5,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2023-08-03 10:40:05 +00:00
|
|
|
f = message.getLocalDependenciesMap(true);
|
|
|
|
if (f && f.getLength() > 0) {
|
|
|
|
f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
|
|
|
|
}
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-26 10:32:19 +00:00
|
|
|
* optional string source_directory = 1;
|
2022-10-17 14:21:11 +00:00
|
|
|
* @return {string}
|
|
|
|
*/
|
2023-05-26 10:32:19 +00:00
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.getSourceDirectory = function() {
|
2022-10-17 14:21:11 +00:00
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectRequest} returns this
|
|
|
|
*/
|
2023-05-26 10:32:19 +00:00
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.setSourceDirectory = function(value) {
|
2022-10-17 14:21:11 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-26 10:32:19 +00:00
|
|
|
* optional string target_directory = 2;
|
2022-10-17 14:21:11 +00:00
|
|
|
* @return {string}
|
|
|
|
*/
|
2023-05-26 10:32:19 +00:00
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.getTargetDirectory = function() {
|
2022-10-17 14:21:11 +00:00
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectRequest} returns this
|
|
|
|
*/
|
2023-05-26 10:32:19 +00:00
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.setTargetDirectory = function(value) {
|
2022-10-17 14:21:11 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-26 10:32:19 +00:00
|
|
|
* optional string project = 3;
|
|
|
|
* @return {string}
|
2022-10-17 14:21:11 +00:00
|
|
|
*/
|
2023-05-26 10:32:19 +00:00
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.getProject = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-26 10:32:19 +00:00
|
|
|
* @param {string} value
|
2022-10-17 14:21:11 +00:00
|
|
|
* @return {!proto.pulumirpc.GenerateProjectRequest} returns this
|
|
|
|
*/
|
2023-05-26 10:32:19 +00:00
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.setProject = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 3, value);
|
|
|
|
};
|
|
|
|
|
2022-10-17 14:21:11 +00:00
|
|
|
|
2023-06-07 17:17:59 +00:00
|
|
|
/**
|
|
|
|
* optional bool strict = 4;
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.getStrict = function() {
|
|
|
|
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {boolean} value
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.setStrict = function(value) {
|
|
|
|
return jspb.Message.setProto3BooleanField(this, 4, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-07-27 09:27:07 +00:00
|
|
|
/**
|
|
|
|
* optional string loader_target = 5;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.getLoaderTarget = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.setLoaderTarget = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 5, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-08-03 10:40:05 +00:00
|
|
|
/**
|
|
|
|
* map<string, string> local_dependencies = 6;
|
|
|
|
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
|
|
|
* empty, instead returning `undefined`
|
|
|
|
* @return {!jspb.Map<string,string>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.getLocalDependenciesMap = function(opt_noLazyCreate) {
|
|
|
|
return /** @type {!jspb.Map<string,string>} */ (
|
|
|
|
jspb.Message.getMapField(this, 6, opt_noLazyCreate,
|
|
|
|
null));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears values from the map. The map will be non-null.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectRequest.prototype.clearLocalDependenciesMap = function() {
|
|
|
|
this.getLocalDependenciesMap().clear();
|
|
|
|
return this;};
|
|
|
|
|
|
|
|
|
2022-10-17 14:21:11 +00:00
|
|
|
|
2023-05-26 10:32:19 +00:00
|
|
|
/**
|
|
|
|
* List of repeated fields within this message type.
|
|
|
|
* @private {!Array<number>}
|
|
|
|
* @const
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.repeatedFields_ = [1];
|
2022-10-17 14:21:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GenerateProjectResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GenerateProjectResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
2023-05-26 10:32:19 +00:00
|
|
|
diagnosticsList: jspb.Message.toObjectList(msg.getDiagnosticsList(),
|
|
|
|
pulumi_codegen_hcl_pb.Diagnostic.toObject, includeInstance)
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GenerateProjectResponse;
|
|
|
|
return proto.pulumirpc.GenerateProjectResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GenerateProjectResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
2023-05-26 10:32:19 +00:00
|
|
|
case 1:
|
|
|
|
var value = new pulumi_codegen_hcl_pb.Diagnostic;
|
|
|
|
reader.readMessage(value,pulumi_codegen_hcl_pb.Diagnostic.deserializeBinaryFromReader);
|
|
|
|
msg.addDiagnostics(value);
|
|
|
|
break;
|
2022-10-17 14:21:11 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GenerateProjectResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
2023-05-26 10:32:19 +00:00
|
|
|
f = message.getDiagnosticsList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedMessage(
|
|
|
|
1,
|
|
|
|
f,
|
|
|
|
pulumi_codegen_hcl_pb.Diagnostic.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated codegen.Diagnostic diagnostics = 1;
|
|
|
|
* @return {!Array<!proto.pulumirpc.codegen.Diagnostic>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.prototype.getDiagnosticsList = function() {
|
|
|
|
return /** @type{!Array<!proto.pulumirpc.codegen.Diagnostic>} */ (
|
|
|
|
jspb.Message.getRepeatedWrapperField(this, pulumi_codegen_hcl_pb.Diagnostic, 1));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!Array<!proto.pulumirpc.codegen.Diagnostic>} value
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.prototype.setDiagnosticsList = function(value) {
|
|
|
|
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!proto.pulumirpc.codegen.Diagnostic=} opt_value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.codegen.Diagnostic}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.prototype.addDiagnostics = function(opt_value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.codegen.Diagnostic, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.GenerateProjectResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GenerateProjectResponse.prototype.clearDiagnosticsList = function() {
|
|
|
|
return this.setDiagnosticsList([]);
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GeneratePackageRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GeneratePackageRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
directory: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
|
|
schema: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
2023-07-27 09:27:07 +00:00
|
|
|
extraFilesMap: (f = msg.getExtraFilesMap()) ? f.toObject(includeInstance, undefined) : [],
|
2024-03-26 13:10:34 +00:00
|
|
|
loaderTarget: jspb.Message.getFieldWithDefault(msg, 4, ""),
|
2024-08-07 08:16:37 +00:00
|
|
|
localDependenciesMap: (f = msg.getLocalDependenciesMap()) ? f.toObject(includeInstance, undefined) : [],
|
|
|
|
local: jspb.Message.getBooleanFieldWithDefault(msg, 6, false)
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GeneratePackageRequest;
|
|
|
|
return proto.pulumirpc.GeneratePackageRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GeneratePackageRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setDirectory(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setSchema(value);
|
|
|
|
break;
|
|
|
|
case 3:
|
2023-05-26 10:32:19 +00:00
|
|
|
var value = msg.getExtraFilesMap();
|
2022-10-17 14:21:11 +00:00
|
|
|
reader.readMessage(value, function(message, reader) {
|
|
|
|
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", "");
|
|
|
|
});
|
|
|
|
break;
|
2023-07-27 09:27:07 +00:00
|
|
|
case 4:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setLoaderTarget(value);
|
|
|
|
break;
|
2024-03-26 13:10:34 +00:00
|
|
|
case 5:
|
|
|
|
var value = msg.getLocalDependenciesMap();
|
|
|
|
reader.readMessage(value, function(message, reader) {
|
|
|
|
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
|
|
|
|
});
|
|
|
|
break;
|
2024-08-07 08:16:37 +00:00
|
|
|
case 6:
|
|
|
|
var value = /** @type {boolean} */ (reader.readBool());
|
|
|
|
msg.setLocal(value);
|
|
|
|
break;
|
2022-10-17 14:21:11 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GeneratePackageRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getDirectory();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getSchema();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
2,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2023-05-26 10:32:19 +00:00
|
|
|
f = message.getExtraFilesMap(true);
|
2022-10-17 14:21:11 +00:00
|
|
|
if (f && f.getLength() > 0) {
|
|
|
|
f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes);
|
|
|
|
}
|
2023-07-27 09:27:07 +00:00
|
|
|
f = message.getLoaderTarget();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
4,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2024-03-26 13:10:34 +00:00
|
|
|
f = message.getLocalDependenciesMap(true);
|
|
|
|
if (f && f.getLength() > 0) {
|
|
|
|
f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
|
|
|
|
}
|
2024-08-07 08:16:37 +00:00
|
|
|
f = message.getLocal();
|
|
|
|
if (f) {
|
|
|
|
writer.writeBool(
|
|
|
|
6,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string directory = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.getDirectory = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.setDirectory = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string schema = 2;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.getSchema = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.setSchema = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2023-05-26 10:32:19 +00:00
|
|
|
* map<string, bytes> extra_files = 3;
|
2022-10-17 14:21:11 +00:00
|
|
|
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
|
|
|
* empty, instead returning `undefined`
|
|
|
|
* @return {!jspb.Map<string,!(string|Uint8Array)>}
|
|
|
|
*/
|
2023-05-26 10:32:19 +00:00
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.getExtraFilesMap = function(opt_noLazyCreate) {
|
2022-10-17 14:21:11 +00:00
|
|
|
return /** @type {!jspb.Map<string,!(string|Uint8Array)>} */ (
|
|
|
|
jspb.Message.getMapField(this, 3, opt_noLazyCreate,
|
|
|
|
null));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears values from the map. The map will be non-null.
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageRequest} returns this
|
|
|
|
*/
|
2023-05-26 10:32:19 +00:00
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.clearExtraFilesMap = function() {
|
|
|
|
this.getExtraFilesMap().clear();
|
2022-10-17 14:21:11 +00:00
|
|
|
return this;};
|
|
|
|
|
|
|
|
|
2023-07-27 09:27:07 +00:00
|
|
|
/**
|
|
|
|
* optional string loader_target = 4;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.getLoaderTarget = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.setLoaderTarget = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 4, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2024-03-26 13:10:34 +00:00
|
|
|
/**
|
|
|
|
* map<string, string> local_dependencies = 5;
|
|
|
|
* @param {boolean=} opt_noLazyCreate Do not create the map if
|
|
|
|
* empty, instead returning `undefined`
|
|
|
|
* @return {!jspb.Map<string,string>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.getLocalDependenciesMap = function(opt_noLazyCreate) {
|
|
|
|
return /** @type {!jspb.Map<string,string>} */ (
|
|
|
|
jspb.Message.getMapField(this, 5, opt_noLazyCreate,
|
|
|
|
null));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears values from the map. The map will be non-null.
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.clearLocalDependenciesMap = function() {
|
|
|
|
this.getLocalDependenciesMap().clear();
|
|
|
|
return this;};
|
|
|
|
|
|
|
|
|
2024-08-07 08:16:37 +00:00
|
|
|
/**
|
|
|
|
* optional bool local = 6;
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.getLocal = function() {
|
|
|
|
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {boolean} value
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageRequest.prototype.setLocal = function(value) {
|
|
|
|
return jspb.Message.setProto3BooleanField(this, 6, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-10-17 14:21:11 +00:00
|
|
|
|
2023-12-05 17:47:52 +00:00
|
|
|
/**
|
|
|
|
* List of repeated fields within this message type.
|
|
|
|
* @private {!Array<number>}
|
|
|
|
* @const
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.repeatedFields_ = [1];
|
|
|
|
|
2022-10-17 14:21:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.GeneratePackageResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.GeneratePackageResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
2023-12-05 17:47:52 +00:00
|
|
|
diagnosticsList: jspb.Message.toObjectList(msg.getDiagnosticsList(),
|
|
|
|
pulumi_codegen_hcl_pb.Diagnostic.toObject, includeInstance)
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.GeneratePackageResponse;
|
|
|
|
return proto.pulumirpc.GeneratePackageResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.GeneratePackageResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
2023-12-05 17:47:52 +00:00
|
|
|
case 1:
|
|
|
|
var value = new pulumi_codegen_hcl_pb.Diagnostic;
|
|
|
|
reader.readMessage(value,pulumi_codegen_hcl_pb.Diagnostic.deserializeBinaryFromReader);
|
|
|
|
msg.addDiagnostics(value);
|
|
|
|
break;
|
2022-10-17 14:21:11 +00:00
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.GeneratePackageResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
2023-12-05 17:47:52 +00:00
|
|
|
f = message.getDiagnosticsList();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeRepeatedMessage(
|
|
|
|
1,
|
|
|
|
f,
|
|
|
|
pulumi_codegen_hcl_pb.Diagnostic.serializeBinaryToWriter
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* repeated codegen.Diagnostic diagnostics = 1;
|
|
|
|
* @return {!Array<!proto.pulumirpc.codegen.Diagnostic>}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.prototype.getDiagnosticsList = function() {
|
|
|
|
return /** @type{!Array<!proto.pulumirpc.codegen.Diagnostic>} */ (
|
|
|
|
jspb.Message.getRepeatedWrapperField(this, pulumi_codegen_hcl_pb.Diagnostic, 1));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!Array<!proto.pulumirpc.codegen.Diagnostic>} value
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.prototype.setDiagnosticsList = function(value) {
|
|
|
|
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {!proto.pulumirpc.codegen.Diagnostic=} opt_value
|
|
|
|
* @param {number=} opt_index
|
|
|
|
* @return {!proto.pulumirpc.codegen.Diagnostic}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.prototype.addDiagnostics = function(opt_value, opt_index) {
|
|
|
|
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pulumirpc.codegen.Diagnostic, opt_index);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the list making it empty but non-null.
|
|
|
|
* @return {!proto.pulumirpc.GeneratePackageResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.GeneratePackageResponse.prototype.clearDiagnosticsList = function() {
|
|
|
|
return this.setDiagnosticsList([]);
|
2022-10-17 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-07-27 21:39:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.PackRequest.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.PackRequest} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
packageDirectory: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
Add SupportPack to schemas to write out in the new style (#15713)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds a new flag to the schema metadata to tell codegen to use the
new proposed style of SDKs where we fill in versions and write go.mods
etc.
I've reworked pack to operate on packages assuming they're in this new
style. That is pack no longer has the responsibility to fill in any
version information.
This updates python and node codegen to write out SDKs in this new
style, and fixes their core libraries to still be buildable via pack.
There are two approaches to fixing those, I've chosen option 1 below but
could pretty easily rework for option 2.
1) Write the version information directly to the SDKs at the same time
as we edit the .version file. To simplify this I've added a new
'set-version.py' script that takes a version string an writes it to all
the relevant places (.version, package.json, etc).
2) Write "pack" in the language host to search up the directory tree for
the ".version" file and then fill in the version information as we we're
doing before with envvar tricks and copying and editing package.json.
I think 1 is simpler long term, but does force some amount of cleanup in
unrelated bits of the system right now (release makefiles need a small
edit). 2 is much more localised but keeps this complexity that
sdk/nodejs sdk/python aren't actually valid source modules.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-03-22 09:25:46 +00:00
|
|
|
destinationDirectory: jspb.Message.getFieldWithDefault(msg, 2, "")
|
2023-07-27 21:39:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.PackRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.PackRequest;
|
|
|
|
return proto.pulumirpc.PackRequest.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.PackRequest} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.PackRequest}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setPackageDirectory(value);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setDestinationDirectory(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.PackRequest.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.PackRequest} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getPackageDirectory();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
f = message.getDestinationDirectory();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
Add SupportPack to schemas to write out in the new style (#15713)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds a new flag to the schema metadata to tell codegen to use the
new proposed style of SDKs where we fill in versions and write go.mods
etc.
I've reworked pack to operate on packages assuming they're in this new
style. That is pack no longer has the responsibility to fill in any
version information.
This updates python and node codegen to write out SDKs in this new
style, and fixes their core libraries to still be buildable via pack.
There are two approaches to fixing those, I've chosen option 1 below but
could pretty easily rework for option 2.
1) Write the version information directly to the SDKs at the same time
as we edit the .version file. To simplify this I've added a new
'set-version.py' script that takes a version string an writes it to all
the relevant places (.version, package.json, etc).
2) Write "pack" in the language host to search up the directory tree for
the ".version" file and then fill in the version information as we we're
doing before with envvar tricks and copying and editing package.json.
I think 1 is simpler long term, but does force some amount of cleanup in
unrelated bits of the system right now (release makefiles need a small
edit). 2 is much more localised but keeps this complexity that
sdk/nodejs sdk/python aren't actually valid source modules.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-03-22 09:25:46 +00:00
|
|
|
2,
|
2023-07-27 21:39:36 +00:00
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string package_directory = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.prototype.getPackageDirectory = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.PackRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.prototype.setPackageDirectory = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
Add SupportPack to schemas to write out in the new style (#15713)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds a new flag to the schema metadata to tell codegen to use the
new proposed style of SDKs where we fill in versions and write go.mods
etc.
I've reworked pack to operate on packages assuming they're in this new
style. That is pack no longer has the responsibility to fill in any
version information.
This updates python and node codegen to write out SDKs in this new
style, and fixes their core libraries to still be buildable via pack.
There are two approaches to fixing those, I've chosen option 1 below but
could pretty easily rework for option 2.
1) Write the version information directly to the SDKs at the same time
as we edit the .version file. To simplify this I've added a new
'set-version.py' script that takes a version string an writes it to all
the relevant places (.version, package.json, etc).
2) Write "pack" in the language host to search up the directory tree for
the ".version" file and then fill in the version information as we we're
doing before with envvar tricks and copying and editing package.json.
I think 1 is simpler long term, but does force some amount of cleanup in
unrelated bits of the system right now (release makefiles need a small
edit). 2 is much more localised but keeps this complexity that
sdk/nodejs sdk/python aren't actually valid source modules.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-03-22 09:25:46 +00:00
|
|
|
* optional string destination_directory = 2;
|
2023-07-27 21:39:36 +00:00
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.prototype.getDestinationDirectory = function() {
|
Add SupportPack to schemas to write out in the new style (#15713)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds a new flag to the schema metadata to tell codegen to use the
new proposed style of SDKs where we fill in versions and write go.mods
etc.
I've reworked pack to operate on packages assuming they're in this new
style. That is pack no longer has the responsibility to fill in any
version information.
This updates python and node codegen to write out SDKs in this new
style, and fixes their core libraries to still be buildable via pack.
There are two approaches to fixing those, I've chosen option 1 below but
could pretty easily rework for option 2.
1) Write the version information directly to the SDKs at the same time
as we edit the .version file. To simplify this I've added a new
'set-version.py' script that takes a version string an writes it to all
the relevant places (.version, package.json, etc).
2) Write "pack" in the language host to search up the directory tree for
the ".version" file and then fill in the version information as we we're
doing before with envvar tricks and copying and editing package.json.
I think 1 is simpler long term, but does force some amount of cleanup in
unrelated bits of the system right now (release makefiles need a small
edit). 2 is much more localised but keeps this complexity that
sdk/nodejs sdk/python aren't actually valid source modules.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-03-22 09:25:46 +00:00
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
2023-07-27 21:39:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.PackRequest} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackRequest.prototype.setDestinationDirectory = function(value) {
|
Add SupportPack to schemas to write out in the new style (#15713)
<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
This adds a new flag to the schema metadata to tell codegen to use the
new proposed style of SDKs where we fill in versions and write go.mods
etc.
I've reworked pack to operate on packages assuming they're in this new
style. That is pack no longer has the responsibility to fill in any
version information.
This updates python and node codegen to write out SDKs in this new
style, and fixes their core libraries to still be buildable via pack.
There are two approaches to fixing those, I've chosen option 1 below but
could pretty easily rework for option 2.
1) Write the version information directly to the SDKs at the same time
as we edit the .version file. To simplify this I've added a new
'set-version.py' script that takes a version string an writes it to all
the relevant places (.version, package.json, etc).
2) Write "pack" in the language host to search up the directory tree for
the ".version" file and then fill in the version information as we we're
doing before with envvar tricks and copying and editing package.json.
I think 1 is simpler long term, but does force some amount of cleanup in
unrelated bits of the system right now (release makefiles need a small
edit). 2 is much more localised but keeps this complexity that
sdk/nodejs sdk/python aren't actually valid source modules.
## Checklist
- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
- [x] I have formatted my code using `gofumpt`
<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-03-22 09:25:46 +00:00
|
|
|
return jspb.Message.setProto3StringField(this, 2, value);
|
2023-07-27 21:39:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
|
|
/**
|
|
|
|
* Creates an object representation of this proto.
|
|
|
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
|
|
* Optional fields that are not set will be set to undefined.
|
|
|
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
|
|
* For the list of reserved names please see:
|
|
|
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
|
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
|
|
* JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @return {!Object}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse.prototype.toObject = function(opt_includeInstance) {
|
|
|
|
return proto.pulumirpc.PackResponse.toObject(opt_includeInstance, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Static version of the {@see toObject} method.
|
|
|
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
|
|
* the JSPB instance for transitional soy proto support:
|
|
|
|
* http://goto/soy-param-migration
|
|
|
|
* @param {!proto.pulumirpc.PackResponse} msg The msg instance to transform.
|
|
|
|
* @return {!Object}
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse.toObject = function(includeInstance, msg) {
|
|
|
|
var f, obj = {
|
|
|
|
artifactPath: jspb.Message.getFieldWithDefault(msg, 1, "")
|
|
|
|
};
|
|
|
|
|
|
|
|
if (includeInstance) {
|
|
|
|
obj.$jspbMessageInstance = msg;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format).
|
|
|
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
|
|
* @return {!proto.pulumirpc.PackResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse.deserializeBinary = function(bytes) {
|
|
|
|
var reader = new jspb.BinaryReader(bytes);
|
|
|
|
var msg = new proto.pulumirpc.PackResponse;
|
|
|
|
return proto.pulumirpc.PackResponse.deserializeBinaryFromReader(msg, reader);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserializes binary data (in protobuf wire format) from the
|
|
|
|
* given reader into the given message object.
|
|
|
|
* @param {!proto.pulumirpc.PackResponse} msg The message object to deserialize into.
|
|
|
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
|
|
* @return {!proto.pulumirpc.PackResponse}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
|
|
while (reader.nextField()) {
|
|
|
|
if (reader.isEndGroup()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
var field = reader.getFieldNumber();
|
|
|
|
switch (field) {
|
|
|
|
case 1:
|
|
|
|
var value = /** @type {string} */ (reader.readString());
|
|
|
|
msg.setArtifactPath(value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
reader.skipField();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the message to binary data (in protobuf wire format).
|
|
|
|
* @return {!Uint8Array}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse.prototype.serializeBinary = function() {
|
|
|
|
var writer = new jspb.BinaryWriter();
|
|
|
|
proto.pulumirpc.PackResponse.serializeBinaryToWriter(this, writer);
|
|
|
|
return writer.getResultBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the given message to binary data (in protobuf wire
|
|
|
|
* format), writing to the given BinaryWriter.
|
|
|
|
* @param {!proto.pulumirpc.PackResponse} message
|
|
|
|
* @param {!jspb.BinaryWriter} writer
|
|
|
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse.serializeBinaryToWriter = function(message, writer) {
|
|
|
|
var f = undefined;
|
|
|
|
f = message.getArtifactPath();
|
|
|
|
if (f.length > 0) {
|
|
|
|
writer.writeString(
|
|
|
|
1,
|
|
|
|
f
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* optional string artifact_path = 1;
|
|
|
|
* @return {string}
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse.prototype.getArtifactPath = function() {
|
|
|
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} value
|
|
|
|
* @return {!proto.pulumirpc.PackResponse} returns this
|
|
|
|
*/
|
|
|
|
proto.pulumirpc.PackResponse.prototype.setArtifactPath = function(value) {
|
|
|
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-11-17 02:21:41 +00:00
|
|
|
goog.object.extend(exports, proto.pulumirpc);
|