Skip to content

Show what a review run cost in review text output - #1

Open
HarshitSharma14 wants to merge 2 commits into
mainfrom
review-text-cost
Open

HarshitSharma14 wants to merge 2 commits into
mainfrom
review-text-cost

Conversation

@HarshitSharma14

Copy link
Copy Markdown
Owner

Review copy of prooflinedev#119, opened in this fork so Proofline can review the change.

The review API returns each run's charge (cost_microcredits), the share
for review work (review_cost_microcredits) and what paid for it
(cost_funding) to organization members, but the text output dropped all
three. Only --json carried them, so a person on the free review month or
a capped plan could not see what a review spent without reading raw JSON,
and had nothing to size `scan --budget` against.

Review text now prints one line below the review link, for example:

  Cost: 2.75 credits (review 2.5, walkthrough 0.25); paid by: free review month 2.75

- Amounts are exact decimal credits from integer microcredits, never
  rounded or converted through floats.
- A pending or running review reports its cost "so far".
- The walkthrough share appears only when it is positive; parts that
  paid nothing are left out.
- A caller the server hides the cost from, or an older server, gets no
  line. A cost value the CLI cannot read is treated as absent, so it
  never fails the review read; --json keeps the API's value unchanged.

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Proofline has 1 new finding to review.

View full review in Proofline

Comment thread src/render.rs Resolved
The split guard dropped a review share at or above the total, but not
one below zero. A negative review_cost_microcredits then printed a
negative review cost and a walkthrough cost larger than the total.
Show the split only when the review share lies within the total; the
total itself still prints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant