[Integration][Github] Added selector for first commit enrichment in PR exporter#3068
[Integration][Github] Added selector for first commit enrichment in PR exporter#3068
Conversation
…ull request using Graphql
Review Summary by QodoAdd first commit enrichment for GraphQL pull requests
WalkthroughsDescription• Add optional first commit enrichment for GraphQL pull requests • Implement dynamic GraphQL query generation based on selector options • Create PullRequestGraphQLOptions dataclass for managing optional selections • Extend PR options with enrich_with_first_commit boolean field • Add comprehensive tests for first commit enrichment functionality Diagramflowchart LR
A["PR Selector Config"] -->|enrich_with_first_commit| B["PullRequestGraphQLOptions"]
B -->|generate_pr_fields| C["Dynamic GraphQL Query"]
C -->|execute| D["GraphQL API"]
D -->|response with commits| E["_normalize_pr_node"]
E -->|_enrich_with_first_commit| F["Normalized PR with firstCommit"]
File Changes1. integrations/github/github/core/exporters/pull_request_exporter/core.py
|
Code Review by Qodo
|
…ull request using Graphql
…ull request using Graphql
|
I see a misconfiguration gap where enrichWithFirstCommit is configurable even when api=rest, but the REST exporter won’t populate firstCommit. That’s a “looks enabled but doesn’t work” footgun. Can we add a field validator on GithubPullRequestSelector.enrich_with_first_commit in integrations.py to enforce GraphQL? |
Made-with: Cursor # Conflicts: # integrations/github/CHANGELOG.md # integrations/github/pyproject.toml
Description
What - Adds an optional selector for pull requests when using the GraphQL API: the query can request the first commit on the branch (oid, committedDate), and the exporter attaches that payload as a firstCommit object on each normalized PR. The behavior is controlled by a new selector field
enrichWithFirstCommit.Why - Lets you measure lead time from the first commit on the PR branch through review and merge.
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examplesfolder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.