Skip to content

Conversation

@AStaroverov
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Nov 27, 2025

🦋 Changeset detected

Latest commit: d2911c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@milaboratories/pl-middle-layer Patch
@platforma-sdk/test Patch

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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Granular Error Reporting: Introduced specific error fields (uiCtxError, runError, prerunError) within the ProdState type to provide more detailed insights into production-related issues, moving beyond a single boolean outputError.
  • Staging Output Error Integration: Errors originating from the staging output (stagingOutput) are now explicitly captured and exposed in the project overview, allowing for better diagnostics of pre-run failures.
  • Refactored Error Handling Logic: The projectOverview function has been updated to retrieve and process these new granular error types from prodUiCtx, prodOutput, and stagingOutput, ensuring they are reflected in the project's production state.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines 113 to 137
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(),
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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,

Comment on lines 266 to 272
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,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

@AStaroverov AStaroverov requested a review from dbolotin November 27, 2025 11:52
@AStaroverov
Copy link
Contributor Author

=======
if (cInputs !== undefined) {
const stagingResult = prj.getField({
field: projectFieldName(id, 'stagingOutput'),
assertFieldType: 'Dynamic',
stableIfNotFound: true,
});

      staging = {
        arguments: currentArguments,
        outputError: stagingResult?.error !== undefined || stagingResult?.value?.getError() !== undefined,
        outputsError: stagingResult?.error?.getDataAsString() ?? stagingResult?.value?.getError()?.getDataAsString(),
      };
    }

Stashed changes

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants