feat: byYear breakdown & company slug (additive-strict)#237
Merged
Conversation
…populate Company contributors Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…pdatedAt
- GenerateTopStatsCommand: aggregate() now tracks reviewsByYear,
issuesOpenedByYear, pullRequestsOpenedByYear alongside the existing
scalar counters (additive-strict, bumpPair() helper).
- buildRanking() items gain a countByYear sibling next to count;
top_reviewers/top_issues/top_pullrequests.json now wrap items under
{updatedAt (ISO 8601 / DATE_ATOM), items}.
- contributors_prs.json enrichment gains reviewsByYear/issuesOpenedByYear/
pullRequestsOpenedByYear siblings next to the existing scalars.
- FetchPullRequestsAllCommand / FetchIssuesCommand: added createdAt (PR
and issue) and submittedAt (review) to the GraphQL queries and output
shape — required because the per-year breakdown has no date to bucket
on otherwise. Purely additive new fields, no existing field touched.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…unt, plus updatedAt Wraps top_security.json's updatedAt in ISO 8601 (DATE_ATOM) instead of Y-m-d, and adds countByYear/researchByYear/remediationByYear sibling maps keyed by advisory published_at year, following the additive-strict bumpPairFromDate pattern from Task 3. Existing scalar count/research/ remediation keys are unchanged. A missing/malformed published_at still increments the scalar but is skipped from the year bucket, so it is never misattributed to the current year.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Progi1984
approved these changes
Jul 10, 2026
Member
|
@PrestaEdit Can you fix the CI, plz ? |
- Pre-increment (`++$x`) instead of post-increment (`$x++`) when the value is discarded — matches the repo's PHP-CS-Fixer ruleset. - Import `DateTimeImmutable` via `use` at file scope rather than \ reaching into the root namespace with a fully-qualified name. CI failure surfaced by @Progi1984 on PrestaShop#237. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
|
Fixed via 80fd17a — |
Progi1984
approved these changes
Jul 10, 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
Extends every
traces:generate:*command to emit a per-year breakdown of every counted field, as sibling*ByYear/*_by_yearmaps alongside the pre-existing scalar counters. Addsslug+contributors[]on companies and anupdatedAttimestamp at the top level of every output.Additive-strict discipline: every existing scalar key retains its type and semantics. No consumer that reads the old shape breaks. New consumers pair the scalar with its sibling map to build a period-filtered view.
What ships
traces:generate:topcompanies*ByYearsiblings +Company::$slug+Company::$contributors[]+ top-levelupdatedAt.traces:generate:topstatscount: int(unchanged) + newcountByYear: {year: int}sibling. Also enrichescontributors_prs.jsonwithreviewsByYear,issuesOpenedByYear,pullRequestsOpenedByYear. Fetches were extended to includecreatedAt(PRs / issues) andsubmittedAt(reviews) — those fields weren't fetched before, blocking the breakdown.traces:generate:topsecurityresearch,remediation,countscalars retained; addsresearchByYear,remediationByYear,countByYearsiblings. Guarded against malformed / empty publication dates.Consumer impact
The TopContributors front consumes these JSONs. The paired PR on TopContributors is designed to keep rendering with the legacy scalar-only shape — so this can land and be tagged independently.
Discipline notes
bumpPairFromDateguardsstrtotimefailures so an unparseable date doesn't silently bucket into the current year.Test plan
traces:generate:topcompanieson a fresh cache and confirmsum(*.mergedPullRequestsByYear) == mergedPullRequestsfor a random sample of 20 contributors.traces:generate:topstatsand confirm thesum(*.countByYear) == countinvariant on all three ranking files.traces:generate:topsecurityand confirm the same invariant ontop_security.jsonforcount,research,remediation.updatedAtis a valid ISO 8601 string on every emitted file.🤖 Generated with Claude Code