Closed gentlementlegen closed 1 week ago
@whilefoo if you wanna have a look as well. Needs some more tweaks probably but it is reviewable.
@gentlementlegen, this task has been idle for a while. Please provide an update.
@whilefoo @Keyrxng if you can take a look! I'll fix the CI runs very soon.
Sorry @gentlementlegen if there's any confusion but I've been told by Rndquu not to perform review until things are cleared up regarding my status, I thought 0x4007 would have mentioned it to you sorry man.
@gentlementlegen
Running bun run ui:dev
and getting the POST http://localhost:3000/ net::ERR_CONNECTION_REFUSED
error:
What am I doing wrong and why do we need to run some service at http://localhost:3000
?
You are running the command that is used to dev the UI only. We need a server because it runs the plug-in. You should use the root "bun start server" command after compiling the front-end.
You are running the command that is used to dev the UI only. We need a server because it runs the plug-in. You should use the root "bun start server" command after compiling the front-end.
So I need to:
bun ui:build
from the src/web
folderbun server
from the root folderCorrect?
@gentlementlegen
Getting 500 error on "Generate" click:
$ bun --watch src/web/api/index.ts
Started server http://localhost:3000
{
type: 45,
schema: {
default: "info",
[Symbol(TypeBox.Hint)]: "Enum",
[Symbol(TypeBox.Kind)]: "Union",
anyOf: [
[Object ...], [Object ...], [Object ...], [Object ...], [Object ...]
],
},
path: "/logLevel",
value: undefined,
message: "Expected required property",
errors: [],
}
1 | /** The base Error type thrown for all TypeBox exceptions */
2 | export class TypeBoxError extends Error {
3 | constructor(message) {
4 | super(message);
^
error: Unable to decode value as it does not match the expected schema
What am I doing wrong?
@rndquu I removed it from the configuration as it should come from the environment, let me know if that solved your problem. Otherwise maybe something in your env is wrong?
@rndquu I removed it from the configuration as it should come from the environment, let me know if that solved your problem. Otherwise maybe something in your env is wrong?
Getting another 500 error:
$ bun --watch src/web/api/index.ts
Started server http://localhost:3000
{
type: 45,
schema: {
[Symbol(TypeBox.Kind)]: "String",
type: "string",
},
path: "/evmPrivateEncrypted",
value: undefined,
message: "Expected required property",
errors: [],
}
1 | /** The base Error type thrown for all TypeBox exceptions */
2 | export class TypeBoxError extends Error {
3 | constructor(message) {
4 | super(message);
^
error: Unable to decode value as it does not match the expected schema
Don't fully understand where evmPrivateEncrypted
should be placed.
How to reproduce:
bun server
http://localhost:3000/
ubiquity-os-marketplace
in the "Owner" field, text-conversation-rewards
in the "Repo" field, 102
in the "Issue Id" fieldcache
and Open AI
Generate
Also notice that the latest jest run is failing.
@rndquu The evm private key should come from the env. But I also added a check to pick it up from the configuration itself here. Updated the README as well.
Thanks for the QA and sorry for the trouble. I tried with a freshly cloned repo and seems to work fine when following the instructions now.
@gentlementlegen This error is still present. Could you either add a default value for evmPrivateEncrypted
in .ubiquity-os.config.yml either mention it in the .env.example
?
Otherwise looks good.
Overall we need some kind of a "mini kernel" which would send predefined github payloads to plugins. Smth like (example for the /wallet
command):
# run the plugin as a worker
yarn worker
# send github payload to the plugin
$ ubiquity-os send "issue_comment.created" --body "/wallet 0x01"
But since https://github.com/ubiquity-os/ubiquity-os-kernel/issues/171 is ready (I haven't checked how it works yet) probably the above approach is not really necessary.
@rndquu I will add the one we use for tests in the .dev.example
then since it would be safe to use.
Now that we have the SDK, every plugin can run as a "server". This server is able to listen to network events. So I think what you describe can be solved by using .http
files (or curl, or postman or any tool capable of doing network calls) that can have a payload that mimics GitHub one. We used this technique inside other plugins, like here: https://github.com/ubiquity-os-marketplace/command-query/blob/cd27f14a67b1eb090bc7f1e3ef597479f67640e3/tests/http/request.http.
Key added here: https://github.com/ubiquity-os-marketplace/text-conversation-rewards/pull/181/commits/b3a3a940d116be6bf4d2688b0db04ee86bb61635
Thanks for your patience and the review.
Resolves #102 Depends on https://github.com/ubiquity-os-marketplace/text-conversation-rewards/pull/170
What's new
The changes aim to help developers running the plugin locally and have a preview of the results that displays very similarly to GitHub. They also benefit from caching, so subsequent runs won't refetch all the data allowing for fast runs. OpenAI also can be spoofed to avoid consuming API credits.