Skip to content

feat(scorecard): add new GitHub metrics for issues, opened/closed prs and GitHub actions - #3472

Open
fullsend-ai-coder[bot] wants to merge 2 commits into
mainfrom
agent/3468-extend-github-metrics
Open

feat(scorecard): add new GitHub metrics for issues, opened/closed prs and GitHub actions#3472
fullsend-ai-coder[bot] wants to merge 2 commits into
mainfrom
agent/3468-extend-github-metrics

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Extend the scorecard GitHub module with 13 new metrics across four domains:

Issue/PR counts (5 metrics):

  • Currently open issues
  • Opened issues in last 7 days
  • Opened PRs in last 7 days
  • Closed issues in last 7 days
  • Closed PRs in last 7 days

PR lifecycle timing (3 metrics, batch provider):

  • Time to first review (average hours)
  • Time to first approval (average hours)
  • Time to merge (average hours)
    All computed from PRs updated in the last 7 days.

GitHub Actions (5 metrics, batch provider):

  • Started workflow runs in last 7 days
  • Successfully completed runs in last 7 days
  • Failed runs in last 7 days
  • Success ratio for 7 days (percentage)
  • Success ratio for 24 hours (percentage)
    Non-terminal runs (pending/running/cancelled) are excluded from success/failure counts and ratio calculations.

CI pass rate (2 metrics, batch provider):

  • First-time CI pass rate for 7 days (percentage)
  • First-time CI pass rate for 24 hours (percentage)
    Checks CI status on the last commit of the first push to each PR. PRs without CI checks are excluded.

New GithubClient methods use GraphQL for issue/PR queries and REST API (fetch) for workflow runs. All providers follow the existing MetricProvider pattern and are registered in the module init. Batch providers use getMetrics/calculateMetrics for efficient multi-metric computation.


Closes #3468

Post-script verification

  • Branch is not main/master (agent/3468-extend-github-metrics)
  • Secret scan passed (gitleaks — 7ccaff17753df64c7ab288cdcba34cee5a657254..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

@rhdh-gh-app

rhdh-gh-app Bot commented Jun 19, 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.

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-common workspaces/scorecard/plugins/scorecard-common minor v4.2.0

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.65672% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.41%. Comparing base (ee6947c) to head (51fa86f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3472      +/-   ##
==========================================
+ Coverage   61.38%   61.41%   +0.02%     
==========================================
  Files        2520     2529       +9     
  Lines      100936   101338     +402     
  Branches    28304    28326      +22     
==========================================
+ Hits        61958    62234     +276     
- Misses      38427    38553     +126     
  Partials      551      551              
Flag Coverage Δ *Carryforward flag
adoption-insights 84.55% <ø> (ø) Carriedforward from ee6947c
ai-integrations 73.13% <ø> (ø) Carriedforward from ee6947c
app-defaults 69.79% <ø> (ø) Carriedforward from ee6947c
augment 46.67% <ø> (ø) Carriedforward from ee6947c
boost 79.00% <ø> (ø) Carriedforward from ee6947c
bulk-import 72.79% <ø> (ø) Carriedforward from ee6947c
cost-management 13.55% <ø> (ø) Carriedforward from ee6947c
dcm 67.21% <ø> (ø) Carriedforward from ee6947c
e2e-adoption-insights 60.00% <ø> (ø) Carriedforward from ee6947c
e2e-extensions 62.13% <ø> (ø) Carriedforward from ee6947c
e2e-global-header 49.45% <ø> (ø) Carriedforward from ee6947c
e2e-homepage 43.49% <ø> (ø) Carriedforward from ee6947c
e2e-intelligent-assistant 46.68% <ø> (ø) Carriedforward from ee6947c
e2e-orchestrator 50.42% <ø> (ø) Carriedforward from ee6947c
e2e-quickstart 55.21% <ø> (ø) Carriedforward from ee6947c
e2e-scorecard 50.21% <ø> (ø) Carriedforward from ee6947c
e2e-theme 16.36% <ø> (ø) Carriedforward from ee6947c
extensions 56.59% <ø> (ø) Carriedforward from ee6947c
global-floating-action-button 71.18% <ø> (ø) Carriedforward from ee6947c
global-header 66.50% <ø> (ø) Carriedforward from ee6947c
homepage 47.50% <ø> (ø) Carriedforward from ee6947c
install-dynamic-plugins 59.95% <ø> (ø) Carriedforward from ee6947c
intelligent-assistant 75.42% <ø> (ø) Carriedforward from ee6947c
konflux 91.98% <ø> (ø) Carriedforward from ee6947c
lightspeed 69.02% <ø> (ø) Carriedforward from ee6947c
mcp-integrations 83.40% <ø> (ø) Carriedforward from ee6947c
orchestrator 70.87% <ø> (ø) Carriedforward from ee6947c
quickstart 63.74% <ø> (ø) Carriedforward from ee6947c
sandbox 79.56% <ø> (ø) Carriedforward from ee6947c
scorecard 85.96% <68.65%> (-1.40%) ⬇️
theme 88.91% <ø> (ø) Carriedforward from ee6947c
translations 5.12% <ø> (ø) Carriedforward from ee6947c
x2a 79.20% <ø> (ø) Carriedforward from ee6947c

*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 ee6947c...51fa86f. 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 Jun 19, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:49 AM UTC · Completed 12:02 PM UTC
Commit: 7ccaff1 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review

Findings

Medium

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:124 — GraphQL search queries in getPullRequestsWithReviews and getPullRequestsWithCommitStatuses use first: 100 without cursor-based pagination. For active repositories with more than 100 PRs updated (or created) in the last 7 days, results are silently truncated, skewing all downstream metric calculations (time-to-review, time-to-approve, time-to-merge, and CI pass rate). Nested collections (reviews first: 100, commits first: 100) are also limited. In contrast, getWorkflowRuns correctly implements REST API pagination.
    Remediation: Add cursor-based pagination using pageInfo { hasNextPage endCursor } with after cursors, looping until all results are fetched.

  • [logic-error] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsRatioProvider.ts:48computeSuccessRatio and computePassRate use Math.round(x * 1000) / 10 which produces one-decimal-place percentages (e.g., 66.7). However, the threshold expressions use integer ranges like >=80, 50-79, <50. A value of 79.9 would not match 50-79 (if range is inclusive to 79) and would not match >=80, potentially falling through all threshold rules depending on how the threshold evaluator parses ranges. This creates a gap between integer threshold boundaries.
    Remediation: Either use Math.round(x * 100) for whole-number percentages to align with integer threshold expressions, or verify that the ThresholdEvaluator correctly handles decimal values in range expressions and adjust thresholds if needed.

  • [api-contract] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsCountProvider.ts:30 — The GithubActionsCountProvider returns a single ThresholdConfig (COUNT_THRESHOLDS with <10 = success, 10-50 = warning, >50 = error) applied to all three metrics (started, successful, failed). These thresholds are semantically wrong for some metrics: >50 successful runs being rated 'error' is counterintuitive. The same issue applies to GithubPRLifecycleProvider where identical DURATION_THRESHOLDS apply to time-to-review, time-to-approve, and time-to-merge, which have different expected ranges.
    Remediation: Split into separate providers with distinct thresholds, or choose threshold values that are reasonable defaults for the most critical metric in each batch.

  • [logic-error] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:249 — The "first push" commit identification heuristic in getPullRequestsWithCommitStatuses uses committedDate <= prCreatedAt + 60000 (1-minute tolerance). committedDate is the git commit timestamp (when committed locally), not when pushed to GitHub. Commits authored days before PR creation will all pass the filter. Force-pushed commits replacing the first push use their own committedDate, creating false matches. If no commits match the window, lastFirstPushCommit is null and the PR is excluded from pass rate calculation rather than counted.
    Remediation: Consider using push events or the first commit's status rollup instead, or document this as a known approximation.

  • [injection] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:169 — The since parameter in getWorkflowRuns is interpolated directly into the REST API URL query string without encoding (created=>${since}). While current callers always pass safe YYYY-MM-DD date strings, the method accepts an arbitrary string. The owner and repo values are properly encoded with encodeURIComponent, but since is not.
    Remediation: Apply encodeURIComponent to since or validate it matches /^\d{4}-\d{2}-\d{2}$/.

  • [missing-error-handling] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:170 — In getWorkflowRuns, the response.json() result is cast to { workflow_runs: WorkflowRun[]; total_count: number } without validation. If the GitHub API returns an unexpected shape (e.g., rate-limit response with HTTP 200), data.workflow_runs could be undefined, causing allRuns.push(...data.workflow_runs) to throw at runtime.
    Remediation: Add a guard: if (!data.workflow_runs) { throw new Error('Unexpected GitHub API response'); }

Low

  • [test-inadequate] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsRatioProvider.test.ts — No test case exercises a non-integer ratio result (e.g., 2 success / 3 completed = 66.7%) to verify and document the one-decimal-place rounding behavior. All current test values happen to produce integer percentages.
    Remediation: Add a test case with a non-integer ratio to explicitly verify rounding behavior.

  • [missing-test] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts — The five new GithubClient methods have no direct unit tests. They are only tested indirectly through provider tests that mock the entire client, so the actual GraphQL queries, REST URL construction, response parsing, and pagination logic are never exercised.

  • [injection] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:93getSearchCount accepts an unrestricted searchQuery: string that is concatenated into a GitHub search query. A future caller could inject additional search qualifiers (e.g., repo:other-org/other-repo) to query data outside the intended scope. Current callers pass only hardcoded strings.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:160getWorkflowRuns paginates without an upper bound. For repositories with tens of thousands of workflow runs in 7 days, this could exhaust memory. Both GithubActionsCountProvider and GithubActionsRatioProvider independently call getWorkflowRuns for the same entity and window, doubling API calls.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsRatioProvider.ts:48computeSuccessRatio returns 100 when no success+failure runs exist (all cancelled or in-progress). A repository with many cancelled runs and zero successes reporting 100% could be misleading.

Previous run

Review

Findings

Medium

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:125 — The getPullRequestsWithReviews and getPullRequestsWithCommitStatuses GraphQL queries use search(first: 100) which limits results to 100 PRs. For active repositories with many PRs updated in the last 7 days, this will silently truncate the dataset, producing inaccurate metrics. No pagination is implemented for these GraphQL search queries, unlike getWorkflowRuns which does paginate via REST.
    Remediation: Implement GraphQL cursor-based pagination using pageInfo { hasNextPage endCursor } and the after parameter, or document the 100-item limit and add a log warning when the result count equals 100.

  • [injection-vuln] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:93 — The getSearchCount, getPullRequestsWithReviews, and getPullRequestsWithCommitStatuses methods interpolate repository.owner and repository.repo directly into GitHub search query strings (e.g., repo:${repository.owner}/${repository.repo}). The getRepositoryInformationFromEntity utility splits the github.com/project-slug annotation on / but does not validate that the resulting owner/repo values contain only valid GitHub username characters. A catalog entity with a malicious annotation value containing spaces or GitHub search qualifiers (e.g., org:victim) could manipulate the search scope to query unintended repositories. Risk is mitigated by catalog entity registration being typically admin-controlled and queries being read-only.
    Remediation: Validate that owner and repo values match a strict regex (e.g., /^[a-zA-Z0-9._-]+$/) in getRepositoryInformationFromEntity, rejecting values containing spaces, colons, or other special characters.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:165 — The getWorkflowRuns method pages through all GitHub Actions workflow runs using a while (hasMore) loop with no upper bound on page count or total results. For high-activity repositories with thousands of workflow runs in the 7-day window, this will make an unbounded number of HTTP requests, accumulate all results in memory, and potentially exhaust GitHub API rate limits or cause backend timeouts.
    Remediation: Add a maximum page count (e.g., 10 pages = 1000 runs) or maximum total result count to cap the loop. Consider logging a warning when the cap is reached.

Low

  • [logic-error] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsRatioProvider.ts:48 — The computeSuccessRatio and computePassRate functions use Math.round(x * 1000) / 10 producing one-decimal-place precision (e.g., 66.7), but metric descriptions say "percentage." Consider documenting the one-decimal-place convention or standardizing on integer percentages.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:249 — The first-push commit detection logic in getPullRequestsWithCommitStatuses uses a 1-minute tolerance heuristic with committedDate (git author date, which is committer-controlled). This is a reasonable approach given GitHub GraphQL API limitations but should be documented.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:166 — The since parameter in getWorkflowRuns is interpolated into the URL query string without encodeURIComponent, while owner and repo are encoded. Current callers pass URL-safe ISO date strings, but applying encoding would be a trivial defensive fix.

  • [pattern-inconsistency] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsCountProvider.ts:59 — Batch providers are the first in the codebase to use the optional getMetricIds()/getMetrics()/calculateMetrics() batch interface from MetricProvider. This conforms to the interface contract but is a new pattern worth verifying consumers handle correctly.

  • [test-inadequate] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubPRLifecycleProvider.test.ts — Lifecycle test assertions use integer values (18, 24, 60) that don't exercise the one-decimal-place rounding logic. Missing test for PRs with reviews but no APPROVED reviews.

  • [missing-test] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts — GithubClient's new methods have no unit tests; all test files mock the entire class. This follows the existing convention but leaves the API integration layer (query construction, response parsing, pagination) untested.

Info

  • [design-direction] The PR introduces the first use of the batch provider pattern (getMetricIds/getMetrics/calculateMetrics) from the MetricProvider interface. This is architecturally sound for metrics sharing a single API call.

  • [scope-exceeded] GithubClient.ts introduces a second credential/integration path via getRestConfig() using raw fetch() alongside the existing Octokit-based getOctokitClient(). This is pragmatically necessary since the GitHub Actions workflow runs API is REST-only.

Previous run (2)

Review

Findings

Medium

  • [logic-error] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsRatioProvider.ts:48computeSuccessRatio uses Math.round(x * 1000) / 10 producing one-decimal percentages (e.g., 79.6), but threshold expressions use integer boundaries (>=80, 50-79, <50). Verified against ThresholdEvaluator: the range operator uses a >= min && a <= max, so a value of 79.6 fails both 50-79 (79.6 > 79) and >=80 (79.6 < 80), falling through all rules and returning undefined status. Same issue exists in GithubPRPassRateProvider.ts computePassRate.
    Remediation: Use Math.round(x * 100) for integer percentages, or adjust threshold expressions to cover the full range (e.g., 50-79.9).

  • [logic-error] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:166getWorkflowRuns paginates through all GitHub Actions workflow runs without an upper bound on page count. While the loop does terminate when allRuns.length >= data.total_count, very active repositories could trigger many REST API calls per metric calculation, risking rate limit exhaustion and long response times.
    Remediation: Add a maximum page count (e.g., const MAX_PAGES = 10) and break out of the loop when reached.

Low

  • [logic-error] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:126getPullRequestsWithReviews and getPullRequestsWithCommitStatuses GraphQL queries use first: 100 without cursor-based pagination, silently dropping PRs beyond the first 100. For high-activity repos this means metrics are computed from an incomplete sample with no warning. This follows the existing pattern in getOpenPullRequestsCount.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:248 — The heuristic to identify first-push commits in getPullRequestsWithCommitStatuses uses a 1-minute tolerance on committedDate, which can differ from push time for long-lived branches. This is a known limitation of the GitHub GraphQL API with no better alternative.

  • [api-contract] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsCountProvider.ts:41 — Multi-metric providers implement optional MetricProvider interface methods (getMetricIds, getMetrics, calculateMetrics) as required. Tests use non-null assertions (provider.calculateMetrics!(mockEntity)). Valid TypeScript but a minor style concern.

  • [error-handling-gap] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:55getRestConfig duplicates the credential-fetching logic from getOctokitClient. Both create a new DefaultGithubCredentialsProvider per call, consistent with existing patterns but increasingly visible with 10+ providers.

  • [test-inadequate] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubPRLifecycleProvider.test.ts — All test durations are exact hour multiples (12h, 24h, etc.). No test exercises the fractional-hour rounding path in computeAverageHours.

  • [test-inadequate] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsRatioProvider.test.tsfilterRunsByWindow uses new Date() internally. Tests create timestamps relative to their own new Date(), creating a theoretical (but practically unlikely) race between the two calls. Consider jest.useFakeTimers().

Info

  • [scope-alignment] All 13 new metrics match the scope requested in issue Extend the scorecard github module with some new metrics #3468. No scope creep detected.
  • [injection] All interpolated values in GraphQL queries are passed as variables (not inline). REST URL uses encodeURIComponent for owner/repo. No injection vectors found.
Previous run (3)

Review

Findings

High

  • [logic-error] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsProvider.ts:137GithubActionsProvider.getMetricThresholds() returns COUNT_THRESHOLDS (e.g., <10 = success, >50 = error), but this single threshold config is applied to ALL metrics exposed by the batch provider, including the ratio metrics (actions_success_ratio_7d and actions_success_ratio_24h) which produce percentage values (0–100). A healthy 80% success ratio would be evaluated as "error" (>50) under count thresholds. Verified against ThresholdResolver.ts and PullMetricsByProviderTask.ts: the framework resolves one ThresholdConfig per provider and applies it uniformly to all metrics in the batch. RATIO_THRESHOLDS is defined at line 38 but never returned by getMetricThresholds().
    Remediation: Split GithubActionsProvider into two separate providers (one for counts using COUNT_THRESHOLDS, one for ratios using RATIO_THRESHOLDS), or extend the MetricProvider interface to support per-metric thresholds.

Medium

  • [unbounded-loop] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:165getWorkflowRuns() paginates through ALL workflow runs with no upper bound. For very active repositories (CI-heavy monorepos) this could cause excessive API calls and memory consumption. The 7-day since parameter provides some natural bound but is insufficient for high-volume repos.
    Remediation: Add a maximum page count or total results limit.

  • [data-truncation] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:125getPullRequestsWithReviews() uses first: 100 in the GraphQL search query but does not paginate. If a repository has more than 100 PRs updated in the last 7 days, results will be silently truncated, producing inaccurate metrics. Same issue in getPullRequestsWithCommitStatuses() at line 202.
    Remediation: Implement cursor-based pagination or document the 100-PR cap as a known limitation.

  • [ssrf] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:166 — In getWorkflowRuns(), repository.owner and repository.repo are interpolated directly into a REST API URL path without encoding. A malicious catalog entity could supply a slug with path traversal characters to redirect the REST request to an unintended GitHub API endpoint, sending configured credentials to the manipulated path. See also: [unbounded-loop] and [architectural-coherence] findings at this location.
    Remediation: Apply encodeURIComponent() to both repository.owner and repository.repo.

  • [architectural-coherence] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:160getWorkflowRuns uses raw fetch() while every other method uses Octokit GraphQL. This creates two distinct credential resolution paths (getRestConfig vs getOctokitClient), introducing maintenance risk in security-adjacent code. See also: [ssrf] finding at this location.
    Remediation: Use Octokit REST API client (which shares credential management) or document why the raw fetch path is necessary.

Low

  • [logic-error] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsProvider.ts:63computeSuccessRatio() excludes runs with conclusions other than success or failure from the denominator. This is explicitly tested and intentional, but the metric description could clarify that cancelled/skipped runs are excluded.

  • [error-handling] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:167getWorkflowRuns() only checks response.ok. Does not handle rate limiting (HTTP 403 with X-RateLimit headers) or guard against non-JSON responses.

  • [edge-case] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts:243getPullRequestsWithCommitStatuses() uses a 1-minute tolerance to identify "first push" commits and assumes GitHub returns commits in chronological order (not guaranteed by API docs).

  • [test-inadequate] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsProvider.test.ts:120 — Test "should return 100% ratio when no completed runs" only tests 7d ratio but not 24h ratio.

  • [scope-accuracy] PR body claims "13 new metrics" but the change actually adds 15.

  • [naming-convention] workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/types.ts:31WorkflowRun type uses snake_case field created_at while all other types use camelCase.

  • [api-shape-pattern] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsProvider.ts:88getProviderId() returns a metric ID rather than a provider-scoped identifier. Matches existing convention but could be documented.

  • [code-organization] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsProvider.ts:196RATIO_THRESHOLDS and COUNT_THRESHOLDS exported but not imported anywhere. GithubCIPassRateProvider redefines RATIO_THRESHOLDS locally with identical values.

  • [code-organization] workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubClosedIssuesProvider.ts — Four search-count providers are nearly identical ~87-line files. A factory function could reduce duplication.

@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.

@christoph-jerolimov christoph-jerolimov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Address the following issues:

  1. GitHubActionsProvider needs to be splitted because it includes metrics that counts actions and then metrics that creates a ratio. But the MetricProvider API only supports one ThresholdConfig for all metrics, at the moment. So splitting this into two providers would allow to define the right ThresholdConfig for these metrics.
  2. GithubCIPassRateProvider should be renamed to GitHubPRPassRateProvider and the metrics should be named something like "GitHub PR CI first time pass rate (7d)". The description should also include that this is about FTPR (first time pass rate).
  3. Add unit tests for GitHubClosedIssuesProvider.ts, GitHubClosedPRsProvider.ts, GitHubOpenedIssuesProvider.ts and GitHubOpenedPRsProvider.ts

@christoph-jerolimov

Copy link
Copy Markdown
Member

/fs-fix

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 12:51 PM UTC · Completed 1:10 PM UTC
Commit: 7ccaff1 · View workflow run →

fullsend-ai-coder Bot added a commit that referenced this pull request Jun 19, 2026
- Split GithubActionsProvider into GithubActionsCountProvider (with
  COUNT_THRESHOLDS) and GithubActionsRatioProvider (with
  RATIO_THRESHOLDS) so each provider gets the correct ThresholdConfig
- Rename GithubCIPassRateProvider to GithubPRPassRateProvider with
  updated metric IDs (github.pr_ci_first_time_pass_rate_*) and titles
  mentioning FTPR (first time pass rate)
- Add individual unit test files for GithubClosedIssuesProvider,
  GithubClosedPRsProvider, GithubOpenedIssuesProvider, and
  GithubOpenedPRsProvider
- Apply encodeURIComponent to owner/repo in REST URL construction

Addresses review feedback on #3472
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Addressed all 3 human review requests: (1) split GithubActionsProvider into count and ratio providers with correct thresholds, (2) renamed GithubCIPassRateProvider to GithubPRPassRateProvider with FTPR naming, (3) added individual unit tests for 4 search-count providers. Also fixed SSRF vulnerability with encodeURIComponent. Disagreed with 4 bot-only findings as out of scope or unnecessary.

Fixed (4):

  1. Split GithubActionsProvider into count and ratio providers (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsProvider.ts): Split GithubActionsProvider into GithubActionsCountProvider (with COUNT_THRESHOLDS for started/successful/failed metrics) and GithubActionsRatioProvider (with RATIO_THRESHOLDS for success ratio metrics). This fixes the logic error where ratio metrics producing percentage values were evaluated against count thresholds.
  2. Rename GithubCIPassRateProvider to GithubPRPassRateProvider with FTPR naming (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubCIPassRateProvider.ts): Renamed GithubCIPassRateProvider to GithubPRPassRateProvider. Updated metric IDs to github.pr_ci_first_time_pass_rate_7d/24h, titles to 'GitHub PR CI first time pass rate', and descriptions to mention FTPR (first time pass rate).
  3. Add unit tests for search-count providers (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubClosedIssuesProvider.test.ts): Added individual unit test files for GithubClosedIssuesProvider, GithubClosedPRsProvider, GithubOpenedIssuesProvider, and GithubOpenedPRsProvider. Tests cover fromConfig with default thresholds and calculateMetric with mocked GithubClient.
  4. SSRF via unencoded owner/repo in REST URL (workspaces/scorecard/plugins/scorecard-backend-module-github/src/github/GithubClient.ts): Applied encodeURIComponent() to repository.owner and repository.repo in the getWorkflowRuns REST URL construction to prevent path traversal.

Disagreed (4):

  1. Unbounded pagination in getWorkflowRuns: The 7-day since parameter provides a natural bound. Adding an artificial page limit could silently truncate real data. This is a minor concern for a scorecard metrics provider and can be addressed in a follow-up if needed.
  2. Data truncation with first:100 in GraphQL queries: Implementing cursor-based pagination would significantly increase complexity. The 100-PR cap is a reasonable default for most repositories. This is better addressed as a separate enhancement.
  3. Architectural coherence - raw fetch vs Octokit: The GitHub Actions workflow runs API is a REST endpoint not available via GraphQL. Using raw fetch with getRestConfig is the appropriate approach. Both paths use the same credential provider.
  4. Factory function for search-count providers to reduce duplication: Out of scope for this PR. The current pattern with individual provider files is explicit and follows existing conventions in the codebase.

Tests: passed

Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 19, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:13 PM UTC · Completed 1:26 PM UTC
Commit: 7ccaff1 · View workflow run →

@christoph-jerolimov

Copy link
Copy Markdown
Member

/fs-fix inspect and fix e2e playwright tests

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Fix · ❌ Terminated · Started 6:50 AM UTC · Ended 8:25 AM UTC
Commit: c0783eb · View workflow run →

fullsend-ai-coder Bot added a commit that referenced this pull request Jun 20, 2026
- Split GithubActionsProvider into GithubActionsCountProvider (with
  COUNT_THRESHOLDS) and GithubActionsRatioProvider (with
  RATIO_THRESHOLDS) so each provider gets the correct ThresholdConfig
- Rename GithubCIPassRateProvider to GithubPRPassRateProvider with
  updated metric IDs (github.pr_ci_first_time_pass_rate_*) and titles
  mentioning FTPR (first time pass rate)
- Add individual unit test files for GithubClosedIssuesProvider,
  GithubClosedPRsProvider, GithubOpenedIssuesProvider, and
  GithubOpenedPRsProvider
- Apply encodeURIComponent to owner/repo in REST URL construction

Addresses review feedback on #3472
@fullsend-ai-coder
fullsend-ai-coder Bot force-pushed the agent/3468-extend-github-metrics branch from 006906c to 5f9d7ac Compare June 20, 2026 06:50
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ❌ Failure · Started 6:50 AM UTC · Completed 8:25 AM UTC
Commit: c0783eb · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 20, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:27 AM UTC · Completed 8:40 AM UTC
Commit: c0783eb · View workflow run →

@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.

}
}
}
`;

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] edge-case

The getPullRequestsWithReviews and getPullRequestsWithCommitStatuses GraphQL queries use search(first: 100) which limits results to 100 PRs. For active repositories, this silently truncates the dataset, producing inaccurate metrics. No pagination is implemented unlike getWorkflowRuns.

Suggested fix: Implement GraphQL cursor-based pagination or document the 100-item limit and add a log warning when the result count equals 100.

}>(query, {
q: fullQuery,
});

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] edge-case

getWorkflowRuns pages through all workflow runs using a while loop with no upper bound on page count or total results. High-activity repos could cause unbounded HTTP requests, memory exhaustion, and rate limit depletion.

Suggested fix: Add a maximum page count (e.g., 10 pages = 1000 runs) to cap the loop.

fullsend-ai-coder Bot added a commit that referenced this pull request Aug 11, 2026
Add explicit type annotations to `response` variables in
getPullRequestsWithReviews and getPullRequestsWithCommitStatuses.
The `cursor` variable created a circular type dependency (response
depends on cursor as argument, cursor is reassigned from response),
causing TS7022 "implicitly has type 'any'". Moving the type from a
generic parameter to a variable annotation breaks the cycle.

Addresses review feedback on #3472
fullsend-ai-coder Bot added a commit that referenced this pull request Aug 11, 2026
1. Remove all const METRIC_IDS / METRIC_ID and inline metric IDs directly
   into getMetrics() and calculateMetrics() calls across all new providers.

2. Split GithubActionsCountProvider thresholds: started and successful
   metrics use ACTIVITY_THRESHOLDS (Success >=0, Warning ==0), while
   failed metric keeps FAILED_COUNT_THRESHOLDS (<10/10-50/>50).

3. Switch GithubClosedIssuesProvider, GithubClosedPRsProvider,
   GithubOpenedIssuesProvider, and GithubOpenedPRsProvider to new
   INFORMATIONAL_NUMBER_THRESHOLD (info status for any value >=0)
   added to scorecard-common threshold.ts.

4. Change GithubPRLifecycleProvider duration from hours to days,
   update DURATION_THRESHOLDS to Success <7, Warning 7-14, Error >14,
   and prefix all metric titles with "GitHub PR".

Addresses review feedback on #3472
@fullsend-ai-coder
fullsend-ai-coder Bot force-pushed the agent/3468-extend-github-metrics branch from 8e2436f to ce5ff3a Compare August 11, 2026 18:31
@christoph-jerolimov

Copy link
Copy Markdown
Member

/fs-fix

  1. All providers needs to be updated: getProviderId must start with the data source id. In this module this means it must start with'github.'.
  2. Add changeset files for both changed plugins. A verbose documentation for @red-hat-developer-hub/backstage-plugin-scorecard-backend-module-github and a short one for @red-hat-developer-hub/backstage-plugin-scorecard-common

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 9:38 PM UTC · Completed 9:53 PM UTC

Commit: ce5ff3a · View workflow run →

fullsend-ai-coder Bot added a commit that referenced this pull request Aug 11, 2026
Update getProviderId() in all 9 new metric providers to use the
'github.' prefix consistent with the existing GithubOpenPRsProvider
pattern and the datasource ID convention.

Add changeset for scorecard-backend-module-github (verbose, minor)
describing all 13 new metrics, and changeset for scorecard-common
(minor) for the new INFORMATIONAL_NUMBER_THRESHOLD export.

Addresses human review feedback on #3472
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 7 (human-triggered)

Addressed both human review findings: (1) prefixed all 9 new provider getProviderId() return values with 'github.' to match the data source ID convention (e.g., 'ActionsCountProvider' -> 'github.actionsCount'), updated 4 related test assertions; (2) added verbose changeset for scorecard-backend-module-github and short changeset for scorecard-common. All 47 tests pass.

Fixed (12):

  1. getProviderId must start with 'github.' prefix (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsCountProvider.ts): Changed getProviderId() return value from 'ActionsCountProvider' to 'github.actionsCount'
  2. getProviderId must start with 'github.' prefix (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubActionsRatioProvider.ts): Changed getProviderId() return value from 'ActionsRatioProvider' to 'github.actionsRatio'
  3. getProviderId must start with 'github.' prefix (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubClosedIssuesProvider.ts): Changed getProviderId() return value from 'ClosedIssuesProvider' to 'github.closedIssues'
  4. getProviderId must start with 'github.' prefix (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubClosedPRsProvider.ts): Changed getProviderId() return value from 'ClosedPRsProvider' to 'github.closedPRs'
  5. getProviderId must start with 'github.' prefix (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubOpenIssuesProvider.ts): Changed getProviderId() return value from 'OpenIssuesProvider' to 'github.openIssues'
  6. getProviderId must start with 'github.' prefix (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubOpenedIssuesProvider.ts): Changed getProviderId() return value from 'OpenedIssuesProvider' to 'github.openedIssues'
  7. getProviderId must start with 'github.' prefix (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubOpenedPRsProvider.ts): Changed getProviderId() return value from 'OpenedPRsProvider' to 'github.openedPRs'
  8. getProviderId must start with 'github.' prefix (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubPRLifecycleProvider.ts): Changed getProviderId() return value from 'PRLifecycleProvider' to 'github.prLifecycle'
  9. getProviderId must start with 'github.' prefix (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubPRPassRateProvider.ts): Changed getProviderId() return value from 'PRPassRateProvider' to 'github.prPassRate'
  10. Update test assertions for new provider IDs (workspaces/scorecard/plugins/scorecard-backend-module-github/src/metricProviders/GithubSearchCountProviders.test.ts): Updated 4 test assertions to expect the new 'github.'-prefixed provider IDs
  11. Add changeset for scorecard-backend-module-github (workspaces/scorecard/.changeset/extend-github-metrics.md): Added verbose changeset (minor) documenting all 13 new GitHub metrics across 4 domains
  12. Add changeset for scorecard-common (workspaces/scorecard/.changeset/scorecard-common-threshold.md): Added short changeset (minor) for the new INFORMATIONAL_NUMBER_THRESHOLD export

Tests: passed

Updated by fullsend fix agent

@christoph-jerolimov

Copy link
Copy Markdown
Member

/fs-fix

  1. rebase
  2. Add color 'info.main' to INFORMATIONAL_NUMBER_THRESHOLD rule for info to resolve start issue that says that any rule need a color except for keys success, warning and error.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 5:19 AM UTC · Completed 5:35 AM UTC

Commit: 6037490 · View workflow run →

fullsend-ai-coder Bot added a commit that referenced this pull request Aug 12, 2026
- Split GithubActionsProvider into GithubActionsCountProvider (with
  COUNT_THRESHOLDS) and GithubActionsRatioProvider (with
  RATIO_THRESHOLDS) so each provider gets the correct ThresholdConfig
- Rename GithubCIPassRateProvider to GithubPRPassRateProvider with
  updated metric IDs (github.pr_ci_first_time_pass_rate_*) and titles
  mentioning FTPR (first time pass rate)
- Add individual unit test files for GithubClosedIssuesProvider,
  GithubClosedPRsProvider, GithubOpenedIssuesProvider, and
  GithubOpenedPRsProvider
- Apply encodeURIComponent to owner/repo in REST URL construction

Addresses review feedback on #3472
fullsend-ai-coder Bot added a commit that referenced this pull request Aug 12, 2026
Rebase on main and migrate all new metric providers to the updated
MetricProvider interface from #3560. Remove deprecated single-metric
methods (getMetricType, getMetric, getMetricThresholds, calculateMetric,
getMetricIds) and use only getMetrics() with thresholds on each Metric
object and calculateMetrics() returning a Map.

All 10 test suites (37 tests) pass.

Addresses review feedback on #3472
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 8 (human-triggered)

Rebased branch onto latest main (no conflicts). Added color 'info.main' to INFORMATIONAL_NUMBER_THRESHOLD info rule. Regenerated API report. All 47 tests pass.

Fixed (2):

  1. Rebase branch onto main: Rebased agent/3468-extend-github-metrics onto origin/main (clean rebase, no conflicts)
  2. Add color to INFORMATIONAL_NUMBER_THRESHOLD info rule (workspaces/scorecard/plugins/scorecard-common/src/types/threshold.ts): Added color: 'info.main' to the info threshold rule to satisfy the requirement that non-standard keys (not success/warning/error) must specify an explicit color

Tests: passed

Updated by fullsend fix agent

fullsend-ai-coder Bot added a commit that referenced this pull request Aug 12, 2026
Align all new metric provider IDs with the lowerCamelCase naming
convention established in the codebase. The providers were using
snake_case IDs which is inconsistent with the existing pattern
(e.g. github.openPRs).

Renames:
- github.open_issues -> github.openIssues
- github.opened_issues_7d -> github.openedIssues7d
- github.closed_issues_7d -> github.closedIssues7d
- github.opened_prs_7d -> github.openedPRs7d
- github.closed_prs_7d -> github.closedPRs7d
- github.time_to_review -> github.timeToReview
- github.time_to_approve -> github.timeToApprove
- github.time_to_merge -> github.timeToMerge
- github.actions_started_7d -> github.actionsStarted7d
- github.actions_successful_7d -> github.actionsSuccessful7d
- github.actions_failed_7d -> github.actionsFailed7d
- github.actions_success_ratio_7d -> github.actionsSuccessRatio7d
- github.actions_success_ratio_24h -> github.actionsSuccessRatio24h
- github.pr_ci_first_time_pass_rate_7d -> github.prCiFirstTimePassRate7d
- github.pr_ci_first_time_pass_rate_24h -> github.prCiFirstTimePassRate24h

Addresses review feedback on #3472
fullsend-ai-coder Bot added a commit that referenced this pull request Aug 12, 2026
- Fix RATIO_THRESHOLDS gap in GithubActionsRatioProvider and
  GithubPRPassRateProvider: change warning from '50-79' to '>=50'
  to prevent backend crash from uncovered threshold range
- Add cursor-based pagination to getPullRequestsWithReviews and
  getPullRequestsWithCommitStatuses GraphQL queries (max 10 pages)
- Cap getWorkflowRuns REST pagination at 10 pages to prevent
  unbounded API calls on active repos
- Update getProviderId() in all new providers to return a unique
  identifier matching the filename without the Github prefix
- Decouple metric IDs from provider IDs in single-metric providers
  by introducing METRIC_ID constants

Addresses review feedback on #3472
fullsend-ai-coder Bot added a commit that referenced this pull request Aug 12, 2026
Add explicit type annotations to `response` variables in
getPullRequestsWithReviews and getPullRequestsWithCommitStatuses.
The `cursor` variable created a circular type dependency (response
depends on cursor as argument, cursor is reassigned from response),
causing TS7022 "implicitly has type 'any'". Moving the type from a
generic parameter to a variable annotation breaks the cycle.

Addresses review feedback on #3472
fullsend-ai-coder Bot added a commit that referenced this pull request Aug 12, 2026
1. Remove all const METRIC_IDS / METRIC_ID and inline metric IDs directly
   into getMetrics() and calculateMetrics() calls across all new providers.

2. Split GithubActionsCountProvider thresholds: started and successful
   metrics use ACTIVITY_THRESHOLDS (Success >=0, Warning ==0), while
   failed metric keeps FAILED_COUNT_THRESHOLDS (<10/10-50/>50).

3. Switch GithubClosedIssuesProvider, GithubClosedPRsProvider,
   GithubOpenedIssuesProvider, and GithubOpenedPRsProvider to new
   INFORMATIONAL_NUMBER_THRESHOLD (info status for any value >=0)
   added to scorecard-common threshold.ts.

4. Change GithubPRLifecycleProvider duration from hours to days,
   update DURATION_THRESHOLDS to Success <7, Warning 7-14, Error >14,
   and prefix all metric titles with "GitHub PR".

Addresses review feedback on #3472
fullsend-ai-coder Bot added a commit that referenced this pull request Aug 12, 2026
Update getProviderId() in all 9 new metric providers to use the
'github.' prefix consistent with the existing GithubOpenPRsProvider
pattern and the datasource ID convention.

Add changeset for scorecard-backend-module-github (verbose, minor)
describing all 13 new metrics, and changeset for scorecard-common
(minor) for the new INFORMATIONAL_NUMBER_THRESHOLD export.

Addresses human review feedback on #3472
fullsend-ai-coder Bot added a commit that referenced this pull request Aug 12, 2026
Add color 'info.main' to the info threshold rule so it satisfies
the requirement that non-standard keys (anything other than success,
warning, error) must specify an explicit color.

Regenerated API report after rebase.

Addresses review feedback on #3472
@fullsend-ai-coder
fullsend-ai-coder Bot force-pushed the agent/3468-extend-github-metrics branch from 6037490 to 8785123 Compare August 12, 2026 05:35
@christoph-jerolimov

Copy link
Copy Markdown
Member

/fs-fix

fix api report. In the last commit, just the new color should be added but the order of some other attributes also changed.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 5:45 AM UTC · Completed 5:51 AM UTC

Commit: 8785123 · View workflow run →

fullsend-ai-coder Bot added a commit that referenced this pull request Aug 12, 2026
Revert spurious attribute reordering in scorecard/report.api.md that
was introduced when the API report was regenerated. The regeneration
was only supposed to add the new color to INFORMATIONAL_NUMBER_THRESHOLD
in scorecard-common, but also reordered aggregationId/metricId,
kind/type, and layouts ExtensionInput entries in the scorecard plugin
report.

Addresses review feedback on #3472
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 9 (human-triggered)

Reverted spurious attribute reordering in scorecard/report.api.md introduced during API report regeneration. Only the new INFORMATIONAL_NUMBER_THRESHOLD in scorecard-common/report.api.md remains as intended.

Fixed (1):

  1. spurious attribute reordering in scorecard API report: Restored original attribute ordering in workspaces/scorecard/plugins/scorecard/report.api.md. The last commit regenerated the API report which reordered aggregationId/metricId, kind/type (2 places), and layouts ExtensionInput entries. Reverted all 4 ordering changes to match main while preserving the legitimate INFORMATIONAL_NUMBER_THRESHOLD addition in scorecard-common/report.api.md.

Tests: passed

Updated by fullsend fix agent

@christoph-jerolimov

Copy link
Copy Markdown
Member

/fs-fix rebase and resolve conflicts

@fullsend-ai-coder

fullsend-ai-coder Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 6:36 PM UTC · Completed 7:01 PM UTC

Commit: 094461e · View workflow run →

Extend the scorecard GitHub module with new metrics across four domains:
issue/PR counts, PR lifecycle timing, GitHub Actions, and CI pass rate.
Squash-rebased all 10 PR commits onto latest main, resolving conflicts:
- types.ts: merged main's deployment types with PR's metric types
- GithubClient.ts: kept main's constructor (logger, cached credentials),
  deployment methods, and getWorkflowRuns; added PR's new methods
  (getOpenIssuesCount, getSearchCount, getPullRequestsWithReviews,
  getRecentWorkflowRuns, getPullRequestsWithCommitStatuses, getRestConfig)
- module.ts: kept main's collectors and added all new metric providers
- All new providers: adapted fromConfig to accept logger parameter,
  matching the existing GithubOpenPRsProvider pattern from main
- Renamed PR's getWorkflowRuns to getRecentWorkflowRuns to avoid
  name conflict with main's existing getWorkflowRuns method
- Applied prettier formatting fixes

Addresses human review feedback on #3472
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 10 (human-triggered)

Successfully rebased PR onto latest main, resolving merge conflicts in GithubClient.ts, types.ts, and module.ts. Adapted all new providers to match main's logger pattern. All 70 tests pass, TypeScript compiles, prettier clean.

Fixed (1):

  1. rebase and resolve conflicts: Squash-rebased all 10 PR commits onto latest main (ee6947c). Resolved merge conflicts in 3 files: types.ts (merged deployment + metric types), GithubClient.ts (kept main's constructor/deployment methods, added PR's new metric methods, renamed getWorkflowRuns to getRecentWorkflowRuns to avoid name conflict), and module.ts (kept collectors, added all new metric providers with logger). Adapted all 9 new providers to accept logger parameter matching main's existing GithubOpenPRsProvider pattern. Updated all test files accordingly. Ran prettier, tsc, and all 70 tests pass.

Tests: passed

Strategy change: Used squash-rebase strategy instead of commit-by-commit rebase to handle 10 commits with overlapping conflicts efficiently.

Decision points
  • Squashed 10 commits into 1 before rebasing to avoid serial conflict resolution across 10 commits (alternatives: Rebase commit-by-commit resolving conflicts in each; rationale: Multiple fix commits touched the same conflicting files (GithubClient.ts modified in commits 1, 4, 6, 8). Squash-rebase resolves all conflicts once against the final desired state, avoiding cascading conflicts.)
  • Renamed PR's getWorkflowRuns to getRecentWorkflowRuns to avoid name conflict with main's existing getWorkflowRuns (alternatives: Method overloading, Remove main's method; rationale: Main's getWorkflowRuns (specific workflow, date range, Octokit) and PR's (all workflows since date, fetch) serve different purposes. Renaming is the cleanest resolution without breaking either API.)
  • Added logger parameter to all new provider fromConfig methods to match main's GithubOpenPRsProvider pattern (alternatives: Keep providers without logger; rationale: Main's GithubClient constructor now requires (config, logger). All providers must pass logger to match the existing pattern established on main.)

Updated by fullsend fix agent

@fullsend-ai-coder
fullsend-ai-coder Bot force-pushed the agent/3468-extend-github-metrics branch from 094461e to 51fa86f Compare August 16, 2026 19:01
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
13.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend the scorecard github module with some new metrics

4 participants