Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions Server/app/worker-service/services/gif.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export async function findGIF(query: string): Promise<string | null> {
if (!giphyApiKey || !query.trim()) return null;

try {
console.log("trying yo find the giphy url...")
const response = await axios.get<GiphyResponse>(
"https://api.giphy.com/v1/gifs/search",
{
Expand All @@ -20,6 +21,8 @@ export async function findGIF(query: string): Promise<string | null> {
},
);

console.log("here it is....." , response.data.data[0]?.images.fixed_height.url)

return response.data.data[0]?.images.fixed_height.url ?? null;
} catch (error) {
console.error("Failed to find GIF for review comment", error);
Expand Down
3 changes: 3 additions & 0 deletions Server/app/worker-service/services/review.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ ${arr
}

async function getReviewGifUrl(summary?: string | null): Promise<string | null> {
console.log("running getReviewGifUrl .....")
try {
const gifQuery = await getGifName(summary);
console.log("found gifQuery , " , gifQuery)
return await findGIF(gifQuery);
} catch (error) {
console.error("Skipping review GIF", error);
Expand Down Expand Up @@ -141,6 +143,7 @@ export async function runPRReview(data: PRReviewJobData) {
const gifUrl = await getReviewGifUrl(parsedPrompt.summary);

const commentBody = formatReviewComment(parsedPrompt, gifUrl);
console.log("adding this comment body : \n\n", commentBody)
await octokit.issues.createComment({
owner,
repo,
Expand Down
Loading