-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(frontend/ingestion): Support flagged / warning / connection failure statuses; add recipe #8920
feat(frontend/ingestion): Support flagged / warning / connection failure statuses; add recipe #8920
Conversation
const isOutputExpandable = output.length > 100; | ||
|
||
const recipeJson = data?.executionRequest?.input.arguments?.find((arg) => arg.key === 'recipe')?.value; | ||
const recipeYaml = recipeJson && YAML.stringify(JSON.parse(recipeJson), 8, 2); |
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.
do we need error handling here? maybe fallback to raw string if json parsing fails?
<ShowMoreButton type="link" onClick={() => setShowExpandedLogs(!showExpandedLogs)}> | ||
{showExpandedLogs ? 'Hide' : 'Show More'} | ||
</ShowMoreButton> | ||
)} | ||
</Typography.Paragraph> | ||
</LogsSection> | ||
{recipe && ( | ||
<RecipeSection> |
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'm very excited for this
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.
w00000hoooo
(status === FAILURE && 'red') || | ||
(status === CONNECTION_FAILURE && 'crimson') || |
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.
probably want to refactor this to be a map of status -> {color, text, icon} and then make all of these methods just to a map lookup
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, would be a nice follow-up
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.
+1
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.
LGTM
want to get chris's eyes on this too
try { | ||
recipeYaml = recipeJson && YAML.stringify(JSON.parse(recipeJson), 8, 2); | ||
} catch (e) { | ||
recipeYaml = ''; |
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.
we can also just fall back to
recipeYaml = ''; | |
recipeYaml = recipeJson; |
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'd probably want to alter the expanding logic if I supported this, so going to hold off on making this change for simplicity. If this is a common occurrence we can revisit
@@ -40,7 +43,10 @@ export function getPlaceholderRecipe(ingestionSources: SourceConfig[], type?: st | |||
|
|||
export const RUNNING = 'RUNNING'; | |||
export const SUCCESS = 'SUCCESS'; | |||
export const FLAGGED = 'FLAGGED'; |
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 does flagged mean?
export const FAILURE = 'FAILURE'; | ||
export const CONNECTION_FAILURE = 'CONNECTION_FAILURE'; |
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.
really happy to finally see us adding more rich statuses.
we are doing the same in datahub-monitors-service when running a test. we should align on the error types where possible.
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! the code looks solid. as far as UX goes I'd vote for making the recipe section expandable to show or hide the whole section as opposed to always showing a truncated recipe (since some users won't care about the recipe)
I could be overruled though and don't feel too strongly here
<ShowMoreButton type="link" onClick={() => setShowExpandedLogs(!showExpandedLogs)}> | ||
{showExpandedLogs ? 'Hide' : 'Show More'} | ||
</ShowMoreButton> | ||
)} | ||
</Typography.Paragraph> | ||
</LogsSection> | ||
{recipe && ( | ||
<RecipeSection> | ||
<SectionHeader level={5}>Recipe</SectionHeader> |
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 feel like this whole recipe should be hidden by default and expanded only if they care to see it, as opposed to showing a truncated recipe with ...
inside of the code block for the recipe itself that you show more or less of - which feels weird itself tbh (even though we do that with logs above it)
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.
maybe we can make it more like the "Advanced" section at the end of defining a recipe with a toggle button to the side of the title "Recipe" (which could remain the same styling as you have now) that would show or hide the whole recipe section, so users who don't care about the recipe don't see it at all
![image](https://private-user-images.githubusercontent.com/28656603/276011752-b9216ebc-dec8-4490-9c81-2ebc807d7989.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI1OTI1NzUsIm5iZiI6MTcyMjU5MjI3NSwicGF0aCI6Ii8yODY1NjYwMy8yNzYwMTE3NTItYjkyMTZlYmMtZGVjOC00NDkwLTljODEtMmViYzgwN2Q3OTg5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAyVDA5NTExNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUyNGQ2MDJkZmZlMjM0NDE5NGEzOTJjMDA2ODBmZTA5ZmNhMjFiYjk4YmVhN2IyZTFlMGExMDFhYmU5NGQ5MGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.B2bbYw5Mt69Pcb453nO-UCyIOIZ2QPbistpOsf8qH0Y)
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.
alternatively to hiding the whole section, I'd like to show less of the recipe so that it doesn't show so much right away like i'm seeing in your screenshot (seems like we show 75% of the recipe right away and takes up much more room than the logs part)
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'm happy to do either, just not sure the best way to do the styling... like the > Advanced
is pretty clear it's expandable but how to do the same for the recipe section lol.
I am showing exactly 10 lines of the recipe right now. I'll just drop that down to 1-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.
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.
much better!
<SectionSubHeader> | ||
<SubHeaderParagraph type="secondary"> | ||
The recipe used for this ingestion run. | ||
</SubHeaderParagraph> | ||
</SectionSubHeader> | ||
<Typography.Paragraph ellipsis> | ||
<pre>{`${recipe}${!showExpandedRecipe && isRecipeExpandable ? '\n...' : ''}`}</pre> | ||
</Typography.Paragraph> | ||
{isRecipeExpandable && ( | ||
<ShowMoreButton type="link" onClick={() => setShowExpandedRecipe((v) => !v)}> | ||
{showExpandedRecipe ? 'Hide' : 'Show More'} | ||
</ShowMoreButton> | ||
)} | ||
</RecipeSection> | ||
)} |
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'd advocate for bringing this out into its own small component and we could put shared styled components in a shared file or something
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.
Considering the other sections aren't in their own components, and this component isn't really reusable, I'd rather leave this as is. Eventually I think we'll redesign this entire modal so I don't feel as bad about leaving this like this
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 mean that's fine, but in general just because other pieces aren't broken out into their own components doesn't mean we can't write cleaner frontend code going forward.
6c56da4
to
f7e20f9
Compare
Prepares frontend to be able to render new ingestion statuses. I was going to put these statuses in the metadata model, but that seems kind of committal. I make two changes to the existing statuses on the frontend:
Also adds a recipe section because I want this all the time when debugging.
Checklist