-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: issue_comments linting added issue_comments:edited, created and … #1
fix: issue_comments linting added issue_comments:edited, created and … #1
Conversation
Unlisted binaries (2)
Unused types (4)
|
Fix |
@sshivaditya2019 It seems that you are storing the vectors within Supabase but I see no Supabase folder for setup. Also, typings should be used so Supabase offers auto-complete. Please fix the unit tests as well. |
Fixed added schema for table. Unit tests work now. Schema typing should be available in the project. Embedding type now expects a vector array of length 3072 |
Co-authored-by: Mentlegen <[email protected]>
@sshivaditya2019 Thanks a lot for the changes, appreciated. Since you seem to use Supabase, I assume that we should spin up a new instance specially for this project because this data would not make much sense in our current database, @0x4007 please confirm. As such could you please add a migration script that would:
when code is pushed to the main branch? Here is an example to get you started: https://github.com/ubiquibot/user-activity-watcher/blob/development/.github/workflows/database.yml#L35 |
Sure new database is fine to keep things simple. |
Added Github Workflow, and fixed the package.json. |
Please fix the Knip issues, I will try to set up this on my repo and give it a run. |
Knip should be fixed in the latest commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a horrendous time trying this locally and had to rely on a GitHub deployment to test it. A few major changes to consider:
- remove the
commands
section from the manifest otherwise the plugin will never run - inside
compute.yml
rename the content properly (plugin-name
) - in
compute.yml
add the GitHub secrets properly or the run will crash (I assume this will run as an Action because it's a long running task) - update
README.md
properly to help future collaborators
Related run: https://github.com/Meniole/issue-comment-embeddings/actions/runs/10612546023/job/29414425736#step:5:8
|
@@ -10,7 +10,6 @@ import { plugin } from "./plugin"; | |||
*/ | |||
export async function run() { | |||
const payload = github.context.payload.inputs; | |||
|
|||
const env = Value.Decode(envSchema, payload.env); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always crash on run:
https://github.com/Meniole/issue-comment-embeddings/actions/runs/10628609152/job/29463778679#step:5:45
The environment is populated either from GitHub or the Worker. Since this runs as an action, it should be loaded directly within process.env
, which you can add inside payload.env
if you want. In the case of a worker, it is send within the payload by Cloudflare.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, as mentioned before, I expect this to run in a Cloudflare worker environment. The env variables are sent within the payload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think running as worker is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more changes might be needed to be able to run this one, but getting closer (c.f. my last comment).
Testing actions is tedious. I would advise you to create your own organization (also works on your personal account but usage restrictions are way lower) and set up the bot so you can try some runs and make sure it works as intended.
Could you please confirm if the Is there any particular reason you keep trying to set it up in Github Action environment. The plugin could be made for a Cloudflare Worker or Standalone Github action right ? I don't want this to run in Github Action environment and is intended to be setup on Worker env. |
Screen.Recording.2024-08-30.at.4.39.35.AM.mov |
Very lovely QA testing video thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull looks great. I just have some cosmetic changes
.github/workflows/compute.yml
Outdated
@@ -1,4 +1,4 @@ | |||
name: "the name of the plugin" | |||
name: "@ubiquibot/issue-comment-embeddings" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: "@ubiquibot/issue-comment-embeddings" | |
name: "@ubiquity-os/comment-vector-embeddings" |
- Shouldn't this eventually cover all comments?
- Ubiquibot is deprecated
- ideally this plugin should be generalized to allow us to pass in anything to generate embeddings. Maybe we can generate a unique ID based on where it's coming in from (GitHub, Telegram) and the project it's posted to (repository/issue, or group chat id) etc
The purpose of this is to serve as the foundation of the system's awareness across all organization operations.
.github/.ubiquibot-config.yml
Outdated
id: test-app | ||
uses: | ||
- plugin: https://ubiquibot-issue-comment-embeddings.sshivaditya.workers.dev | ||
runsOn: [ "issue_comment.created", "issue_comment.edited", "issue_comment.deleted" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we do "issue_comment"
to be concise? @gentlementlegen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not with the current implementation because it wouldn't match the event and wouldn't be triggered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be removed, otherwise no plugin will run inside of this repo.
manifest.json
Outdated
"description": "Command 1 with an argument." | ||
} | ||
} | ||
"name": "@ubiquibot/issue-comment-embeddings", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ubiquity-os
} | ||
"name": "@ubiquibot/issue-comment-embeddings", | ||
"description": "Issue comment plugin for Ubiquibot. It enables the storage, updating, and deletion of issue comment embeddings.", | ||
"ubiquity:listeners": ["issue_comment.created", "issue_comment.edited", "issue_comment.deleted"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly issue_comment
only
@@ -10,7 +10,6 @@ import { plugin } from "./plugin"; | |||
*/ | |||
export async function run() { | |||
const payload = github.context.payload.inputs; | |||
|
|||
const env = Value.Decode(envSchema, payload.env); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think running as worker is fine.
wrangler.toml
Outdated
@@ -1,4 +1,4 @@ | |||
name = "your-plugin-name" | |||
name = "ubiquibot-issue-comment-embeddings" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UbiquiBot term is deprecated in favor of UbiquityOS (or when lowercase, ubiquity-os)
@0x4007 My concern about having this as a worker is the following:
But I will test it as a worker and see if it works. |
|
GitHub actions are totally free for us. Workers can be costly. It is only a problem to do workers if we have to spend money |
|
Tested thsi on my Cloudflare, works fine, thanks for all the bug fixes. In the end switching this plugin from Worker to Action should be as simple as changing a URL to an Action path. Please remove |
@gentlementlegen Removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good with me. @0x4007 if you can create the Supabase instance and set the secrets, I do not have permission to create new instances on the company's account, thanks.
I think create and we can transfer later? I don't have a lot of time on my computer these days due to the upcoming conference. |
This is great stuff gg @sshivaditya2019 @gentlementlegen @0x4007 I think it might be a good idea as another issue to improve the db structure so that conversations are grouped together easily. This way when working with the embeddings it's easier to get all of the context specific to a certain task or PR review discussion etc. For instance telegram chat embeddings would be grouped with the issue it relates to in order to give a fuller picture when the embeddings are used. I guess using the task body is possible but we tend to avoid using arbitrary strings for situations like this |
/** | ||
* Update `manifest.json` with any events you want to support like so: | ||
* | ||
* ubiquity:listeners: ["issue_comment.created", ...] | ||
*/ | ||
export type SupportedEventsU = "issue_comment.created"; | ||
export type SupportedEventsU = "issue_comment.created" | "issue_comment.deleted" | "issue_comment.edited"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Keyrxng can't this type be dynamically generated by importing the manifest.json file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately not without trickery because string arrays type as string
and inference goes out of the window.
The easiest way to do it would be to convert them into keys inside the manifest as opposed to a string array this way we could easily extract string literal types from the object.
Resolves #32
Comment ID
,Issue Body
in the payload.