From 214dbbf06796de9be56c6e5c93e6cd5ca409727a Mon Sep 17 00:00:00 2001 From: Andrei Stepanov Date: Tue, 19 Mar 2024 16:02:36 +0100 Subject: [PATCH] Waiving Signed-off-by: Andrei Stepanov --- src/actions/index.tsx | 10 +++++++--- src/components/WaiveForm.tsx | 2 +- src/types.ts | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/actions/index.tsx b/src/actions/index.tsx index dd54a7a0..180d6b56 100644 --- a/src/actions/index.tsx +++ b/src/actions/index.tsx @@ -132,13 +132,17 @@ export const submitWaiver = (reason: string, client: ApolloClient) => { let waiveError: string; const { artifact, ciTest } = getState().waive; const testcaseName = ciTest?.name; - if (_.isNil(_.get(artifact, 'payload.nvr')) || _.isNil(testcaseName)) { - return; - } // NOTE: We know that artifact.payload is not null thanks to the check at the // top of the function. Moreover, we know that payload has the nvr property, // so we assert the type of the payload here. const nvr = getANvr(artifact!); + if (_.isNil(nvr) || _.isNil(testcaseName)) { + const waiveError = `Cannot submit waiver for: ${nvr}, ${testcaseName}`; + dispatch( + waiveSlice.submitWaiver({ waiveError, reason: 'bad call' }), + ); + return; + } if (!nvr) { waiveError = 'Could not get NVR, please contact support.'; dispatch(waiveSlice.submitWaiver({ waiveError, reason: '' })); diff --git a/src/components/WaiveForm.tsx b/src/components/WaiveForm.tsx index 6a4c0cdc..064b70a7 100644 --- a/src/components/WaiveForm.tsx +++ b/src/components/WaiveForm.tsx @@ -83,7 +83,7 @@ const WaiveForm: React.FC<{}> = () => { const agreementLabel = 'I agree and acknowledge the above information'; const metadataAggrementText = waiver.ciTest?.waiveMessage; - const agreementText = `Waiving test results may have an impact on the RHEL release process. Broken builds can lead to broken RHEL + const agreementText = `You should have active kerberos session. Waiving test results may have an impact on the RHEL release process. Broken builds can lead to broken RHEL composes and unverified or failed builds can cause issues in system integration. Before waiving these tests it is good to check other possible options, in particular some CI-systems can fail due to outages and different circumstances. It is good to restart the test or to contact CI-owners for assistance. Proceed waiving test-result only when other efforts have not succeeded.`; diff --git a/src/types.ts b/src/types.ts index d9aa9c6f..c90d4e71 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1267,6 +1267,9 @@ export const getANvr = (artifact: Artifact): string | undefined => { if (isArtifactRpm(artifact)) { return _.get(artifact, 'hit_source.nvr'); } + if (isArtifactMbs(artifact)) { + return _.get(artifact, 'hit_source.nvr'); + } }; export const getATaskid = (artifact: Artifact): string | undefined => {