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

Bug: Getting PR commit messages is unstable #131

Closed
1 of 2 tasks
a0m0rajab opened this issue May 25, 2023 · 7 comments · Fixed by #163
Closed
1 of 2 tasks

Bug: Getting PR commit messages is unstable #131

a0m0rajab opened this issue May 25, 2023 · 7 comments · Fixed by #163
Assignees
Labels

Comments

@a0m0rajab
Copy link
Contributor

a0m0rajab commented May 25, 2023

Describe the bug

I faced this while working on: #101 I could not get the AI generated text to add it on highlight, which caused a debug issue for a while. I had to ask @Anush008 about the code he written to understand the logic and design behind it to solve the issue.

we decided to solve it on the same PR by changing the related links and adding the needed checks. I will do the refactor and push it on the same PR.

Opened this as a reference for future checks.

Steps to reproduce

N/A

Affected services

browser-extension

Platforms

No response

Browsers

No response

Environment

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributing Docs

  • I agree to follow this project's Contribution Docs
@a0m0rajab a0m0rajab added the 🐛 bug Something isn't working label May 25, 2023
@Anush008
Copy link
Member

Anush008 commented May 25, 2023

To add to this, what we found was, using this URL https://api.github.com/repos/open-sauced/ai/pulls/79(example) for getting the commit messages isn't reliable as the response format keeps changing. We'll have to use https://api.github.com/repos/open-sauced/ai/pulls/79/commits for getting the commit messages in this utility function

export const getPRCommitMessages = async (url: string) => {
const response = await fetch(url);
.

@Anush008
Copy link
Member

Anush008 commented May 25, 2023

Appending /commits also solves the current inability to get the commit messages on draft PRs mentioned here
#79 (comment).

@a0m0rajab a0m0rajab self-assigned this May 25, 2023
@Anush008 Anush008 changed the title Bug: instable AI generation. Bug: Getting PR commit messages is unstable May 25, 2023
@a0m0rajab
Copy link
Contributor Author

While doing the suggestion we discussed I faced an issue with this link: #130 (comment)
Will further debug to find a solution for that.

@a0m0rajab
Copy link
Contributor Author

The API urls:
https://api.github.com/repos/open-sauced/ai/pulls/101
https://api.github.com/repos/open-sauced/ai/pulls/130#event-9343450255

A solution could be to parse the link after the number or even just call each endpoint to get commits_url (i prefer the local parse to not get stuck with multiple unnecessary network calls.)

@a0m0rajab
Copy link
Contributor Author

a0m0rajab commented May 27, 2023

A possible regex to use: pull\/\d*
A possible solution is to capture the data from regex and use it in our functions,
other solution would be removing the string after regex

@github-actions
Copy link

github-actions bot commented Jun 4, 2023

🎉 This issue has been resolved in version 1.4.1-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

🎉 This issue has been resolved in version 1.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants