Skip to content
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

Feat/pull precheck #11

Draft
wants to merge 61 commits into
base: development
Choose a base branch
from

Conversation

Keyrxng
Copy link
Member

@Keyrxng Keyrxng commented Oct 23, 2024

Resolves ubiquity-os/plugins-wishlist#45
Requires #9
Requires #14

TODO

Copy link

github-actions bot commented Oct 23, 2024

Unused files (3)

src/types/pull-requests.ts, src/adapters/openai/constants.ts, src/helpers/pull-helpers/submit-code-review.ts

Unused dependencies (1)

Filename dependencies
package.json @ubiquity-os/ubiquity-os-kernel

Unused types (1)

Filename types
src/adapters/openai/helpers/llm-tools.ts ToolFunctions

@Keyrxng
Copy link
Member Author

Keyrxng commented Oct 24, 2024

current QA: ubq-testing#5 (comment)

I'm targeting this PR and using the spec that is written for it as the baseline for QA.

const issueNumber = linkedViaBodyHash[0].replace("#", "");
const issue = await fetchIssue({ context, owner: repoOwner, repo: repoName, issueNum: Number(issueNumber) });
if (!issue) {
throw logger.error("This pull request does not have an linked task, please link one before merging.");
Copy link
Member Author

@Keyrxng Keyrxng Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've inadvertently implemented a standard that we enforce every single PR must have a linked task, a happy byproduct I'd imagine, should I keep this?

  • merging to main, we bypass
  • any PR opened by a non-human contributor, we bypass

My spelling these days lmao, I realise the grammar error in these logs and will fix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There have been exceptions that come to mind. Usually with collaborators but occasionally with proactive contributors. This should not be enforced.

@Keyrxng
Copy link
Member Author

Keyrxng commented Oct 24, 2024

Bulk of the logic for this is written, it's refining the prompts that's left now.

Previously you have had prompt structures in mind especially for formatting the context window, do you have anything in mind for this feature?

src/handlers/find-ground-truths.ts Show resolved Hide resolved
throw logger.error(`No answer from OpenAI`);
}
logger.info(`Answer: ${answer}`, { tokenUsage });
const tokens = `\n\n<!--\n${JSON.stringify(tokenUsage, null, 2)}\n--!>`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have some means to add structured metadata via a method from the SDK

const issueNumber = linkedViaBodyHash[0].replace("#", "");
const issue = await fetchIssue({ context, owner: repoOwner, repo: repoName, issueNum: Number(issueNumber) });
if (!issue) {
throw logger.error("This pull request does not have an linked task, please link one before merging.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There have been exceptions that come to mind. Usually with collaborators but occasionally with proactive contributors. This should not be enforced.

}

if (!taskSpec) {
throw logger.error("Task Spec not found, please link one before merging.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw logger.error("Task Spec not found, please link one before merging.");
throw logger.error("Task specification not found, please link one before merging.");

Unnecessary shorthand

throw logger.error("PR Diff not found");
}

const question = "What's missing compared to the spec?";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const question = "What's missing compared to the spec?";
const question = "Does the code diff implement all of the required changes per the specification?";

Not sure the context of how this is used but i would also go on to provide instructions for how it should offer feedback.

Copy link
Member Author

@Keyrxng Keyrxng Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't started refining the actual review prompt or anything close to it yet so this is not implemented yet

chat history = System Message + user question (sysMsg = "you review code..", query = this string in question) + spec and diff

src/plugin.ts Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
export type CodeReviewStatus = "APPROVE" | "REQUEST_CHANGES" | "COMMENT";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really necessary that it needs its own file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If by the time I'm done it's still solo I'll group it but I expect to fill more types here

@0x4007
Copy link
Member

0x4007 commented Oct 24, 2024

Bulk of the logic for this is written, it's refining the prompts that's left now.

Previously you have had prompt structures in mind especially for formatting the context window, do you have anything in mind for this feature?

I'm not sure what you're referring to. But its important to use clear headers to divide the sections.

@Keyrxng
Copy link
Member Author

Keyrxng commented Oct 24, 2024

But its important to use clear headers to divide the sections.

ubiquity-os/plugins-wishlist#29 (comment) - You were very specific and intentional when I implemented /gpt which is why I asked but no worries ty

@Keyrxng
Copy link
Member Author

Keyrxng commented Oct 27, 2024

Sitting on this until my other PRs in this repo are merged at least while I push forward my other tasks that don't have dependencies.

This PR uses both features introduced in #9 and #14.

@Keyrxng
Copy link
Member Author

Keyrxng commented Nov 3, 2024

Didn't realise I hadn't pushed code from 10 days ago and left a comment on tools "probs not a good idea to have these for the chatbot" lmao but I took from my early iteration and haven't upgraded it yet/

So anyway tools need an interface that's going to be shared across all completions not just the chatbot so whos designing that interface because there are two PRs now which have set out to build one obv there cannot be two.

I feel like it's probably best that @sshivaditya2019 continues to build it maybe and I'll use it? Idk anymore really but lmk if I should build it or wait until #31 has been merged. Thanks.

P.S: I've pulled in #28 since it appears to have been approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pull Precheck
3 participants