Conversation
|
|
9970c76 to
e6f6aba
Compare
There was a problem hiding this comment.
Pull request overview
Adds a DevStats-oriented query layer and exposes a new public API endpoint to bulk-resolve GitHub contributor affiliations (including timeline conflict resolution) from existing member work experience and manual affiliation data.
Changes:
- Exports new DAL modules (
affiliations,devStats) from the data-access-layer package. - Adds DAL query helpers for DevStats lookups (members by GitHub handle; verified emails by memberId).
- Implements
POST /v1/dev-stats/affiliationshandler wired into the public router.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| services/libs/data-access-layer/src/index.ts | Re-exports new DAL entrypoints so downstream services can consume them. |
| services/libs/data-access-layer/src/devStats/index.ts | Adds DevStats-focused queries for bulk member lookup and verified emails. |
| services/libs/data-access-layer/src/affiliations/index.ts | Introduces bulk affiliation resolution and timeline-building logic. |
| backend/src/api/public/v1/dev-stats/index.ts | Wires the /affiliations route to the new handler with scope protection. |
| backend/src/api/public/v1/dev-stats/getAffiliations.ts | Implements request validation, DAL lookups, and response shaping for the endpoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7849e93 to
da7a1a7
Compare
da7a1a7 to
fe0c5a5
Compare
6c63040 to
294f705
Compare
d713ebd to
080da1e
Compare
cdc78ea to
93824fe
Compare
1771df6 to
6b86e22
Compare
|
|
||
| const rateLimiter = createRateLimiter({ max: 60, windowMs: 60 * 1000 }) | ||
|
|
||
| export function devStatsRouter(): Router { |
There was a problem hiding this comment.
nitpick: could we rename the router?
let’s not bake the consumer into the public api.
There was a problem hiding this comment.
also, for other stuff - file, func, etc
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
3b41f31 to
7377aae
Compare
DevStats Affiliations API + Generic DAL resolver
Implements the
/v1/dev-stats/affiliationsendpoint that allows external tools (e.g. DevStats/gitdm) to resolve GitHub contributor affiliations in bulk.API
Accepts up to 1,000 handles per request. Returns resolved, non-overlapping affiliation periods per contributor, sorted by most recent first.
Implementation
services/libs/data-access-layer/src/affiliations/— new generic module, usable by any consumer:IAffiliationPeriod— public type representing a single affiliation windowresolveAffiliationsByMemberIds— bulk resolver for up to N members in 2 DB queriesfindWorkExperiencesBulk/findManualAffiliationsBulk— exported separately for reuseprepareMemberOrganizationAffiliationTimelinebut uses an interval-based approach (boundary dates) instead of day-by-day iteration, making it viable for bulk requestsNote
Medium Risk
Adds a new public API endpoint that returns contributor emails and computed affiliation timelines, plus new DAL query/resolution logic; mistakes could expose data or generate incorrect affiliations. Public API auth routing changes (moving middleware to per-route) may unintentionally change protection/behavior of existing endpoints if misconfigured.
Overview
Adds a new public endpoint
POST /v1/affiliations(static API key +READ_AFFILIATIONSscope, rate-limited) that accepts GitHub handles and returns paginated contributors with verified emails and resolved, non-overlapping affiliation periods.Introduces a new DAL module
affiliationsto bulk-fetch work experiences/manual affiliations and compute primary affiliation timelines via boundary-interval resolution, and adds DAL helpers to look up members by verified GitHub username plus verified emails.Tightens API behavior by converting invalid JSON bodies into a
400 BadRequestError, adds a defaultNotFoundErrorhandler forv1, adjusts public API auth middleware to be applied per-route, and reduces error logging to structured{name,message,stack}fields.Written by Cursor Bugbot for commit 7377aae. This will update automatically on new commits. Configure here.