Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

v2.1.3 #360

Merged
merged 124 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
fc8b365
fix: upgrade airtable from 0.11.6 to 0.12.1
snyk-bot Sep 2, 2023
b9029f6
Fix/v2.0.0 merge conflicts (#278)
EstebanDalelR Sep 4, 2023
c0a6103
Merge branch 'dev' into snyk-upgrade-2fb799419e235800c37aacf6ded49ad0
EstebanDalelR Sep 4, 2023
9a29a68
Build a prompt that produces the desired results
baristaGeek Sep 5, 2023
86c81f7
Flag PRs
baristaGeek Sep 5, 2023
4d0b5bc
Change comparison string for detecting already labeled PRs
baristaGeek Sep 5, 2023
1d246b0
Fix/double cloud id getting (#271)
EstebanDalelR Sep 5, 2023
835e833
Change hardcoded pr title and number to the ones stored on GitHubPRs[0
baristaGeek Sep 5, 2023
aa3ce80
Remove console logs
baristaGeek Sep 5, 2023
6bbba41
Chore/delete unused files (#283)
EstebanDalelR Sep 6, 2023
b174fd6
Feature/new integrations script (#272)
EstebanDalelR Sep 6, 2023
30dabb9
Feature/asana integration (#273)
EstebanDalelR Sep 7, 2023
25e1350
Move logic to actions/github
baristaGeek Sep 7, 2023
7aa4cad
Fix parameter names
baristaGeek Sep 7, 2023
415b917
Merge pull request #275 from watermelontools/snyk-upgrade-2fb799419e2…
baristaGeek Sep 7, 2023
7095af1
Merge branch 'dev' into feature/Watermelon-as-reviewer-0
baristaGeek Sep 8, 2023
63bcbbb
Feature/improve logging (#291)
EstebanDalelR Sep 11, 2023
8ccb1c7
Feature/streamline new integrations (#292)
EstebanDalelR Sep 11, 2023
5c5c103
Remove running in the extension
baristaGeek Sep 11, 2023
ee21e0d
Run sync
baristaGeek Sep 12, 2023
033e3eb
Change threshold back to 9
baristaGeek Sep 12, 2023
d05c0f3
Update route.ts (#296)
EstebanDalelR Sep 13, 2023
9aaa301
Update route.ts (#295)
EstebanDalelR Sep 13, 2023
62ab841
Update responses.ts (#294)
EstebanDalelR Sep 13, 2023
1b2c123
Update redirect.tsx (#293)
EstebanDalelR Sep 13, 2023
82a2093
Feature/intellij login (#286)
EstebanDalelR Sep 13, 2023
fcb992d
Refactor Watermelon as reviewer 0 to work sync and prevent race condi…
baristaGeek Sep 13, 2023
0e13788
Remove user prompt
baristaGeek Sep 13, 2023
058f1a2
Couple logic inside a single function
baristaGeek Sep 13, 2023
047d4d1
Merge branch 'dev' into feature/Watermelon-as-reviewer-0
baristaGeek Sep 13, 2023
aa99e79
Feature/intellij data mapping (#298)
EstebanDalelR Sep 14, 2023
f433f20
Make function async again, use installation octokit, and add auto lab…
baristaGeek Sep 14, 2023
2211ba9
Track pr rating per repo on PostHog
baristaGeek Sep 14, 2023
229e3d0
Add param validation
baristaGeek Sep 14, 2023
9693c5d
Merge branch 'dev' into feature/Watermelon-as-reviewer-0
EstebanDalelR Sep 14, 2023
9d37d0f
Merge pull request #282 from watermelontools/feature/Watermelon-as-re…
baristaGeek Sep 14, 2023
ef4d61b
Feature/encapsulated tracking (#297)
EstebanDalelR Sep 14, 2023
4569bd6
Chore/2.0.1 merge conflicts (#299)
EstebanDalelR Sep 14, 2023
f0458e2
Merge branch 'main' into dev
EstebanDalelR Sep 14, 2023
c4e9644
v2.0.1 (#281) (#300)
EstebanDalelR Sep 14, 2023
eccc506
Add date to textToWrite for the GitHub service
baristaGeek Sep 19, 2023
7647a25
Calculate relative date
baristaGeek Sep 19, 2023
7fe4841
Print PR author
baristaGeek Sep 19, 2023
1ef114e
Remove conole logs
baristaGeek Sep 19, 2023
0e09202
Remove organization as a mandtory paramater for running the GH app (#…
baristaGeek Sep 20, 2023
d6f99d6
REmove github special case
EstebanDalelR Sep 20, 2023
51dfe6f
Fix helper text
EstebanDalelR Sep 20, 2023
eb45693
REmove github special case (#303)
EstebanDalelR Sep 20, 2023
0f4e18f
Merge branch 'dev' into fix/broken-deactivation-text
EstebanDalelR Sep 20, 2023
7fbb7af
Merge pull request #304 from watermelontools/fix/broken-deactivation-…
baristaGeek Sep 20, 2023
1ac634b
Merge branch 'dev' into feature/add-ownership-and-date
baristaGeek Sep 20, 2023
3f91367
Merge pull request #301 from watermelontools/feature/add-ownership-an…
baristaGeek Sep 20, 2023
efc1be6
Add conditional if the count passes 500
baristaGeek Sep 22, 2023
e0d2894
Feature/unauthorized tracking (#309)
EstebanDalelR Sep 22, 2023
8b376fe
Feature/random suggestion text on markdown (#310)
EstebanDalelR Sep 22, 2023
5404ad4
Replace all indexed information with invitation to pay
baristaGeek Sep 25, 2023
7e1ad3d
Remove the logic from the markdown helper
baristaGeek Sep 25, 2023
04f185a
Feature/intellijdownload (#312)
EstebanDalelR Sep 26, 2023
9fdaa47
Remove console log
baristaGeek Sep 26, 2023
e20efd1
Unwrapp comenting logic from being below the threshold. Replace comme…
baristaGeek Sep 26, 2023
44bf4ef
Create and call the new stored procedure (increment_owner_github_app_…
baristaGeek Sep 26, 2023
ef7dc57
Merge pull request #311 from watermelontools/bugfix/bugfix-not-showin…
baristaGeek Sep 27, 2023
84c0dd8
Merge branch 'dev' into bugfix/user-or-org-to-gh-app
baristaGeek Sep 27, 2023
a6b47ba
Merge pull request #313 from watermelontools/bugfix/user-or-org-to-gh…
baristaGeek Sep 27, 2023
3474cb0
Allow empty responses (#317)
EstebanDalelR Sep 28, 2023
c0932ed
Make prompt multi-line to make its iteration easier
baristaGeek Oct 10, 2023
cd57b53
Bias prompt towards conciseness
baristaGeek Oct 10, 2023
70b92ef
Remove role user prompt for simplicity
baristaGeek Oct 10, 2023
c78988e
Merge into a single prompt, and bias the prompt even more towards con…
baristaGeek Oct 10, 2023
3b5a068
Remove github param validation because of the recent permission changes
baristaGeek Oct 10, 2023
52784fe
Remove prod console logs
baristaGeek Oct 10, 2023
0a18c09
Add logic that removes outdated PR labels
baristaGeek Oct 10, 2023
3aff27c
Change the take a deeper dive label emoji
baristaGeek Oct 10, 2023
cca1d2c
Merge pull request #322 from watermelontools/feature/trinary-pr-labeling
baristaGeek Oct 11, 2023
dab95a9
console.log() file patches
baristaGeek Oct 11, 2023
e336e75
Detect console logs and its equivalent in other programming languages…
baristaGeek Oct 11, 2023
fd187fe
Comment the PR if there's a console log detected
baristaGeek Oct 13, 2023
ec591fa
Remove console logs
baristaGeek Oct 13, 2023
161bc91
remove console log
baristaGeek Oct 17, 2023
9d68579
update prompt
baristaGeek Oct 17, 2023
0a3a481
update prompt
baristaGeek Oct 17, 2023
63b0933
Extract functions and texts (#323) (#325)
EstebanDalelR Oct 17, 2023
b937bf3
Ommit console logs that are in code comments
baristaGeek Oct 17, 2023
81380cd
remove old logic
baristaGeek Oct 17, 2023
c01fb42
Restric rating to a maximum of 8 if console log comments are found
baristaGeek Oct 17, 2023
c86a96a
Merge the commits into the prompt list
baristaGeek Oct 18, 2023
48970fb
Update utils/actions/detectConsoleLogs.ts
baristaGeek Oct 18, 2023
d69514b
Promise.allSettled octokit call
baristaGeek Oct 18, 2023
ab41609
Merge branch 'dev' into feature/search-console-logs
baristaGeek Oct 18, 2023
3eb21e2
Concat with different syntax
baristaGeek Oct 18, 2023
955413a
fix merge conflict
baristaGeek Oct 18, 2023
d642ac4
Merge pull request #324 from watermelontools/feature/search-console-logs
baristaGeek Oct 18, 2023
afb3999
Chore/extract PR grading (#333)
EstebanDalelR Oct 23, 2023
df0bb3e
bring the user prompt back
baristaGeek Oct 23, 2023
28a53a4
Add consistent CSS for boxes regardless of login state + prettify design
baristaGeek Oct 25, 2023
b361795
Style the boxes for all integrations
baristaGeek Oct 25, 2023
cfe74c9
Merge pull request #321 from watermelontools/enhancement/improve-prom…
baristaGeek Oct 25, 2023
2fd51f0
Make IDE boxes consistenet with the integraitons boxes
baristaGeek Oct 25, 2023
b86be53
Rebuild sidebar
baristaGeek Oct 25, 2023
8e33d77
Redesign the header
baristaGeek Oct 25, 2023
cf21362
Make final adjustments to header
baristaGeek Oct 25, 2023
894cc1a
Make instruction more specific and add the C++ exmaple
baristaGeek Oct 25, 2023
c62f679
Merge pull request #340 from watermelontools/chore/detect-cpp-console…
baristaGeek Oct 26, 2023
36bfcfd
Create getTeamGitHub.ts (#338)
EstebanDalelR Oct 26, 2023
eae03a0
Create createTeamAndMatchUser.ts (#337)
EstebanDalelR Oct 26, 2023
eaa2ec6
Conditionally render placeholder (#342)
EstebanDalelR Oct 26, 2023
7925771
Feature/comment specific line diffs (#331)
baristaGeek Oct 26, 2023
72b539f
Watermelon using app token (team tool) (#326)
EstebanDalelR Oct 26, 2023
fd21a53
Re-style team page
baristaGeek Oct 27, 2023
ec94f5d
Style settings screen
baristaGeek Oct 27, 2023
ace2080
Merge branch 'dev' into enhancement/beautify-dashboard
baristaGeek Oct 27, 2023
4ad49a4
Pull changes
baristaGeek Oct 27, 2023
9c07826
Merge pull request #339 from watermelontools/enhancement/beautify-das…
baristaGeek Oct 27, 2023
78eac4c
Merge branch 'main' into dev
baristaGeek Oct 27, 2023
8d8c315
Fix indexing issue for the single line file border-case (#346)
baristaGeek Oct 30, 2023
4739d5b
Delete app/(loggedIn)/settings/layout.tsx (#348)
EstebanDalelR Oct 30, 2023
adcc4a9
Add tracking to keys existing
EstebanDalelR Oct 31, 2023
5015186
Fix/broken login getting (#353)
EstebanDalelR Oct 31, 2023
3d25273
Chore/readme update messaging and strategy (#352)
baristaGeek Oct 31, 2023
754aeea
Merge branch 'main' into dev
EstebanDalelR Oct 31, 2023
07d6a42
Fix/add catches to octokit (#359)
EstebanDalelR Nov 2, 2023
d4dbf41
Fix/missing params when a comment is created or edited (#358)
EstebanDalelR Nov 2, 2023
d55a869
Delete public/favicon_io.zip (#357)
EstebanDalelR Nov 2, 2023
fd615b1
Merge branch 'main' into dev
EstebanDalelR Nov 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/api/actions/github/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,16 +571,16 @@ export async function POST(request: Request) {
"installation",

Choose a reason for hiding this comment

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

This file contains at least one console log. Please remove any present.

"repository",
"comment",
"issue",
"pull_request",
]);
if (missingParams.length > 0) {
return missingParamsResponse({ url: request.url, missingParams });
}
const { installation, repository, comment, issue } = req;
const { title, body } = req.issue;
const { installation, repository, comment, pull_request } = req;
const { title, body } = req.pull_request;
const owner = repository.owner.login;
const repo = repository.name;
const number = issue.number;
const number = pull_request.number;
const installationId = installation.id;
const userLogin = comment.user.login;
let botComment = comment.body;
Expand Down
Binary file removed public/favicon_io.zip
Binary file not shown.
52 changes: 30 additions & 22 deletions utils/actions/detectConsoleLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ export default async function detectConsoleLogs({
],
})
.then((result) => {
const openAIResult = result.data.choices[0].message.content.split(",");
const openAIResult =
result.data.choices[0].message.content.split(",");

const addtionsHaveConsoleLog = openAIResult[0];
const individualLine = openAIResult[1];
Expand All @@ -161,27 +162,34 @@ export default async function detectConsoleLogs({

const consoleLogPosition = getConsoleLogPosition({
filePatch: file.patch ?? "",
individualLine
})

return octokit.request(
"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
{
owner,
repo,
pull_number: issue_number,
commit_id: latestCommitHash,
event: "COMMENT",
path: file.filename,
comments: [
{
path: file.filename,
position: consoleLogPosition || 1, // comment at the beggining of the file by default
body: "This file contains at least one console log. Please remove any present.",
},
],
}
);
individualLine,
});

return octokit
.request(
"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
{
owner,
repo,
pull_number: issue_number,
commit_id: latestCommitHash,
event: "COMMENT",
path: file.filename,
comments: [
{
path: file.filename,
position: consoleLogPosition || 1, // comment at the beggining of the file by default
body: "This file contains at least one console log. Please remove any present.",
},
],
}
)
.catch((err) => {
console.log(err);

Choose a reason for hiding this comment

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

This file contains at least one console log. Please remove any present.

Choose a reason for hiding this comment

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

This file contains at least one console log. Please remove any present.

Choose a reason for hiding this comment

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

This file contains at least one console log. Please remove any present.

});
})
.catch((err) => {
console.log(err);
});
};

Expand Down
47 changes: 28 additions & 19 deletions utils/actions/labelPullRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export default async function flagPullRequest({
let botComment = comments.data.find((comment) => {
if (comment.body.includes("This PR contains console logs")) {
// concat to the prompt
prompt += "Since the PR contains console logs, make the maximum rating 8.";
prompt +=
"Since the PR contains console logs, make the maximum rating 8.";
}
});

Expand All @@ -67,26 +68,34 @@ export default async function flagPullRequest({
DONT_MERGE: "🚨 Don't Merge",
};
function deleteLabel(labelName: string) {
octokit.request(
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}",
{
owner,
repo,
issue_number,
name: labelName,
}
);
octokit
.request(
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}",
{
owner,
repo,
issue_number,
name: labelName,
}
)
.catch((error) => {
console.error("Label not found", error);

Choose a reason for hiding this comment

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

This file contains at least one console log. Please remove any present.

Choose a reason for hiding this comment

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

This file contains at least one console log. Please remove any present.

});
}
function addLabel(labelName: string) {
octokit.request(
"POST /repos/{owner}/{repo}/issues/{issue_number}/labels", //add label
{
owner,
repo,
issue_number,
labels: [labelName],
}
);
octokit
.request(
"POST /repos/{owner}/{repo}/issues/{issue_number}/labels", //add label
{
owner,
repo,
issue_number,
labels: [labelName],
}
)
.catch((error) => {
console.error("add laber", error);
});
}

try {
Expand Down
Loading