-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add error from staging to overview #1297
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d2911c6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello @AStaroverov, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the error reporting capabilities within the project overview by transitioning from a generic error flag to more specific error messages. It now distinguishes between errors occurring in the UI context, during the main run, and within the staging phase, providing clearer and more actionable feedback on the health and status of a project's production state. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds more detailed error information to the project overview, specifically capturing errors from the staging, UI context, and run steps. The changes are well-contained within project_overview.ts. My review focuses on improving code clarity and maintainability by refactoring duplicated logic and pointing out potential data redundancy in the resulting overview object.
| prod = { | ||
| arguments: prodArgs, | ||
| stale: !argsEquals(currentArguments, prodArgs), | ||
|
|
||
| uiCtxError: prodUiCtx.error?.getDataAsString() ?? prodUiCtx.value?.getError()?.getDataAsString(), | ||
| runError: runResult?.error?.getDataAsString() ?? runResult?.value?.getError()?.getDataAsString(), | ||
| prerunError: stagingResult?.error?.getDataAsString() ?? stagingResult?.value?.getError()?.getDataAsString(), | ||
|
|
||
| outputError: | ||
| result.error !== undefined | ||
| || ctx.error !== undefined | ||
| || result.value?.getError() !== undefined | ||
| || ctx.value?.getError() !== undefined, | ||
| runResult.error !== undefined | ||
| || prodUiCtx.error !== undefined | ||
| || runResult.value?.getError() !== undefined | ||
| || prodUiCtx.value?.getError() !== undefined, | ||
| outputsError: | ||
| result.error?.getDataAsString() ?? result.value?.getError()?.getDataAsString(), | ||
| exportsError: ctx.error?.getDataAsString() ?? ctx.value?.getError()?.getDataAsString(), | ||
| runResult.error?.getDataAsString() ?? runResult.value?.getError()?.getDataAsString(), | ||
| exportsError: prodUiCtx.error?.getDataAsString() ?? prodUiCtx.value?.getError()?.getDataAsString(), |
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 is duplicated logic for extracting error strings and determining if an error exists. Additionally, some properties are assigned the same computed value. This can be refactored to be more DRY (Don't Repeat Yourself) by using helper functions and intermediate variables. This improves readability and maintainability.
const getErrorString = (res: any) =>
res?.error?.getDataAsString() ?? res?.value?.getError()?.getDataAsString();
const hasError = (res: any) => res?.error !== undefined || res?.value?.getError() !== undefined;
const uiCtxError = getErrorString(prodUiCtx);
const runError = getErrorString(runResult);
prod = {
arguments: prodArgs,
stale: !argsEquals(currentArguments, prodArgs),
uiCtxError,
runError,
prerunError: getErrorString(stagingResult),
outputError: hasError(runResult) || hasError(prodUiCtx),
outputsError: runError,
exportsError: uiCtxError,| uiCtxError: info.prod?.uiCtxError, | ||
| runError: info.prod?.runError, | ||
| prerunError: info.prod?.prerunError, | ||
|
|
||
| outputErrors: info.prod?.outputError === true, | ||
| outputsError: info.prod?.outputsError, | ||
| exportsError: info.prod?.exportsError, |
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.
The new fields uiCtxError and runError appear to duplicate the information already present in exportsError and outputsError respectively. This redundancy could increase payload size and potentially confuse consumers of this data. If the new fields are intended to replace the old ones, it would be best to remove outputsError and exportsError. If backward compatibility is required, consider documenting which fields are preferred and when the old ones will be removed.
|
=======
|
No description provided.