Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pr checks: avoid deduplicating same-named checks under different workflows #5919

Merged
merged 3 commits into from Jul 12, 2022

Conversation

mislav
Copy link
Contributor

@mislav mislav commented Jul 11, 2022

Our checks de-duplication logic was a bit too overzealous in a way that it would squash same-named checks coming from different workflows under the same entry in gh pr checks output.

Bonus: this also adds workflowName for Checks and startedAt for Statuses in gh pr view --json statusCheckRollup output.

Fixes #5898

TODO:

  • Since workflow name is an important piece of checks information that we previously omitted from gh pr checks output, should we consider prepending the workflow name to checks name, like the web interface already does? This could be either in this PR or as follow-up.

@mislav mislav requested a review from a team as a code owner July 11, 2022 16:20
@mislav mislav requested review from samcoe and removed request for a team July 11, 2022 16:20
@cliAutomation cliAutomation added this to Needs review 🤔 in The GitHub CLI Jul 11, 2022
The GitHub CLI automation moved this from Needs review 🤔 to Needs to be merged 🎉 Jul 11, 2022
Copy link
Contributor

@vilmibm vilmibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Since workflow name is an important piece of checks information that we previously omitted from gh pr checks output, should we consider prepending the workflow name to checks name, like the web interface already does? This could be either in this PR or as follow-up.

I'm in favor of this. It's up to you if you want to do it now or in a follow-up.

Copy link
Contributor

@samcoe samcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the code looks good. I do think we should prepending the workflow name to checks name, but can be done in a follow up PR. My only concern here is the addition of the gojsondiff package.

@@ -9,6 +9,8 @@ import (
"github.com/MakeNowJust/heredoc"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
diff "github.com/yudai/gojsondiff"
Copy link
Contributor

@samcoe samcoe Jul 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems a bit heavy handed to require a new library just for a single test... I am wondering if there is an easier way to make the same assertions without requiring adding a whole new library to the project? Additionally, the library doesn't seem to be actively maintained which is a bit concerning.

@mislav mislav enabled auto-merge (squash) July 12, 2022 09:39
@mislav mislav merged commit dea1af1 into trunk Jul 12, 2022
The GitHub CLI automation moved this from Needs to be merged 🎉 to Pending Release 🥚 Jul 12, 2022
@mislav mislav deleted the pr-checks-deduplicate-fix branch July 12, 2022 09:48
@github-actions github-actions bot moved this from Pending Release 🥚 to Done 💤 in The GitHub CLI Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
The GitHub CLI
  
Done 💤
Development

Successfully merging this pull request may close these issues.

GH CLI and Site are not consistent about PR checks
3 participants