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

DEVPROD-10197: Implement broken versions warning on waterfall #438

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SupaJoon
Copy link
Contributor

@SupaJoon SupaJoon commented Oct 7, 2024

DEVPROD-10197

Description

Shows a badge on the waterfall and inactive/unmatching versions modal.

Screenshots

Screenshot 2024-10-07 at 5 03 18 PM
Screenshot 2024-10-07 at 5 03 27 PM

Evergreen PR

evergreen-ci/evergreen#8374

@SupaJoon SupaJoon added the spruce label Oct 7, 2024
@SupaJoon SupaJoon requested a review from a team as a code owner October 7, 2024 21:03
@@ -18,6 +19,11 @@ export const InactiveVersionsButton: React.FC<Props> = ({
containerHeight,
versions,
}) => {
const numBrokenVersions =
Copy link
Contributor

Choose a reason for hiding this comment

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

[super nit] We more commonly name our variables like brokenVersionsCount and I personally prefer that

@@ -46,7 +46,12 @@ export const WaterfallGrid: React.FC<WaterfallGridProps> = ({
version ? (
<VersionLabel key={version.id} size="small" {...version} />
) : (
Copy link
Contributor

@sophstad sophstad Oct 7, 2024

Choose a reason for hiding this comment

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

If you calculate the inactive version count here, then you can pass a value into each component (either the count or hasError) instead of having to both count and use the .some() function in two separate places

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the current code is a little cleaner. Since versions.inactiveVersions is an array, I would have to associate the versionCount with the fist versionId in the list and pass it through to BuildRow (I don't like the id association bit). Alternatively, I could update the typing for the inactiveVersions and include a field that flags if a broken version exists but I actually like how the the component accepts the exact GQL typing.

@SupaJoon SupaJoon requested a review from sophstad October 8, 2024 19:27
@SupaJoon
Copy link
Contributor Author

SupaJoon commented Oct 8, 2024

evergreen retry

apps/spruce/src/pages/waterfall/styles.ts Outdated Show resolved Hide resolved
@@ -4,7 +4,8 @@ import { wordBreakCss } from "components/styles";
import { size } from "constants/tokens";

const BUILD_VARIANT_WIDTH = 200;
const INACTIVE_WIDTH = 80;
const INACTIVE_WITHOUT_ERROR_WIDTH = 80;
const INACTIVE_WITH_ERROR_WIDTH = 160;
Copy link
Contributor

Choose a reason for hiding this comment

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

As mentioned above

Suggested change
const INACTIVE_WITH_ERROR_WIDTH = 160;
const INACTIVE_WITH_ERROR_WIDTH = 150;

@@ -63,3 +75,8 @@ const InactiveVersionLine = styled.div<{ containerHeight: number }>`
const StyledVersionLabel = styled(VersionLabel)`
padding-top: ${size.xs};
`;

const StyledBadge = styled(Badge)`
top: -${size.xs};
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] I know the designs have this slightly above the rest of the elements but I think positioning all the filters will be easier if it's inline with the top of VersionLabel with some padding between it and the button

{brokenVersionsCount > 0 && (
<StyledBadge data-cy="broken-versions-badge" variant={Variant.Red}>
{brokenVersionsCount} broken{" "}
{pluralize("version", brokenVersionsCount)}
Copy link
Contributor

@sophstad sophstad Oct 10, 2024

Choose a reason for hiding this comment

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

Sorry for not suggesting this earlier, but what do you think of omitting "versions" entirely (i.e. "1 Broken")? I don't think the phrasing is so helpful that it warrants taking away space from the useful columns on the page. Without it we could just have one fixed width for the InactiveVersion div I think.

@SupaJoon SupaJoon enabled auto-merge (squash) October 11, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants