Page MenuHomePhorge

Audit Feed: less verbose when the author is the committer
ClosedPublic

Authored by valerio.bozzolan on Aug 28 2023, 12:09.
Tags
None
Referenced Files
F2694375: D25421.1734781059.diff
Fri, Dec 20, 11:37
F2694371: D25421.1734780735.diff
Fri, Dec 20, 11:32
F2694358: D25421.1734779656.diff
Fri, Dec 20, 11:14
F2694341: D25421.1734779001.diff
Fri, Dec 20, 11:03
F2693907: D25421.1734770601.diff
Fri, Dec 20, 08:43
F2693906: D25421.1734770601.diff
Fri, Dec 20, 08:43
F2693905: D25421.1734770599.diff
Fri, Dec 20, 08:43
F2693904: D25421.1734770599.diff
Fri, Dec 20, 08:43

Details

Summary

If the author and the committer are the same person, do not show them twice.

From:

UsernameFoo committed <commit hash>: <commit msg> (authored by UsernameFoo).

To:

UsernameFoo committed <commit hash>: <commit msg>

This only affects the feed.

BeforeAfter
Committer Feed before D25421.png (836×1 px, 152 KB)
Committer Feed after D25421.png (836×1 px, 140 KB)

Closes T15528

Test Plan

Do some mixed commits and visit /feed/query/all/. No nuclear implosions.

Diff Detail

Repository
rP Phorge
Branch
audit-fix-author-twice
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 809
Build 809: arc lint + arc unit

Event Timeline

valerio.bozzolan retitled this revision from Audit: do not show same author twice in Feed to Audit Feed: less verbose when the author is the committer.Aug 28 2023, 13:37
src/applications/audit/storage/PhabricatorAuditTransaction.php
341–345

✅ This is the supposed non-empty check for a PHID. See line 323.

speck subscribed.

Basically it works

😂

Great QoL change, thank you! I just had one thing to consider but leave it you to you to address or not before landing.

src/applications/audit/storage/PhabricatorAuditTransaction.php
341–345

What do you think of merging this logic above with the existing checks on author and committer?

This revision is now accepted and ready to land.Nov 4 2023, 15:07
src/applications/audit/storage/PhabricatorAuditTransaction.php
341–345

Thanks speck. I tried for some minutes but failing.

Any idea?

src/applications/audit/storage/PhabricatorAuditTransaction.php
341–345

Tried again refactoring, without success 🤔 Uhm. Need some sleep and/or help.

src/applications/audit/storage/PhabricatorAuditTransaction.php
322–346

This is what I was thinking but after taking further look I think I prefer the version you have.

Small improvement thanks to review tip

(Hide all inline comments or this is unreadable)

Thanks for the tip. Maybe better now?

(This was already approved but I wait for another "Yeah land" since I changed a thing)

Minor, just suggestion

src/applications/audit/storage/PhabricatorAuditTransaction.php
343

This reads a little strange now. I think this check is fine to remain as “if author”

avoid micro-optimizations that make this unreadable