feat(qa): top QA contributors ranking - #246
Merged
Merged
Conversation
Two fixes surfaced during first dry-run: - Actual labels are "QA ✔️" and "QA ✔️ by Community" (U+2714 heavy check mark), not "QA ✅" / "QA by community ✅" (U+2705). - GitHub search API caps results at 1000 per query; a single org-wide search silently truncated 9827 matching PRs to ~627 events. Iterate over gh_repositories.json and search per-repo instead — each module stays well under the cap. Dry-run now yields 2857 unique events across 55 QA contributors.
Two refinements after a first end-to-end dry-run against the live API:
1. Broaden label coverage.
Scanning every repo's labels surfaced eight more variants beyond the
two original ones — including plain-text emoji codes (":heavy_check_mark:"),
the U+2713 check mark, "QA by Dev", "QA by Community", "QA with AI",
and "QA approved". They now all feed the same events stream.
Result: 3146 unique events (vs 656 initially) across ~55 QA-ers.
2. Time-aware internal/community bucketing.
The original label-based split fell apart on modules, where the same
neutral label (`QA ✔️` etc.) is used by both team members and
community reviewers. The fix hybridises the rule:
- Labels that explicitly declare their origin (Community / Dev) win.
- Neutral labels fall back to whether the actor was a PrestaShop
employee AT THE TIME of the event, via the employees map in
var/data/companies.json (login -> [{startDate, endDate}]).
Historic events stay attributed to `qa` even for people who have
since left the company, and events after someone's endDate cross
over to `qa_community` — visible on Progi1984 (328 internal for the
Jul 2019 - Aug 2026 stint, 3 community after that).
Employees missing from the map still fall through to `qa_community`
— that's a data gap in companies.json, not something this command
can fix.
Also emit countByYear / qaByYear / qaCommunityByYear on each item,
mirroring the byYear convention of top_security.json so the front can
plot per-year contributions.
Member
|
CI is red |
- Import Throwable and drop the leading backslash (CS Fixer's global_namespace_import rule).
- Loosen the docblock types on rows coming from json_decode to `array<string, mixed>` and validate the shape inline; strict `array{...}` types were tripping "always exists / always evaluates to true" phpstan errors that reflected the docblock's optimism rather than runtime reality.
- Add a proper docblock to FetchQaEventsCommand::dedup() (no value type in iterable).
Touxten
approved these changes
Aug 29, 2026
Progi1984
approved these changes
Aug 29, 2026
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.
Summary
Adds a QA contributors leaderboard to the pipeline, on the same model as
top_security.traces:fetch:qaevents— for each repository ingh_repositories.json, searches merged PRs carrying the labelsQA ✔️andQA ✔️ by Community, records theLabeledEvent.actor(i.e. the person who set the QA label), and writes deduplicated events togh_qa_events.json.traces:generate:topqa— aggregates events per actor intotop_qa.jsonwith the fields{rank, login, name, avatar_url, html_url, count, qa, qa_community}. Same shape astop_security.json, with two separate counters kept so the front can split later.configExclusionsmechanism. Actors absent fromcontributors_prs.json(QA-ers who never contributed code) are resolved viagithub.getUser(login)and cached per run.Design decisions
org:PrestaShopsearch silently truncated ~9827 matching PRs to ~627 events on a first run. Iterating overgh_repositories.jsonkeeps every module well under the cap. Verified onPrestaShop/PrestaShop: 577 events forQA ✔️, well under the ceiling.QA ✔️(U+2714 heavy check mark, not U+2705 white check mark) andQA ✔️ by Community. Confirmed by inspecting/repos/PrestaShop/ps_emailsubscription/labels.(repo, pr_number, actor, label)with earliestcreatedAtkept — a label posed/removed/re-posed counts once.Dry-run results
qa_communitypopulated where expected (kpodemski 28, jf-viguier 2, etc.).Companion PR
Front-end consumption of
top_qa.json(new Wall of Fame tab + contributor page + SVG card) will land in a separate PR onPrestaShop/TopContributorsonce this one is merged and the JSONs are released.Test plan
php -lclean on both new commands andbin/console.traces:fetch:qaeventscompletes without error against the live API.traces:generate:topqaproduces atop_qa.jsonwith contiguous ranks and plausible ordering.PrestaShop/PrestaShopevent count stays under the 1000 per-repo search cap.