From 218ad68c203b4c347666bdbd14f826ae2db3aef8 Mon Sep 17 00:00:00 2001 From: Calvin Yau Date: Wed, 23 Oct 2024 00:21:48 -0700 Subject: [PATCH 1/2] feat: Change errored uploads and uploads list text --- .../CommitCoverage/CommitCoverage.test.jsx | 2 +- .../ErroredUploads/ErroredUploads.jsx | 38 ++++++------------- .../ErroredUploads/ErroredUploads.test.jsx | 28 +++----------- .../UploadsCard/UploadsCard.test.tsx | 8 ++-- .../UploadsCard/UploadsCard.tsx | 2 +- .../Dropdowns/CommitCoverageDropdown.tsx | 2 +- 6 files changed, 24 insertions(+), 56 deletions(-) diff --git a/src/pages/CommitDetailPage/CommitCoverage/CommitCoverage.test.jsx b/src/pages/CommitDetailPage/CommitCoverage/CommitCoverage.test.jsx index c97dc44fa8..dbf42bcec6 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/CommitCoverage.test.jsx +++ b/src/pages/CommitDetailPage/CommitCoverage/CommitCoverage.test.jsx @@ -675,7 +675,7 @@ describe('CommitCoverage', () => { render(, { wrapper: wrapper({ queryClient }) }) const erroredUploads = await screen.findByText( - /The following uploads failed to process:/ + /No coverage data is available due to incomplete uploads on the first attempt./ ) expect(erroredUploads).toBeInTheDocument() }) diff --git a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx index 1ed08c1068..9029240620 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx +++ b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx @@ -1,37 +1,23 @@ import isEmpty from 'lodash/isEmpty' import PropTypes from 'prop-types' -import A from 'ui/A' - function ErroredUploads({ erroredUploads }) { return ( !isEmpty(erroredUploads) && ( - <> -

The following uploads failed to process:

- {Object.entries(erroredUploads)?.map(([provider, uploads]) => { - return ( -
-

{provider}

- {uploads?.map(({ buildCode, ciUrl, createdAt }) => { - return ( -
-

{buildCode}

- {ciUrl && ( - - view CI build - - )} -
- ) - })} -
- ) - })} +
+

+ No coverage data is available due to incomplete uploads on the first + attempt. +

+

+ To receive coverage data, ensure your coverage data is accurate and + then open a new commit. +

- We recommend checking the Codecov step of this commit's CI Run to - make sure it uploaded properly and, if needed, run your CI again. + Note: this page will not reflect the latest results, if you re-run all + jobs successfully or merge this commit.

- +
) ) } diff --git a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.test.jsx b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.test.jsx index 958ca682e8..e58eae738b 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.test.jsx +++ b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.test.jsx @@ -37,35 +37,17 @@ describe('ErroredUploads', () => { render() const message = screen.getByText( - /The following uploads failed to process:/ + /No coverage data is available due to incomplete uploads on the first attempt./ ) expect(message).toBeInTheDocument() }) - it('all providers involved', () => { - render() - - const circle = screen.getByText(/circleCI/) - expect(circle).toBeInTheDocument() - - const ghActions = screen.getByText(/github actions/) - expect(ghActions).toBeInTheDocument() - }) - - it('build code', () => { - render() - - const buildCode1 = screen.getByText(82364) - expect(buildCode1).toBeInTheDocument() - - const buildCode2 = screen.getByText(20374) - expect(buildCode2).toBeInTheDocument() - }) - it('recommendation text', () => { render() - const recommendationText = screen.getByText(/We recommend checking/) + const recommendationText = screen.getByText( + /To receive coverage data, ensure your coverage data is accurate and then open a new commit./ + ) expect(recommendationText).toBeInTheDocument() }) }) @@ -75,7 +57,7 @@ describe('ErroredUploads', () => { render() const message = screen.queryByText( - /The following uploads failed to process:/ + /No coverage data is available due to incomplete uploads on the first attempt./ ) expect(message).not.toBeInTheDocument() }) diff --git a/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.test.tsx b/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.test.tsx index 8562075d4a..ed85f7787a 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.test.tsx +++ b/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.test.tsx @@ -182,8 +182,8 @@ describe('UploadsCard', () => { it('renders the title', () => { render(, { wrapper }) - const uploads = screen.getByText(/Uploads/) - expect(uploads).toBeInTheDocument() + const covReportHistory = screen.getByText(/Coverage reports history/) + expect(covReportHistory).toBeInTheDocument() }) it('renders different cis', () => { render(, { wrapper }) @@ -237,7 +237,7 @@ describe('UploadsCard', () => { it('renders the title', () => { render(, { wrapper }) - const uploads = screen.getByText(/Uploads/) + const uploads = screen.getByText(/Coverage reports history/) expect(uploads).toBeInTheDocument() }) it('renders different cis', () => { @@ -264,7 +264,7 @@ describe('UploadsCard', () => { it('renders the title', () => { render(, { wrapper }) - const uploads = screen.getByText(/Uploads/) + const uploads = screen.getByText(/Coverage reports history/) expect(uploads).toBeInTheDocument() }) }) diff --git a/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.tsx b/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.tsx index 03a4197547..0a51e00c27 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.tsx +++ b/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.tsx @@ -44,7 +44,7 @@ function UploadsCard() {
- Uploads + Coverage reports history {/* @ts-expect-error */} setShowYAMLModal(true)} hook="open yaml modal"> view YAML file diff --git a/src/pages/CommitDetailPage/Dropdowns/CommitCoverageDropdown.tsx b/src/pages/CommitDetailPage/Dropdowns/CommitCoverageDropdown.tsx index e7cb6836f8..af16c280ce 100644 --- a/src/pages/CommitDetailPage/Dropdowns/CommitCoverageDropdown.tsx +++ b/src/pages/CommitDetailPage/Dropdowns/CommitCoverageDropdown.tsx @@ -21,7 +21,7 @@ const CoverageMessage: React.FC = () => { const comparison = data?.commit?.compareWithParent const uploadErrorCount = data?.uploadErrorCount - if (uploadErrorCount && uploadErrorCount > 0) { + if (!!uploadErrorCount) { if (uploadErrorCount === 1) { return ( <>{uploadErrorCount} upload has failed to process ⚠️ From 4a9387b613eaf6e0f1930b8df2c68974de1edfdb Mon Sep 17 00:00:00 2001 From: Calvin Yau Date: Wed, 23 Oct 2024 10:57:21 -0700 Subject: [PATCH 2/2] fix: modify copy --- .../CommitCoverage/ErroredUploads/ErroredUploads.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx index 9029240620..87cf0f5f17 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx +++ b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx @@ -14,8 +14,8 @@ function ErroredUploads({ erroredUploads }) { then open a new commit.

- Note: this page will not reflect the latest results, if you re-run all - jobs successfully or merge this commit. + Note: this page will not reflect the latest results, even if you have + re-run all jobs successfully or have merged this commit.

)