import React from 'react'; import { Illustration } from '@spinnaker/presentation'; import { GitLink } from './GitLink'; import { LabeledValue } from '../../../presentation'; import { logger } from '../../../utils'; import type { ICurrentVersion, IVersionDetails, IVersionRelativeAgeToCurrent } from './utils'; import { extractVersionRollbackDetails } from './utils'; import type { IArtifactActionModalProps } from '../../utils/ActionModal'; import { ActionModal } from '../../utils/ActionModal'; import { getDocsUrl } from '../../utils/defaults'; import './ArtifactActionModal.less'; const MARK_BAD_DOCS_URL = getDocsUrl('markAsBad'); const PINNING_DOCS_URL = getDocsUrl('pinning'); const CLASS_NAME = 'ArtifactActionModal'; export interface IVersionActionsProps { application: string; environment: string; reference: string; version: string; selectedVersion: IVersionDetails; isPinned: boolean; isVetoed?: boolean; isCurrent?: boolean; } const VersionDetails = ({ buildNumber, commitMessage, commitSha, title }: IVersionDetails & { title: string }) => { return (
{isCurrent ? ( `Pinning ensures an environment uses a specific version, even if Spinnaker would've normally deployed a different one. New versions won't be deployed until you unpin this version.` ) : ( <> Rolling {rollingType} will:
Version #{buildNumber} is already live and no actions will be take immediately
) : (When you unpin this version from {environment.toUpperCase()}, Spinnaker will use the latest version that's approved for deployment. For more information,{' '} logger.log({ category: 'Environments - unpin version modal', action: 'Pinning docs link clicked', data: { label: application, application }, }) } href={PINNING_DOCS_URL} > Check out our documentation .
{isCurrent ? `Spinnaker will immediately deploy the latest version approved for deployment to ${environment}. Version #${buildNumber} will be rejected and will not be deployed again` : `This action will reject version ${buildNumber} and Spinnaker will not be deploy it to ${environment}. This will not affect the live version`} . For more information,{' '} logger.log({ category: 'Environments - mark version as bad modal', action: 'Mark as bad docs link clicked', data: { label: application, application }, }) } href={MARK_BAD_DOCS_URL} > Check out our documentation .
This action will allow Spinnaker to deploy this version again. If this is the latest version, it will be deployed immediately.