codecov / engineering-team

This is a general repo to use with GH Projects
1 stars 1 forks source link

Improve Behavior and Consistency of Report Processing Logic Across PR comment and App (Commit and PR) #2400

Closed codecovdesign closed 2 weeks ago

codecovdesign commented 2 months ago

Problem to Solve

When report processing fails on a pull request, the failure is currently only visible in the commits section. Users may not be aware that they need to check commits for this information, leading to confusion and missed insights.

Image

Image

Proposed Solution

Update Codecov’s PR comment messaging to display a clear indication of report processing failures directly on the PR page.

areas for investigation:

codecovdesign commented 2 months ago

raised at audit, marking as bug, as pointed out per the user expectation is unexpected

codecovdesign commented 2 months ago

sync with Eli on 8/29

codecovdesign commented 2 months ago

related issue under review here: https://github.com/codecov/engineering-team/issues/2442 this is related since the contextualized state there when incomplete information is show for a different but related scenario. if we'd like to show partial information, we could follow this pattern.

codecovdesign commented 1 month ago

related: https://github.com/codecov/engineering-team/issues/1245 in this case situation that would be helpful if we knew the amount of uploads processing

codecovdesign commented 1 month ago

sync on 9/10

RulaKhaled commented 1 month ago

Upload Error Behavior on the Commit Page:

What happens?

  1. We retrieve the uploads from commitData?.commit?.uploads.
  2. We check if there is at least one upload with an error state.
  3. If an error is found, we display an error message by grouping the uploads under their respective unique providers.
  4. For each error, we show the build code, CI URL, and the timestamp of when the upload was created.

How does it work?

  1. We loop through the upload states.
  2. If the upload state is set to error, we group the uploads by provider, where the key is the provider and the value is the associated uploads.

These are the expected upload states:

export const UploadStateEnum = {
  error: 'ERROR',
  uploaded: 'UPLOADED',
  processed: 'PROCESSED',
  complete: 'COMPLETE',
  started: 'STARTED',
} as const;

TLDR: On the commit page, if any upload has an error state, we display the error message immediately. We skip checking for other states once an error is detected, focusing solely on the error state for that upload.

RulaKhaled commented 1 month ago

To answer the question:

Will this page update if the CI build is triggered for the same commit?

No, the page will not update because we still account for the existing upload error. As long as the error persists, the error state will remain displayed. If the user submits a different commit with no upload errors, it will be processed as usual. The issue here is not related to the "processing" state but rather how the application handles errors.

We should consider what behavior is expected if there is one processing error. Should we display partial data in such cases? Currently, if part of the data is not successful, no data is shown at all.

Lmk if you have any specific questions!

Adal3n3 commented 1 month ago

According to @thomasrockhu-codecov, unfortunately we can not support the re-run all jobs to show the latest job in the UI. I think we can use "history" or "Version" at the list of commits and list of pull pages to indicate the data is from the initial run so if you rerun the commit/job, you will be looking at the recorded history of the commit. (Related to issue #2220)

Maybe we can reuse the page header and description for this message. Wdyt of this solution @codecovdesign? Image

Update from sync 9/24: we consider not show this in the commits page but focus on the individual commit details page.

codecovdesign commented 1 month ago

We should consider what behavior is expected if there is one processing error. Should we display partial data in such cases? Currently, if part of the data is not successful, no data is shown at all.

@Adal3n3 from some of the ongoing work, is there an initial iteration that will help with this scenario? (indicating this has processing issue occurred)

also added a sync for next week we can talk then too

codecovdesign commented 1 month ago

sync on 9/24 with @RulaKhaled @Adal3n3 @nora-codecov

nora-codecov commented 1 month ago

Tom helped me set up a test branch with an erroneous upload, so we can see and test conditions

on codecov

Image

the pr on gh

Image

current experience

The thing that's confusing me is that the notification (pr comment) we want exists, but it's not being returned as the pr comment when there's an upload error, and I don't know why. Here's what I found:

can we tell that we are processing uploads or the number we are processing, and surface that to the user

RulaKhaled commented 1 month ago

what is our logic/behavior for BOTH the pr comment and app pulls page when the head commit has errors

Confirmed that we do show partial data, we don't account for the errored upload

nora-codecov commented 1 month ago

added notify: notify_error: true and got the pr comment!

Image

you can see it here

nora-codecov commented 1 month ago

Joey actually did this work at the time but never finalized and merged the prs, which would make this the default behavior for new repos going forward: https://github.com/codecov/shared/pull/320 and https://github.com/codecov/worker/pull/601

nora-codecov commented 1 month ago

can we tell that we are processing uploads or the number we are processing, and surface that to the user

I think this answers all the investigation questions, let me know if you need anything else ☂

codecovdesign commented 1 month ago

now that we confirmed the behavior states, next is to the question of what we want to do (to show partial or not to show)

Next step, we'll have a debrief sync just to discuss these finding and close out the issue for planning


From group review with @Adal3n3 @aj-codecov @eliatcodecov @nora-codecov

update to move forward with: