Closed whilefoo closed 6 months ago
I know that there are limits around how many input parameters we can have. I assume that there are limits on character length per input parameter.
Let's try passing in everything in a single input parameter and if it hits a character limit then we can break it apart across several input parameters.
I know that there are limits around how many input parameters we can have. I assume that there are limits on character length per input parameter.
I've just tried invoking a workflow with event
input which is stringified JSON webhook, and settings
which is also stringified and it worked!
Is there an issue we can associate with this pull request? I'm a bit lost on context after reviewing tens of notifications.
Also looks like you can add some of those words to the cspell dictionary. There seems to be at least one genuine type "WATING"
I'm still not sure about the plugin input and output data.
Currently the first plugin receives this data:
{
id: string; // reference to kernel KV
eventName: string;
event: string; // event payload
settings: string;
authToken: string;
ref: string;
}
The plugin needs to return the following data:
{
id: string; // reference to kernel KV
owner: string; // owner of the repo that triggered the event
repo: string; // repo that triggered the event
output: any; // output of the plugin
}
Should we let the first plugin dictate the input of the second plugin but some properties are essential for every plugin. For example the id, settings of the plugin, ref and maybe eventName and name too.
I'm thinking about a few different ways:
{
...pluginOutput.output,
id: pluginOutput.id,
settings: JSON.stringify(nextPlugin.with),
ref: nextPlugin.plugin.ref,
}
{
id: pluginOutput.id,
settings: JSON.stringify(nextPlugin.with),
ref: nextPlugin.plugin.ref,
previousPluginOutput: pluginOutput.output,
}
{
id: string;
eventName: string;
event: string; // event payload
settings: string;
authToken: string;
ref: string;
previousPluginOutput: any, // this will be null for the first plugin
}
I can't answer specifically because I don't feel that I have enough context (I didn't run the code)
Generally speaking here are some thoughts:
To me this means that we do not have to be conservative, so feel free to pass all the data you might need (especially for this v1)
Intuitively I feel that each plugin should respond to the kernel, and then the kernel should invoke the next plugin; instead of a plugin daisy chaining directly into another plugin. Because that means that the plugin developers would need to actually redundantly include the daisy chain logic (and some plugins may never be used in chains!)
In order to track state (for when the bot receives a plugin response) I'm wondering if it's sufficient to utilize 1. Installation ID (represents which partner is using the bot) and 2. The repo ids that host each plugin
With those combined two values perhaps that's enough context for the bot to pick up where the plugins left off.
Otherwise if more information is needed (like repo, and who invoked the event) possibly just capturing and passing around the entire webhook event that invoked the whole chain of events. It's a large object but it has details around everything relevant to what invoked the event, like org, repo, comment url, user etc
Hey @whilefoo its 1 March. How's this looking for merging in?
I just need to add the code to get outputs from previous plugin to the input of next plugin and make sure everything is working and we can merge
When will you have that finished by?
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
---|
src/github/types/webhook-events.ts
Filename | dependencies |
---|---|
package.json | @octokit/webhooks-types create-cloudflare octokit universal-github-app-jwt |
Filename | devDependencies |
---|---|
package.json | @mswjs/data br/>`@types/jest`<br/esbuild eslint-config-prettier eslint-plugin-prettier ts-node |
Filename | unlisted |
---|---|
src/github/github-client.ts | @octokit/core br/>`@octokit/types`<br/@octokit/plugin-paginate-rest br/>`@octokit/plugin-rest-endpoint-methods`<br/@octokit/plugin-retry br/>`@octokit/plugin-throttling`<br/@octokit/auth-app |
tests/main.test.ts | @jest/globals |
Filename | binaries |
---|---|
package.json | lsof awk |
.github/workflows/build.yml | build |
.github/workflows/cspell.yml | format:cspell |
Previous version of workflow dispatch defined exact inputs, but I'm wondering is that really necessary. Can't we just send the whole webhook event along with settings from the config?