feat(build): add utils.deploy.env.add build plugin API#6918
feat(build): add utils.deploy.env.add build plugin API#6918
utils.deploy.env.add build plugin API#6918Conversation
c9fa671 to
acfbc22
Compare
|
This pull request adds or modifies JavaScript ( |
bd84b54 to
293c047
Compare
d0c7d72 to
216b989
Compare
216b989 to
393ffee
Compare
a353bf8 to
44cc578
Compare
This changeset adds a new utility to build plugins: `utils.deploy.env.add()`. This utility function allows build plugins to register environment variables at build time that will be injected into a specific deploy. Userland build plugins cannot see or manipulate the deploy environment variables registered by core or other userland plugins. Deploy-specific environment variables are collected by the `build` supervisor process and processed by the deploy step, which sends them to Buildbot for processing. They are also returned by the programmatic `dev` interface; we'll use these returned variables in the CLI, where we'll e.g. set them on functions. While I was in here I also converted a few files to TypeScript/generally did my best to improve the types along the way.
44cc578 to
72209ec
Compare
|
last thing i can think of @ndhoule , maybe there is still WIP, i havent been following very much so might not apply. Here's a little gap I found w the transport logic: Background:
The gap: in util.ts we calculate normalizedScopes but it stores only { key, value, isSecret } (no scope) That means buildbot receives env vars without scopes,which is a lil confusing since the Open API model says it's required which leads me to think that vars will get broader exposure than you are intending Side note; (in the open api enum) |
This is required to consume these variables in the CLI.
|
@jaredm563 Totally correct, just an oversight. Addressed in 97a4d85 |
|
Whew! Structure looks great so far! Putting some last thoughts regarding transport flow (in a comment because im being a bum >:)), then I'll let @eduardoboucas give another set of eyes since he's much more familiar than me with this architecture
smol code example
in buildbot_client: environment: { key: string; value: string; isSecret: boolean }[] But the Go model always expect isSecret So, "isSecret" key -> IsSecret is always
BuildRequest.environment line 54 needs |
|
@jaredm563 Addressed all those comments. Thanks for the in-depth review! |
3dbf57f to
41e6f8f
Compare
feat(build): add
utils.deploy.env.addbuild plugin APIThis changeset adds a new utility to build plugins:
utils.deploy.env.add(). This utility function allows build plugins toregister environment variables at build time that will be injected into
a specific deploy.
Userland build plugins cannot see or manipulate the deploy environment
variables registered by core or other userland plugins.
Deploy-specific environment variables are collected by the
buildsupervisor process and processed by the deploy step, which sends them to
Buildbot for processing. They are also returned by the programmatic
devinterface; we'll use these returned variables in the CLI, where we'll
e.g. set them on functions.
While I was in here I also converted a few files to TypeScript/generally
did my best to improve the types along the way.