8000 PR feedback (feature overview) · Issue #478 · code-pushup/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
PR feedback (feature overview) #478
Closed
@matejchalk

Description

@matejchalk

User story

As a user, I want to get feedback on my pull requests, which tells me how the proposed changes will impact my Code PushUp reports. Specifically, I want a comment to be posts a report diff summary in Markdown. The diff should list which categories and audits have improved or regressed, and by how much.

As a paying customer, I also want to view the full diff in the portal UI. The PR comment should include a link to the portal diff page. I also want to be able to access this diff from the portal directly, by selecting source and target Git refs (branches/commits/tags).

Architecture

Free version

graph TD;
  user(["🤓 User"])
  pr(["📑 Pull Request"])
  comment(["🗨️ PR comment"])

  user -- creates --> pr
  user -- "👁️‍🗨️ views" --> comment
  pr -- triggers --> ghAction
  postComment -- creates --> comment

  subgraph ghAction ["🏗️ code-pushup/github-action"]

  collectSrc[["git checkout $GITHUB_HEAD_REF\ncode-pushup collect"]]
  collectTgt[["git checkout $GITHUB_BASE_REF\ncode-pushup collect"]]
  compare[["code-pushup compare source-report.json target-report.json"]]
  postComment[["github.issues.createComment({ ... })"]]

  srcReport("source-report.json")
  tgtReport("target-report.json")
  diffJson("reports-diff.json")
  diffMd("reports-diff.md")

  collectSrc --> srcReport
  collectTgt --> tgtReport
  srcReport & tgtReport --> compare
  compare --> diffJson & diffMd
  diffMd --> postComment
  
  end
Loading

Paid version

graph TD;
  user(["🤓 User"])
  pr(["📑 Pull Request"])
  comment(["🗨️ PR comment"])
  ghAction{{"🏗️ code-pushup/github-action"}}
  portal[("🌈 Portal")]

  user -. "💰 pays for" .-> portal
  user -- creates --> pr
  user -- "👁️‍🗨️ views" --> comment
  pr -- triggers --> ghAction
  ghAction -- "🗘 uploads to\n& downloads from" --> portal
  ghAction -- creates --> comment
  comment -- "🔗 links to" --> portal
Loading

The GitHub Action will accept optional parameters for interacting with portal. The flow will then differ from the free version in a few ways:

  • Since it's likely that the target branch (e.g. main) already has an uploaded report, we can download it from the portal API instead of running collect again. This report caching should speed up CI runs.
  • Because we want the reports to be accessible in the portal as well (primarily via link in PR comment), all reports collected by the GitHub Action are also uploaded to the portal (autorun instead of collect).
  • The Markdown comment will have an additional link added, for accessing the full diff in the portal.

In order to compare any two reports by branch/commit/etc., the portal API will implement the diffing logic as well. In this case, the diff could be more complex, e.g. to compare which issues were introduced or fixed (would be too much detail to include in MD comment).

Acceptance criteria

Free features:

Paid features:

  • portal
    • code-pushup/portal#268
    • code-pushup/portal#332
    • Report download in portal-client
    • code-pushup/portal#376
  • CLI and other

Follow-up improvements

  • use report artifact as cache

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0