Show the favicon as passing when peer review is the only failing check - #369
Merged
Conversation
GitHub serves a favicon per check state and swaps its own link between them, so this points the link at the asset GitHub already has rather than drawing a replacement. Fetching and re-encoding an icon is what leaves a tab showing the browser's default globe when any step of that chain fails. The verdict logic moves to its own module so the favicon and the commit rows share one cache and, more importantly, one decision about what counts as failing. Duplicating that would be two places to get a wrong green wrong.
NicolasBonet
approved these changes
Aug 7, 2026
Contributor
|
@roryabraham we need to fix conflicts |
Contributor
Author
|
@NicolasBonet conflicts resolved |
Contributor
|
🚀 Released in version 1.5.53 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed Issues
For https://github.com/Expensify/Expensify/issues/668743
Problem
#368 fixed the per-commit indicators in a PR's history, but the tab's favicon has the same problem. GitHub shows a red X in the favicon while a PR's checks are failing, and since the org-wide ruleset started triggering verifyPeerReview.yml, that X is there from the moment the PR opens until someone reviews it
Solution
Point the favicon link at the passing icon GitHub already serves when the only check holding the PR back is one we ignore.
That last part matters. GitHub keeps a favicon per state (
favicon-failure,favicon-success,favicon-pending, in both.svgand.png) and swaps its ownlink.js-site-faviconbetween them — the SVG link even carriesdata-base-hreffor exactly that. So this is a one-attribute change to a URL GitHub is already serving.src/js/lib/checkStatusVerdicts.js(new) — the verdict cache and the classification logic, moved out ofcommitCheckStatuses.js. The favicon and the commit rows now share one cache and, more to the point, one decision about what counts as failing. Duplicating that would mean two places to get a wrong green wrong.src/js/lib/prFavicon.js(new) — resolves the PR's head commit, asks for its verdict, and swaps the link. Stores the href GitHub had set so it can be put back exactly rather than rebuilt.src/js/lib/api.js—getPullRequestHeadRefOid(), since the favicon reports on the PR as a whole, which is the state of its head commit.Carried over from #368: a null verdict leaves whatever GitHub set alone, a verdict of
falseputs our change back, and the head SHA is re-read after 60s so a push doesn't leave us reporting on the wrong commit. Navigating off the PR drops our marker rather than holding a stale icon over whatever GitHub sets next.One bug fix worth calling out: the first version ran a pass at init before the token had loaded out of Onyx.
getOctokit()memoises for the life of the page, so that single early call cached an unauthenticated client and made every subsequent GraphQL request 403. The init path now touches nothing until the token is there.Tests
GitHub only swaps in its status favicon for a signed-in session, so these set the failing favicon GitHub would have set and check what the extension does with it. Everything else — the verdict, the head commit lookup, the API — is real.
npm run build, then load thedist/folder as an unpacked extension.Check independent approvaland nothing else.checklistas well.