-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add issues to request detail page #37
Conversation
Preparing for the PR
can you provide steps to trigger a related issue? |
You can use a script to seed the database with some requests that have related issues (though they don't always really match). The script is rm mizu.db && npm run db:generate && npm run db:migrate && npm run db:seed && npm run dev This removes the current db, runs all the db scripts and starts the server. |
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.
a few nits and minor requests - otherwise approved!
|
||
const paddedChunks = addSurroundingWords(rawChunks, text); | ||
// const paddedChunks = rawChunks.length ? addSurroundingWords(rawChunks, issue.body) : rawChunks; | ||
console.log(searchWords); |
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.
log
}).filter((chunk) => chunk.highlight); | ||
|
||
const paddedChunks = addSurroundingWords(rawChunks, text); | ||
// const paddedChunks = rawChunks.length ? addSurroundingWords(rawChunks, issue.body) : rawChunks; |
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.
dead code
if (paddedChunks.length > 0) { | ||
console.log("before", rawChunks, "after", paddedChunks); | ||
} | ||
// return paddedChunks; |
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.
dead code
// const paddedChunks = rawChunks.length ? addSurroundingWords(rawChunks, issue.body) : rawChunks; | ||
console.log(searchWords); | ||
if (paddedChunks.length > 0) { | ||
console.log("before", rawChunks, "after", paddedChunks); |
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.
log
} | ||
|
||
if (!issues || issues.length === 0 || !query) { | ||
return <div>No data</div>; |
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.
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.
ah i see below (line 48) you actually have a bit of UI for this, but it's unreachable
{issues.length === 0 && (
<li>
<div className="items-center gap-2 justify-center flex text-gray-500">
<ExclamationTriangleIcon />
No related issues found
</div>
</li>
)}
|
||
return ( | ||
<div className="flex flex-row"> | ||
<Card x-chunk="dashboard-06-chunk-0" className="basis-2/3"> |
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.
what's x-chunk from?
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.
it was there originally so when i was splitting things up into separate components, I moved it. However I will remove it as i don't think it's got any value.
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.
indeed - i couldn't figure it out. probably something i copy-pasted
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 will remove it in my next PR
const status = response?.message.status; | ||
trace.status = typeof status === "string" ? status : "unknown"; | ||
const size = response?.message.body.length; |
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.
nice -really improves the requests table!
frontend/src/queries/queries.ts
Outdated
}); | ||
const data = await response.json(); | ||
return GitHubIssuesSchema.parse(data); | ||
// return data as Array<number>; |
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.
dead
return GitHubIssuesSchema.parse(data); | ||
// return data as Array<number>; | ||
} catch (e: unknown) { | ||
console.error("Error fetching GitHub issue for a trace: ", e); |
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.
should still throw?
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.
yeah that makes sense. I didn't think much about it, i was just following the same logic/flow that we already have with fetchMizuLogs
. I've added some throws in the code.
const data = await response.json(); | ||
return DependenciesSchema.parse(data); | ||
} catch (e: unknown) { | ||
console.error("Error fetching dependencies: ", e); |
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.
should still throw?
It also: