Skip to content

feat: add query layer (CM-1059)#3942

Draft
ulemons wants to merge 26 commits intomainfrom
feat/add-query-layer
Draft

feat: add query layer (CM-1059)#3942
ulemons wants to merge 26 commits intomainfrom
feat/add-query-layer

Conversation

@ulemons
Copy link
Contributor

@ulemons ulemons commented Mar 20, 2026

DevStats Affiliations API + Generic DAL resolver

Implements the /v1/dev-stats/affiliations endpoint that allows external tools (e.g. DevStats/gitdm) to resolve GitHub contributor affiliations in bulk.

API

POST /v1/dev-stats/affiliations
Authorization: Bearer <api-key>

{ "githubHandles": ["handle1", "handle2"] }

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 window
  • resolveAffiliationsByMemberIds — bulk resolver for up to N members in 2 DB queries
  • findWorkExperiencesBulk / findManualAffiliationsBulk — exported separately for reuse
  • Conflict resolution mirrors prepareMemberOrganizationAffiliationTimeline but uses an interval-based approach (boundary dates) instead of day-by-day iteration, making it viable for bulk requests

@ulemons ulemons self-assigned this Mar 20, 2026
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conventional Commits FTW!

@ulemons ulemons changed the title Feat/add query layer feat: add query layer (CM-1059) Mar 20, 2026
@ulemons ulemons force-pushed the feat/add-query-layer branch from 58ddca8 to 997766c Compare March 23, 2026 14:48
ulemons added 19 commits March 23, 2026 16:08
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>
@ulemons ulemons force-pushed the feat/add-query-layer branch from 3afbcf5 to 895d9ed Compare March 23, 2026 15:08
ulemons added 5 commits March 23, 2026 16:13
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>
ulemons added 2 commits March 23, 2026 17:36
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants