Skip to content

Commit

Permalink
fix(core/managed): temporarily hide build pre-deployment events (#8776)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Munson committed Dec 9, 2020
1 parent 7a723c9 commit 8a86981
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 9 additions & 1 deletion app/scripts/modules/core/src/managed/ArtifactDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ import { isResourceKindSupported } from './resources/resourceRegistry';

import './ArtifactDetail.less';

const SUPPORTED_PRE_DEPLOYMENT_TYPES = [
// KLUDGE WARNING: disabling build events temporarily while we get the API in shape
// 'BUILD',
'BAKE',
];

function shouldDisplayResource(reference: string, resource: IManagedResourceSummary) {
return isResourceKindSupported(resource.kind) && reference === resource.artifact?.reference;
}
Expand Down Expand Up @@ -246,7 +252,9 @@ export const ArtifactDetail = ({
const createdAtTimestamp = useMemo(() => createdAt && DateTime.fromISO(createdAt), [createdAt]);

// These steps come in with chronological ordering, but we need reverse-chronological orddering for display
const preDeploymentSteps = lifecycleSteps?.filter(({ scope }) => scope === 'PRE_DEPLOYMENT').reverse();
const preDeploymentSteps = lifecycleSteps
?.filter(({ scope, type }) => scope === 'PRE_DEPLOYMENT' && SUPPORTED_PRE_DEPLOYMENT_TYPES.includes(type))
.reverse();

return (
<>
Expand Down
8 changes: 7 additions & 1 deletion app/scripts/modules/core/src/managed/ArtifactsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ function getArtifactStatuses({ environments, lifecycleSteps }: IManagedArtifactV

const preDeploymentSteps = lifecycleSteps?.filter(
({ scope, type, status }) =>
scope === 'PRE_DEPLOYMENT' && ['BUILD', 'BAKE'].includes(type) && ['RUNNING', 'FAILED'].includes(status),
scope === 'PRE_DEPLOYMENT' &&
[
// KLUDGE WARNING: disabling build events temporarily while we get the API in shape
// 'BUILD',
'BAKE',
].includes(type) &&
['RUNNING', 'FAILED'].includes(status),
);

if (preDeploymentSteps?.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { Application } from '../application';
import { StatusCard } from './StatusCard';
import { Button } from './Button';

const SUPPORTED_TYPES = ['BUILD', 'BAKE'];

const cardAppearanceByStatus = {
NOT_STARTED: 'future',
RUNNING: 'info',
Expand Down Expand Up @@ -93,10 +91,6 @@ export interface PreDeploymentStepCardProps {
export const PreDeploymentStepCard = memo(({ step, application, reference }: PreDeploymentStepCardProps) => {
const { type, status, startedAt, completedAt, link } = step;

if (!SUPPORTED_TYPES.includes(type)) {
return null;
}

const { iconName, title } = cardConfigurationByType[type];

return (
Expand Down

0 comments on commit 8a86981

Please sign in to comment.