Skip to content
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

Create foundation for a controller status history view #1402

Merged

Conversation

kiahna-tucker
Copy link
Member

@kiahna-tucker kiahna-tucker commented Dec 16, 2024

Issues

The issues directly below are advanced by this PR:
#1377

Changes

1377

The following features are included in this PR:

  • Create an environment variable for the base /status endpoint URL.

  • Add a declaration file for control-plane types relevant to the /status endpoint.

  • Add a Status section to the Logs tab of the Details page which serves as the foundation for comprehensive entity status view.

  • Update the shared CardWrapper component to support a headerless display.

Tests

Manually tested

  • scenarios you manually tested

Automated tests

  • unit testing covered

Playwright tests ran locally

  • Admin
  • Captures
  • Collections
  • HomePage
  • Login
  • Materialization

Screenshots

Initialization

Hydration failed | Error returned by /status endpoint

pr_screenshot-1402-entity_status_foundation-error-hydration

Post-Initialization

Dashboard view

pr_screenshot-1402-entity_status_foundation-success-history

Code view

pr_screenshot-1402-entity_status_foundation-success-code

No controller status history returned by /status endpoint

pr_screenshot-1402-entity_status_foundation-success-no_history

Updating the view via the Refresh CTA | Table View

pr_screenshot-1402-entity_status_foundation-success-refreshing



@kiahna-tucker kiahna-tucker added the change:planned This is a planned change label Dec 16, 2024
@kiahna-tucker kiahna-tucker marked this pull request as ready for review January 14, 2025 14:14
@kiahna-tucker kiahna-tucker requested a review from a team as a code owner January 14, 2025 14:14
@kiahna-tucker kiahna-tucker requested a review from psFried January 14, 2025 16:02
{intl.formatMessage({ id: headerMessageId })}
</Typography>

{Hydrating ?? children}
Copy link
Member

Choose a reason for hiding this comment

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

Whenever there is a capitalized props like Hydrating I assume it takes in a functional component and used like

<Hydrating {...whatever props you might need}/>

In this scenario it looks like all 3 uses of this are passing in a skeleton with different sizes. I think we should just pass in the sizing they want and then this component itself can handle checking hydration.

accessToken: string,
catalogName: string
): Promise<EntityStatusResponse[]> =>
client(`${entityStatusBaseEndpoint}?name=${catalogName}`, {}, accessToken);
Copy link
Member

Choose a reason for hiding this comment

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

I think probably best to do it here - but we need to make sure catalogName is safe / escaped. Normally we have used escapeReservedCharacters but that is really for PostgREST so not 100% sure what we wanna do here.

Comment on lines +27 to +36
timestamp: `${lastUpdated.toLocaleString({
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
timeZoneName: 'short',
})}, ${lastUpdated.toLocaleString({
day: '2-digit',
month: '2-digit',
year: 'numeric',
})}`,
Copy link
Member

Choose a reason for hiding this comment

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

Can we split out the settings used to "translate" these so they can be shared?

Comment on lines +49 to +71
defaultLanguage="json"
height={EDITOR_HEIGHT}
onMount={(
editor: monacoEditor.editor.IStandaloneCodeEditor
) => {
logRocketConsole('handlers:mount');
editorRef.current = editor;
}}
options={{
readOnly: true,
minimap: {
enabled: false,
},
}}
path={
hasLength(response.catalog_name)
? response.catalog_name
: 'preset_status_path'
}
saveViewState={false}
theme={theme.palette.mode === 'light' ? 'vs' : 'vs-dark'}
value={stringifyJSON(response)}
/>
Copy link
Member

Choose a reason for hiding this comment

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

Sometime we should make a shard "default props" kinda thing for editor

Copy link
Member Author

@kiahna-tucker kiahna-tucker Jan 16, 2025

Choose a reason for hiding this comment

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

Agreed. I had a similar thought when I created this component.

Comment on lines +11 to +27
{row.detail ? (
<ControllerStatus detail={row.detail} status={row.result} />
) : (
<TableCell />
)}

{row.created ? (
<TimeStamp enableExact time={row.created} />
) : (
<TableCell />
)}

{row.completed ? (
<TimeStamp enableExact time={row.completed} />
) : (
<TableCell />
)}
Copy link
Member

Choose a reason for hiding this comment

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

This is really interesting... our tables (and all the "helper" functions/components) really are focused on tables with data that is always there.

Copy link
Member Author

Choose a reason for hiding this comment

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

The desired entity status UI and UX is still largely up-in-the-air. Nevertheless, it is worth noting that this status indicator component resembles that used in the entity status overview cards. There is a chance the latter may diverge widely enough that is does not make sense to try to share code but, presently, I believe that is unlikely.

Copy link
Member Author

Choose a reason for hiding this comment

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

This file has grown to a point where it would be worthwhile to reassess its organization and whether it should be broken apart.

Copy link
Member Author

Choose a reason for hiding this comment

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

The component and broad UX is, effectively, temporary. It was the fastest means to surface the errors that correspond to an individual controller event presented in the table.

Copy link
Member

Choose a reason for hiding this comment

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

Adding this new URL brings me a thought... we should eventually review all the env props and make a decision on which ones are mandatory.

I know people are not running Estuary on their own but it would be nice to have that all set up just in case.

Copy link
Member

@travjenkins travjenkins left a comment

Choose a reason for hiding this comment

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

lgtm

left some notes and comments but do not see anything that is a blocker.

Copy link
Member

@travjenkins travjenkins left a comment

Choose a reason for hiding this comment

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

lgtm

@travjenkins travjenkins merged commit 6327adc into main Jan 21, 2025
3 checks passed
@travjenkins travjenkins deleted the kiahna-tucker/entity-status/init-controller-status-history branch January 21, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:planned This is a planned change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants