ubiquity-os / ubiquity-os-kernel

1 stars 13 forks source link

feat: configuration annotations #112

Open gentlementlegen opened 1 week ago

gentlementlegen commented 1 week ago

Resolves #80

QA: https://github.com/Meniole/ubiquibot-config/commit/7aaa773aaf3eb93ea1bf1e15706bdc20d2c3e988#commitcomment-147051448

Changes

The kernel is now capable to check the validity of a given configuration. On push event, if the commits contain the .github/.ubiquibot-config.yml, the kernel will proceed to verify its content. It does the current checks:

If any of these checks fail, an annotation is made within the commit, pointing to the faulty line.

Side tasks

gentlementlegen commented 1 week ago

Can you explain to me how this works:

plugin with sends the proper arguments

For Actions, it triggers a Validate Schema workflow run, like here https://github.com/Meniole/automated-merging/actions/runs/10969158970 and gets a workflow dispatched event in return For Workers, it sends a POST to /manifest endpoint and gets a JSON as a reponse with eventual errors

gentlementlegen commented 1 week ago

@whilefoo Please let me know if the logic makes sense, I'll be working on the changes required in the plugins if you give it your go.

whilefoo commented 6 days ago

Looks good, just wondering if it would be better for plugin to provide the schema for the with object in the manifest instead of doing the check. This way we could avoid calling a workflow and async stuff. What do you think?

gentlementlegen commented 6 days ago

@whilefoo I thought about it but the dangerous thing is that it would allow for possible code injection, and also in the case of plugins like conversation-rewards it would be a very complex schema to provide, so I didn't think it would be reliable.