Skip to content

feat(#4579): add GitHub AI adoption metric provider - #4580

Open
fullsend-ai-coder[bot] wants to merge 3 commits into
mainfrom
agent/4579-github-ai-adoption-metric
Open

feat(#4579): add GitHub AI adoption metric provider#4580
fullsend-ai-coder[bot] wants to merge 3 commits into
mainfrom
agent/4579-github-ai-adoption-metric

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Add GithubAiAdoptionMetricProvider to the scorecard GitHub module. The provider calculates AI adoption rates for 7d, 30d, and 90d time ranges by analyzing commit trailers (Co-Authored-By, Co-authored-by, Assisted-by) for known AI tool identifiers (Claude, Cursor, Copilot, Codeium, Cody, Tabnine, Gemini, Amazon Q, Windsurf, Devin, Aider).

Changes:

  • New GithubAiAdoptionMetricProvider with 3 metrics:
    github.aiAdoptionRate[7d], [30d], [90d]
  • New getCommitHistory method on GithubClient using GraphQL
    to fetch commit messages from the default branch
  • Merge commits are excluded from the ratio calculation
  • Provider registered in module.ts alongside GithubOpenPRsProvider
  • Config schema updated in config.d.ts for aiAdoption settings
  • Comprehensive test suite covering AI detection, merge commit
    filtering, time range calculation, and edge cases

Closes #4579

Post-script verification

  • Branch is not main/master (agent/4579-github-ai-adoption-metric)
  • Secret scan passed (gitleaks — 57947b408632c1ceba96ef8aa10f7efa903d3a83..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Add GithubAiAdoptionMetricProvider to the scorecard GitHub module.
The provider calculates AI adoption rates for 7d, 30d, and 90d
time ranges by analyzing commit trailers (Co-Authored-By,
Co-authored-by, Assisted-by) for known AI tool identifiers
(Claude, Cursor, Copilot, Codeium, Cody, Tabnine, Gemini,
Amazon Q, Windsurf, Devin, Aider).

Changes:
- New GithubAiAdoptionMetricProvider with 3 metrics:
  github.aiAdoptionRate[7d], [30d], [90d]
- New getCommitHistory method on GithubClient using GraphQL
  to fetch commit messages from the default branch
- Merge commits are excluded from the ratio calculation
- Provider registered in module.ts alongside GithubOpenPRsProvider
- Config schema updated in config.d.ts for aiAdoption settings
- Comprehensive test suite covering AI detection, merge commit
  filtering, time range calculation, and edge cases

Closes #4579
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Sep 4, 2026
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner September 4, 2026 10:42
@rhdh-gh-app

rhdh-gh-app Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-scorecard-backend

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-scorecard-backend-module-github workspaces/scorecard/plugins/scorecard-backend-module-github minor v4.2.0
@red-hat-developer-hub/backstage-plugin-scorecard-backend workspaces/scorecard/plugins/scorecard-backend none v4.2.0

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.12281% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 62.41%. Comparing base (57947b4) to head (d943094).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4580      +/-   ##
==========================================
+ Coverage   62.37%   62.41%   +0.03%     
==========================================
  Files        2607     2608       +1     
  Lines      104756   104865     +109     
  Branches    29430    29452      +22     
==========================================
+ Hits        65346    65454     +108     
- Misses      38819    38820       +1     
  Partials      591      591              
Flag Coverage Δ *Carryforward flag
adoption-insights 84.77% <ø> (ø) Carriedforward from 9b1ba86
ai-integrations 78.80% <ø> (ø) Carriedforward from 9b1ba86
app-defaults 56.22% <ø> (ø) Carriedforward from 9b1ba86
augment 46.67% <ø> (ø) Carriedforward from 9b1ba86
boost 80.51% <ø> (ø) Carriedforward from 9b1ba86
bulk-import 73.12% <ø> (ø) Carriedforward from 9b1ba86
cost-management 13.35% <ø> (ø) Carriedforward from 9b1ba86
dcm 73.47% <ø> (ø) Carriedforward from 9b1ba86
e2e-adoption-insights 60.00% <ø> (ø) Carriedforward from 9b1ba86
e2e-extensions 62.31% <ø> (ø) Carriedforward from 9b1ba86
e2e-global-header 50.35% <ø> (ø) Carriedforward from 9b1ba86
e2e-homepage 61.11% <ø> (ø) Carriedforward from 9b1ba86
e2e-intelligent-assistant 47.04% <ø> (ø) Carriedforward from 9b1ba86
e2e-orchestrator 49.52% <ø> (ø) Carriedforward from 9b1ba86
e2e-orchestrator-plugin 49.51% <ø> (ø) Carriedforward from 9b1ba86
e2e-quickstart 55.21% <ø> (ø) Carriedforward from 9b1ba86
e2e-scorecard 50.21% <ø> (ø) Carriedforward from 9b1ba86
e2e-theme 16.36% <ø> (ø) Carriedforward from 9b1ba86
extensions 57.37% <ø> (ø) Carriedforward from 9b1ba86
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 9b1ba86
global-header 68.09% <ø> (ø) Carriedforward from 9b1ba86
homepage 48.39% <ø> (ø) Carriedforward from 9b1ba86
install-dynamic-plugins 71.31% <ø> (ø) Carriedforward from 9b1ba86
intelligent-assistant 76.43% <ø> (ø) Carriedforward from 9b1ba86
konflux 91.98% <ø> (ø) Carriedforward from 9b1ba86
lightspeed 69.02% <ø> (ø) Carriedforward from 9b1ba86
mcp-integrations 84.14% <ø> (ø) Carriedforward from 9b1ba86
orchestrator 71.13% <ø> (ø) Carriedforward from 9b1ba86
quickstart 63.74% <ø> (ø) Carriedforward from 9b1ba86
sandbox 79.56% <ø> (ø) Carriedforward from 9b1ba86
scorecard 88.18% <99.12%> (+0.22%) ⬆️
theme 87.91% <ø> (ø) Carriedforward from 9b1ba86
translations 5.12% <ø> (ø) Carriedforward from 9b1ba86
x2a 77.10% <ø> (ø) Carriedforward from 9b1ba86

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57947b4...d943094. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 4, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:44 AM UTC · Completed 10:50 AM UTC

Commit: 50953a0 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $0.95

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review

Findings

Medium

  • [stale-doc] workspaces/scorecard/AGENTS.md:26 — The "Complete Metric ID Reference" table lists GitHub with only 1 metric (github.openPRs). This PR adds three new GitHub metrics (github.aiAdoptionRate[7d], github.aiAdoptionRate[30d], github.aiAdoptionRate[90d]) but AGENTS.md is not updated. The heading says "### GitHub (1 metric)" and the table has only one row.
    Remediation: Update the heading to "### GitHub (4 metrics)" and add three rows for the new AI adoption rate metrics, referencing GithubAiAdoptionProvider.ts as the source.

  • [naming-convention] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionProvider.ts:148 — Metric IDs github.aiAdoptionRate[7d], [30d], [90d] introduce bracket-parameterized suffixes not used by any of the 40+ existing metrics. The AGENTS.md naming convention specifies plain lowerCamelCase with <provider>.<metricName> format. Brackets could interact unexpectedly with downstream systems: config path construction (producing YAML keys like aiAdoptionRate[7d]), entity annotation threshold overrides, and translation key lookup.
    Remediation: Consider plain CamelCase IDs (e.g., github.aiAdoptionRate7d) or verify that downstream config paths, annotation keys, and translation utilities handle bracket characters correctly.

Low

  • [pattern-violation] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/types.ts:88GithubCommitHistoryQueryResponse uses optional-property markers (?) on defaultBranchRef, target, and history, whereas GithubDeploymentsQueryResponse in the same file uses non-optional properties with | null. GraphQL always returns requested keys (as null, not undefined), so | null is more semantically accurate. Note: GithubCommitsPullRequestsQueryResponse also uses optional markers, so the codebase is already mixed.

  • [missing-doc] workspaces/scorecard/plugins/scorecard/src/translations/ref.ts:104 — Every existing metric has translation entries in ref.ts and locale files. The three new metrics lack entries, causing auto-generated display text from metric IDs (including bracket syntax).
    Remediation: Add translation entries for the new metrics in ref.ts and all locale files.

  • [code-organization] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/types.ts:95 — The nodes array element type inside GithubCommitHistoryQueryResponse is defined inline as { message: string; committedDate: string }, structurally identical to the GithubCommit type declared five lines above.
    Remediation: Reference GithubCommit in the node array: nodes: Array<GithubCommit | null>.

  • [naming-convention] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionProvider.ts:1 — Class named GithubAiAdoptionProvider with lowercase "i" in "Ai". Existing codebase preserves uppercase acronyms in PascalCase class names (e.g., GithubOpenPRsProvider, OpenSSFMetricProvider).
    Remediation: Rename to GithubAIAdoptionProvider and file to GithubAIAdoptionProvider.ts.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionProvider.ts:93isAiAssistedCommit scans every line of the commit message for trailer patterns, not just the trailing block (after the last blank line per git trailer convention). Quoted trailers in revert descriptions could produce false positives, though this is extremely rare in practice.

Previous run

Review

Findings

High

  • [stale-reference] workspaces/scorecard/AGENTS.md:26 — The heading reads "GitHub (1 metric)" and the metric reference table lists only github.openPRs. This PR adds three new metric IDs (github.aiAdoptionRate[7d], github.aiAdoptionRate[30d], github.aiAdoptionRate[90d]) and a new provider (GithubAiAdoptionMetricProvider.ts), making the count and table stale.
    Remediation: Update the heading to "GitHub (4 metrics)" and add three rows to the table.

  • [missing-documentation] workspaces/scorecard/plugins/scorecard-backend-module-github/README.md:61 — The "Available Metrics" section only documents github.openPRs. The three new AI adoption rate metrics are completely absent from the module's primary user-facing documentation.
    Remediation: Add a subsection documenting the AI adoption rate metrics with their IDs, type, thresholds, and description.

Medium

  • [missing-documentation] workspaces/scorecard/plugins/scorecard-backend-module-github/README.md:139 — The "Default thresholds" section only shows threshold configuration for github.openPRs. The new aiAdoption config key supports its own thresholds block but no documentation is provided.
    Remediation: Add a thresholds subsection for github.aiAdoption showing the default rules (success >=0.2, warning >=0.1, error >=0).

  • [missing-documentation] workspaces/scorecard/plugins/scorecard-backend-module-github/README.md:162 — The "Schedule Configuration" section only demonstrates schedule configuration for github.openPRs. The new aiAdoption config key also supports a schedule property but no example is provided.
    Remediation: Add or extend the schedule configuration example to include aiAdoption.

  • [stale-reference] workspaces/scorecard/plugins/scorecard-backend/README.md:99 — The "Available Metric Providers" table lists GitHub with only github.openPRs. The three new metrics are not included.
    Remediation: Add the AI adoption rate metrics to the GitHub row.

  • [naming-convention] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionMetricProvider.ts:55 — The class uses a MetricProvider suffix while the existing sibling GithubOpenPRsProvider uses just Provider. This is a naming inconsistency within the same package.
    Remediation: Rename the class to GithubAiAdoptionProvider (and update the file name and imports) to match the existing convention.

  • [naming-convention-deviation] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionMetricProvider.ts:73 — The metric IDs use bracket notation (e.g., github.aiAdoptionRate[7d]) which departs from the project's documented lowerCamelCase convention. No other metric in the repository uses brackets. Brackets in config paths could impede per-metric threshold overrides via ConfigReader. The issue text does authorize this format, so the deviation is intentional.
    Remediation: Consider flat IDs (e.g., github.aiAdoptionRate7d) or validate that Backstage ConfigReader handles brackets in keys.

  • [error-handling-idiom] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:407 — The new getCommitHistory method omits a logger.warn when the fetchItemsLimit cap is reached. The existing getDeployments and getCommitShasBetween methods both log a warning in that scenario.
    Remediation: Add this.logger.warn(...) after the pagination loop when the limit is hit, matching the pattern in sibling methods.

  • [test-inadequate] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GitHubClient.test.ts — The new getCommitHistory method has no unit test. Every other public method on GithubClient has dedicated tests covering query construction, pagination, fetch-limit truncation, and error handling.
    Remediation: Add tests covering single-page, multi-page pagination, fetchItemsLimit truncation, repository-not-found error, and null node handling.

  • [logic-error] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionMetricProvider.ts:89AI_TOOL_PATTERNS matched via startsWith means Co-authored-by trailers with human names starting with tool names (Claude, Cody, Devin, Gemini) are classified as AI-assisted. These false positives inflate the adoption ratio.
    Remediation: Use word-boundary matching or full canonical identifiers (e.g., match email domain like @anthropic.com, @github.com, or match name <email> pairs) to avoid collisions with human names.

Low

  • [missing-documentation] workspaces/scorecard/plugins/scorecard-backend/docs/providers.md:193 — The "Example Metric Providers" section lists only GithubOpenPRsProvider under "GitHub Datasource". The new provider could be listed as an additional example.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionMetricProvider.ts:108isMergeCommit only detects Merge pull request # and Merge branch prefixes. This misses Merge remote-tracking branch and other less common merge patterns.

  • [error-handling] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:137 — When defaultBranchRef is null (empty repo or deleted default branch), getCommitHistory silently returns an empty array with no log warning, making misconfiguration hard to troubleshoot.

  • [scope-creep] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/constants.ts — The PR renames DEFAULT_DEPLOYMENT_FETCH_ITEMS_LIMIT to DEFAULT_FETCH_ITEMS_LIMIT. This is not in the issue scope but is a reasonable cleanup since the constant was already used for non-deployment fetches.

  • [api-shape] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionMetricProvider.ts:76getProviderId() includes an explicit : string return type annotation while the sibling GithubOpenPRsProvider omits it.


Labels: PR adds a new feature to the scorecard workspace; enhancement label matches the linked issue classification.

Previous run (2)

Review — comment

Well-structured addition that closely follows existing scorecard provider patterns. The GithubAiAdoptionMetricProvider mirrors GithubOpenPRsProvider's architecture, the GithubClient.getCommitHistory method follows established pagination conventions, and the test suite is comprehensive (covering time ranges, AI detection, merge filtering, case-insensitive tool matching, and logging). The addMetricProvider rest-params call is correct per the ScorecardMetricsExtensionPoint interface.

Findings

1. Missing history: true on metric definitions — medium

File: workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionMetricProvider.ts (line ~136)

Every other metric provider in the scorecard workspace (GithubOpenPRsProvider, all four DORA providers, OpenSSFMetricProvider, CodeCoverageMetricProvider, FilecheckMetricProvider, SonarQubeBasicMetricProvider, DependabotMetricProvider, JiraOpenIssuesProvider) sets history: true in its getMetrics() return value. The new AI adoption metrics omit this field. Without it, the scorecard backend likely won't persist historical data points for these metrics, meaning users can't see adoption trends over time — which is arguably the most valuable view for an adoption rate metric.

Remediation: Add history: true to each metric object in getMetrics():

return AI_ADOPTION_RATE_TIME_RANGES.map(range => ({
  id: `${this.getProviderId()}Rate[${range}]`,
  title: `GitHub AI adoption rate (${range})`,
  description: `Ratio of AI-assisted commits over the last ${range}.`,
  type: 'number' as const,
  thresholds: AI_ADOPTION_RATE_THRESHOLD,
  history: true,
}));

2. Trailer key matching is not fully case-insensitive — medium

File: workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubAiAdoptionMetricProvider.ts (lines ~80-90)

The isAiAssistedCommit function checks for three exact trailer prefixes:

  • Assisted-by:
  • Co-Authored-By:
  • Co-authored-by:

Git's interpret-trailers treats trailer keys as case-insensitive. While the two most common Co-authored-by variants are covered (GitHub's UI and most AI tools use these), other valid casings (co-authored-by:, CO-AUTHORED-BY:, assisted-BY:) will be missed, leading to under-counted adoption rates in repos with non-standard trailer formatting.

Remediation: Normalize the line to lowercase before prefix matching:

const lower = trimmed.toLowerCase();
let value: string | undefined;

if (lower.startsWith('assisted-by: ')) {
  value = trimmed.slice('assisted-by: '.length).trim();
} else if (lower.startsWith('co-authored-by: ')) {
  value = trimmed.slice('co-authored-by: '.length).trim();
}

3. Deployment-named constant reused for commits — low

File: workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts (line ~416)

DEFAULT_DEPLOYMENT_FETCH_ITEMS_LIMIT is semantically scoped to deployments but is now also the default cap for commit history fetches. The 1000-item cap is reasonable, but the naming creates a misleading code path.

Remediation: Consider renaming to DEFAULT_FETCH_ITEMS_LIMIT (or introducing a separate constant) to reflect its broader usage.


Verdict: Two medium-severity findings — both are quality/robustness issues rather than correctness blockers. The feature will function correctly for the most common cases. The history: true omission is the most impactful since it affects every deployment of this metric.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Sep 4, 2026
@christoph-jerolimov

Copy link
Copy Markdown
Member

/fs-fix fix all review comments

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 3:43 PM UTC · Completed 3:56 PM UTC

Commit: 50953a0 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $1.95

- Add history: true to AI adoption metric definitions to match
  all other scorecard metric providers
- Make trailer key matching fully case-insensitive by normalizing
  to lowercase before prefix comparison
- Rename DEFAULT_DEPLOYMENT_FETCH_ITEMS_LIMIT to DEFAULT_FETCH_ITEMS_LIMIT
  to reflect its broader usage across deployments and commit history

Addresses review feedback on #4580
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 4, 2026

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 3:57 PM UTC · Ended 4:37 PM UTC

Commit: 9b1ba86 · View workflow run →

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added enhancement New feature or request and removed requires-manual-review Review requires human judgment labels Sep 4, 2026
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:57 PM UTC · Completed 4:37 PM UTC

Commit: 9b1ba86 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $6.18

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 4:38 PM UTC · Completed 4:57 PM UTC

Commit: 9b1ba86 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $4.48

- Rename GithubAiAdoptionMetricProvider to GithubAiAdoptionProvider
  to match the naming convention of GithubOpenPRsProvider
- Fix false-positive AI detection by using exact name-part matching
  instead of startsWith, preventing human names like "Claude Smith"
  or "Devin Johnson" from being classified as AI-assisted
- Add logger.warn when fetchItemsLimit is reached in getCommitHistory,
  matching the pattern used by getDeployments and getCommitShasBetween
- Add logger.warn when defaultBranchRef is null (empty/misconfigured repo)
- Remove explicit `: string` return type from getProviderId() to match
  sibling GithubOpenPRsProvider convention
- Add comprehensive GithubClient.getCommitHistory tests covering
  single-page, multi-page pagination, fetchItemsLimit truncation,
  repository-not-found error, null node handling, and null defaultBranchRef
- Add test for human-name false-positive prevention
- Document AI adoption rate metrics in module README (IDs, thresholds,
  schedule configuration)
- Update scorecard-backend README Available Metric Providers table
- Add GithubAiAdoptionProvider to providers.md example list

Addresses review feedback on #4580
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 4, 2026

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 4:59 PM UTC · Ended 5:20 PM UTC

Commit: d943094 · View workflow run →

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review September 4, 2026 17:20

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the review comment for full details.

history: true,
}));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] naming-convention

Metric IDs github.aiAdoptionRate[7d/30d/90d] introduce bracket-parameterized suffixes not used by any existing metrics. Brackets could interact unexpectedly with downstream config paths, annotation keys, and translation key lookup.

Suggested fix: Consider plain CamelCase IDs (e.g., github.aiAdoptionRate7d) or verify downstream handling of brackets.


export type GithubCommit = {
message: string;
committedDate: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] pattern-violation

GithubCommitHistoryQueryResponse uses optional-property markers (?) where existing response types use non-optional with | null. The codebase is already mixed on this pattern.

repository: {
defaultBranchRef?: {
target?: {
history?: {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] code-organization

The nodes array element type is defined inline, duplicating the GithubCommit type declared five lines above.

Suggested fix: Reference GithubCommit: nodes: Array<GithubCommit | null>.

@@ -0,0 +1,234 @@
/*

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] naming-convention

Class named GithubAiAdoptionProvider with lowercase i. Existing codebase preserves uppercase acronyms (GithubOpenPRsProvider, OpenSSFMetricProvider).

Suggested fix: Rename to GithubAIAdoptionProvider and file to GithubAIAdoptionProvider.ts.

for (const line of lines) {
const trimmed = line.trim();
const lower = trimmed.toLowerCase();
let value: string | undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] edge-case

isAiAssistedCommit scans every line for trailer patterns, not just the trailing block. Quoted trailers in revert descriptions could produce false positives (extremely rare in practice).

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Sep 4, 2026
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 4:59 PM UTC · Completed 5:20 PM UTC

Commit: d943094 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $8.43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready-for-review Agent PR ready for human review requires-manual-review Review requires human judgment workspace/scorecard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend the scorecard github module with a new AI adoption metric provider

1 participant