Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(engineering-analytics): restore author page with CI cost (#68325)

Julian Beza80b96cbe201
diff --git a/frontend/src/products.tsx b/frontend/src/products.tsx
index d06dad4c007a..77d529245b68 100644
--- a/frontend/src/products.tsx
+++ b/frontend/src/products.tsx
@@ -114,6 +114,8 @@ export const productScenes: Record<string, () => Promise<any>> = {
import('../../products/engineering_analytics/frontend/scenes/WorkflowRunDetailScene'),
EngineeringAnalyticsWorkflowRuns: () =>
import('../../products/engineering_analytics/frontend/scenes/WorkflowRunsScene'),
+ EngineeringAnalyticsAuthor: () =>
+ import('../../products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene'),
ErrorTracking: () => import('../../products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene'),
ErrorTrackingIssue: () =>
import('../../products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene'),
@@ -260,6 +262,7 @@ export const productRoutes: Record<string, [string, string]> = {
'EngineeringAnalyticsWorkflowRuns',
'engineeringAnalyticsWorkflowRuns',
],
+ '/engineering-analytics/author/:handle': ['EngineeringAnalyticsAuthor', 'engineeringAnalyticsAuthor'],
'/error_tracking': ['ErrorTracking', 'errorTracking'],
'/error_tracking/:id': ['ErrorTrackingIssue', 'errorTrackingIssue'],
'/error_tracking/:id/fingerprints': ['ErrorTrackingIssueFingerprints', 'errorTrackingIssueFingerprints'],
@@ -456,7 +459,6 @@ export const productRedirects: Record<
'/data-warehouse/sources/:id': ({ id }) => urls.dataWarehouseSource(id, 'schemas'),
'/data-warehouse/sources/:id/:tab': ({ id, tab }) => urls.dataWarehouseSource(id, tab as SourceSceneTab),
'/engineering-analytics/authors': '/engineering-analytics',
- '/engineering-analytics/author/:handle': '/engineering-analytics',
'/error_tracking/configuration': (_params, searchParams, hashParams) => {
const { tab, ...restSearchParams } = searchParams
return combineUrl(
@@ -695,6 +697,13 @@ export const productConfiguration: Record<string, any> = {
description: "A single workflow's recent runs across the connected repo.",
iconType: 'health',
},
+ EngineeringAnalyticsAuthor: {
+ projectBased: true,
+ name: 'Author',
+ layout: 'app-container',
+ description: "One author's pull requests \u2014 a filtered view for finding work, not a ranking.",
+ iconType: 'health',
+ },
ErrorTracking: {
projectBased: true,
name: 'Error tracking',
@@ -1098,6 +1107,8 @@ export const productUrls = {
`/engineering-analytics/${encodeURIComponent(repoOwner)}/${encodeURIComponent(repoName)}/actions/runs/${runId}`,
engineeringAnalyticsWorkflowRuns: (repoOwner: string, repoName: string, workflowName: string): string =>
`/engineering-analytics/${encodeURIComponent(repoOwner)}/${encodeURIComponent(repoName)}/actions/workflows/${encodeURIComponent(workflowName)}`,
+ engineeringAnalyticsAuthor: (handle: string): string =>
+ `/engineering-analytics/author/${encodeURIComponent(handle)}`,
errorTracking: (params = {}): string => combineUrl('/error_tracking', params).url,
errorTrackingConfiguration: (params = {}): string =>
combineUrl('/error_tracking', { ...params, activeTab: 'configuration' }).url,
@@ -1825,6 +1836,7 @@ export const getTreeItemsProducts = (): FileSystemImport[] => [
'EngineeringAnalyticsPullRequest',
'EngineeringAnalyticsWorkflowRun',
'EngineeringAnalyticsWorkflowRuns',
+ 'EngineeringAnalyticsAuthor',
],
},
{
diff --git a/products/engineering_analytics/README.md b/products/engineering_analytics/README.md
index 6cd6d8c8ae1c..3f28268dfb61 100644
--- a/products/engineering_analytics/README.md
+++ b/products/engineering_analytics/README.md
@@ -145,7 +145,7 @@ Change one only in a separate PR with a written reason. Engineering-level decisi
- UI = read-only analytics surface on the **same** endpoints (PR list, CI health, workflow health) — a real read surface, not only a design-system showcase. No saved views or stateful filters in this phase; persisted/stateful surfaces are a later, separate decision.
- v1 data path = HogQL on warehouse. Event ingestion deferred. Product Postgres DB stays empty.
- Author identity = `Author{handle, display_name, avatar_url, is_bot}`. No PostHog-user mapping in v1.
-- **Analytics aggregate at team/repo level only.** Author is display metadata on a PR — attribution, never a unit of analysis. No author-level pages, tabs, leaderboards, rankings, or per-author cost, ever. This is a non-goal (per-developer surveillance), not a deferred feature.
+- **No author leaderboards or per-developer performance rankings.** Author is never ranked against other authors: no leaderboards, no cross-author cycle-time/flaky scoreboards — that's the per-developer-surveillance non-goal. But the author page is allowed and reachable only via the author link on a PR row: it shows that author's PRs (the shared PR table) plus that author's own CI **cost** (windowed spend + a split-by-workflow breakdown). Cost here is transparent spend for finding and explaining one's own work, not a scoreboard.
- Bots and drafts excluded by default in throughput / cycle-time tools; bots are first-class in bot-impact analysis (don't strip them everywhere).
- Bot detection = `handle.endswith("[bot]") OR handle in KNOWN_BOT_HANDLES`. Hardcoded allowlist for v1.
- Time to merge v1 = the read layer's `open_to_merge_seconds` column = `merged_at - created_at` (draft + ready-for-review combined). Coarse — encoded in the column name, never named cycle/review time.
diff --git a/products/engineering_analytics/SPEC.md b/products/engineering_analytics/SPEC.md
index b0de206a547e..133459302bb2 100644
--- a/products/engineering_analytics/SPEC.md
+++ b/products/engineering_analytics/SPEC.md
@@ -11,7 +11,7 @@ The **goal** is to surface these as **Signals** for PostHog Code: valuable CI co
## 2. Non-goals
-- Per-developer surveillance metrics or rankings. Analytics aggregate at team/repo level only; author is display metadata on a PR (attribution), never a unit of analysis. No author-level pages, tabs, leaderboards, rankings, or per-author cost, ever.
+- Per-developer surveillance _rankings_. No author leaderboards, cross-author rankings, or per-developer performance/cycle-time scores (no author-scoped "median open→merge", no flaky-rate scoreboard), ever — those exist only to compare people. The author-scoped _page_ is allowed: the author-filtered PR list plus that author's own CI **cost** (transparent spend, not a performance judgement), reachable only from the author links on PR rows. Author is never surfaced as a ranked, cross-author aggregation.
- Real-time alerting on individual PRs. That's notification surface, not analytics.
- Replacing GitHub's own UI. We surface signal, not the raw PR thread.
- Code-quality static analysis. Different product space.
@@ -184,7 +184,9 @@ Engineering-specific decisions. Product-level decisions live in README → Locke
- Cardinality: a run ↔ PR is **0..N** (push-only runs and fork PRs have no association; one commit can head several PRs). Treat pr_number attribution as a possibly-empty, possibly-multi set, never a guaranteed single value. v1 credits a run to the **first** PR in its association (see `pr_runs`).
- **The Logs surface inherits this.** Emitted CI failure logs carry `attributes['run_id']` (plus `job_id` / `branch` / `conclusion`); `ci_failure_logs` resolves a PR to its run_ids through the same `pull_requests` attribution (reusing `pr_runs`), then filters the Logs product by `run_id` — no head-SHA join, no merge SHA, all pushes captured. Fork PRs (no association) degrade to a run_id / branch lookup.
- **Warehouse columns are strings + Nullable JSON; the builders parse and `ifNull`-guard.** The real GitHub source lands timestamps as strings and the nested objects (`user`/`head`/`base`/`labels`/`repository`/`pull_requests`) as Nullable. Curated builders therefore parse every timestamp with HogQL `parseDateTimeBestEffort` (which maps to ClickHouse `parseDateTime64BestEffortOrNull` — that raw CH name is not exposed in HogQL) and `ifNull`-unwrap any Nullable column before an array function (`JSONExtractArrayRaw` / `splitByChar`), because ClickHouse rejects an Array nested inside a Nullable. `source_schema.py` mirrors these exact types so the seed and tests exercise the real path — violating this contract 500'd every endpoint on real data while idealized-fixture tests stayed green.
-- **Analytics aggregate at team/repo level only — no author-level surface, ever.** _(Changed — reason:)_ the v1 UI grew an authors tab, author list/detail pages, hub leaderboards, and an `author_workflow_costs` endpoint; all were removed. Per-author aggregation is per-developer surveillance (§2), and every such surface invites ranking people. Author stays on the `PullRequest` contract as display metadata (attribution on a PR row) and as a list _filter_ for finding work — never as an aggregation level, a page, or a cost rollup. Don't re-add an author-scoped aggregate endpoint or UI surface.
+- **No author leaderboards or per-developer performance rankings — but the author page and its cost breakdown are allowed.** _(Changed — reason:)_ the v1 UI first grew an authors tab, hub leaderboards, per-author _performance_ tiles (median open→merge, re-run cycles), and an `author_workflow_costs` endpoint; a follow-up removed **all** of it, including the author page and its cost breakdown, and locked "no author surface, ever". That over-corrected: the surveillance risk is in _ranking people against each other_ (leaderboards, cross-author cycle-time/flaky scores), not in an engineer opening their own page to see their PRs and what their CI runs cost. So the line is drawn at rankings, not at the author page:
+ - **Removed and kept out:** the authors tab/list, hub author leaderboards, and per-developer _performance_ metrics (median open→merge, flaky/re-run scores) as author-scoped surfaces. Don't re-add a ranked, cross-author aggregate.
+ - **Restored:** the author page — the shared PR table filtered to one author, plus that author's own CI **cost** (windowed spend tiles + the `author_workflow_costs` split-by-workflow breakdown). Cost is transparent spend, not a performance judgement, and the page is reachable only from the author links on PR rows (no list, no ranking of one author against another). The `author_workflow_costs` endpoint stays a UI-only read (its MCP tool is `enabled: false`); attribution is by PR number (SPEC §7), same as every other cost surface.
- **Bot detection** defined once in the read layer: `handle.endswith("[bot]") OR handle in KNOWN_BOT_HANDLES`. Hardcoded allowlist for v1; per-team config deferred.
- **Bots and drafts excluded by default** in throughput / cycle-time recipes (an explicit column flag + a default filter the skill applies). First-class in any future bot-impact analysis — don't strip them at the substrate.
- **Time to merge v1** = `open_to_merge_seconds` = `merged_at - created_at`, coarse (combines draft + ready-for-review time). The precise companion lands with state-transition data.
diff --git a/products/engineering_analytics/backend/facade/api.py b/products/engineering_analytics/backend/facade/api.py
index acb332e7cb46..ea025773beb1 100644
--- a/products/engineering_analytics/backend/facade/api.py
+++ b/products/engineering_analytics/backend/facade/api.py
@@ -35,6 +35,7 @@ from products.engineering_analytics.backend.facade.contracts import (
QuarantineRequestResult,
RepoOverview,
RunFailureLogs,
+ WorkflowCost,
WorkflowHealthItem,
WorkflowJob,
WorkflowJobAggregate,
@@ -185,6 +186,23 @@ def get_workflow_runner_costs(
)
+def list_author_workflow_costs(
+ *,
+ team: Team,
+ author: str,
+ date_from: str | None = None,
+ date_to: str | None = None,
+ source_id: str | None = None,
+ user_access_control: "UserAccessControl | None" = None,
+) -> list[WorkflowCost]:
+ return logic.build_author_workflow_costs(
+ curated=_authorized_source(team, source_id, user_access_control),
+ author=author,
+ date_from=date_from,
+ date_to=date_to,
+ )
+
+
def list_workflow_jobs(
*,
team: Team,
diff --git a/products/engineering_analytics/backend/logic/__init__.py b/products/engineering_analytics/backend/logic/__init__.py
index bcde691abd8d..8c416dee327c 100644
--- a/products/engineering_analytics/backend/logic/__init__.py
+++ b/products/engineering_analytics/backend/logic/__init__.py
@@ -23,6 +23,7 @@ from products.engineering_analytics.backend.facade.contracts import (
PullRequestList,
RepoOverview,
RunFailureLogs,
+ WorkflowCost,
WorkflowHealthItem,
WorkflowJob,
WorkflowJobAggregate,
@@ -42,7 +43,11 @@ from products.engineering_analytics.backend.logic.queries.ci_failure_logs import
)
from products.engineering_analytics.backend.logic.queries.job_aggregates import query_job_aggregates
from products.engineering_analytics.backend.logic.queries.master_failures import query_master_failures
-from products.engineering_analytics.backend.logic.queries.pr_cost import query_pr_cost, query_workflow_runner_costs
+from products.engineering_analytics.backend.logic.queries.pr_cost import (
+ query_author_workflow_costs,
+ query_pr_cost,
+ query_workflow_runner_costs,
+)
from products.engineering_analytics.backend.logic.queries.pr_lifecycle import query_pr_lifecycle
from products.engineering_analytics.backend.logic.queries.pr_runs import query_pr_runs
from products.engineering_analytics.backend.logic.queries.pull_request_list import query_pull_request_list
@@ -183,6 +188,19 @@ def build_workflow_runner_costs(
)
+def build_author_workflow_costs(
+ *,
+ curated: CuratedGitHubSource,
+ author: str,
+ date_from: str | None = None,
+ date_to: str | None = None,
+) -> list[WorkflowCost]:
+ if not author.strip():
+ raise ValueError("author is required")
+ parsed_from, parsed_to = _parse_window(curated.team, date_from, date_to, default=_DEFAULT_WINDOW)
+ return query_author_workflow_costs(curated=curated, author=author.strip(), date_from=parsed_from, date_to=parsed_to)
+
+
def build_ci_cards(*, curated: CuratedGitHubSource) -> CICardSummary:
return query_ci_cards(curated=curated)
diff --git a/products/engineering_analytics/backend/logic/queries/pr_cost.py b/products/engineering_analytics/backend/logic/queries/pr_cost.py
index 20b712b80509..71e3b0053265 100644
--- a/products/engineering_analytics/backend/logic/queries/pr_cost.py
+++ b/products/engineering_analytics/backend/logic/queries/pr_cost.py
@@ -205,6 +205,66 @@ def query_workflow_window_costs(
return {workflow: aggregate_pr_cost(jobs) for workflow, jobs in by_workflow.items()}
+# One author's CI spend split by workflow (the author page's "where their CI minutes go"). Runs are
+# attributed to the author through their PRs, keyed on (repo_owner, repo_name, pr_number) — never
+# pr_number alone, since PR numbers restart per repo (SPEC §7). Windowed on the run start so the figure
+# answers "spend over [window]", never an unbounded all-time.
+_AUTHOR_WORKFLOW_SELECT = """
+ SELECT
+ r.workflow_name, j.labels,
+ countIf(j.duration_seconds IS NOT NULL) AS finished,
+ sumIf(greatest(j.duration_seconds, 0), j.duration_seconds IS NOT NULL) AS elapsed,
+ countIf(j.duration_seconds IS NULL) AS unfinished
+ FROM __JOBS_SOURCE__ AS j
+ INNER JOIN __RUNS_SOURCE__ AS r ON j.run_id = r.id AND j.run_attempt = r.run_attempt
+ INNER JOIN (
+ SELECT DISTINCT repo_owner, repo_name, number FROM __PR_SOURCE__ WHERE author_handle = {author}
+ ) AS ap ON r.repo_owner = ap.repo_owner AND r.repo_name = ap.repo_name AND r.pr_number = ap.number
+ WHERE r.run_started_at >= {date_from} __DATE_TO__
+ GROUP BY r.workflow_name, j.labels
+ LIMIT 1000000
+"""
+
+
+def query_author_workflow_costs(
+ *,
+ curated: CuratedGitHubSource,
+ author: str,
+ date_from: datetime,
+ date_to: datetime | None,
+) -> list[WorkflowCost]:
+ """One author's billable CI cost split by workflow over [date_from, date_to], highest spend first.
+
+ Empty when the jobs source isn't synced. Same grouped+expand shape as the other cost queries;
+ the author→runs link goes through their PR numbers (the one attribution rule, SPEC §7).
+ """
+ jobs_source = curated.jobs_source()
+ if jobs_source is None:
+ return []
+ placeholders: dict[str, ast.Expr] = {
+ "author": ast.Constant(value=author),
+ "date_from": ast.Constant(value=date_from),
+ }
+ date_to_clause = ""
+ if date_to is not None:
+ date_to_clause = "AND r.run_started_at <= {date_to}"
+ placeholders["date_to"] = ast.Constant(value=date_to)
+ sql = (
+ _AUTHOR_WORKFLOW_SELECT.replace("__JOBS_SOURCE__", jobs_source)
+ .replace("__RUNS_SOURCE__", curated.run_source())
+ .replace("__PR_SOURCE__", curated.pr_source())
+ .replace("__DATE_TO__", date_to_clause)
+ )
+ response = curated.run(sql, query_type="engineering_analytics.author_workflow_costs", placeholders=placeholders)
+ by_workflow: dict[str, list[tuple[list[str], float | None]]] = defaultdict(list)
+ for workflow_name, labels, finished, elapsed, unfinished in response.results or []:
+ by_workflow[workflow_name or ""].extend(
+ _expand_jobs(_parse_labels(labels), int(finished or 0), float(elapsed or 0.0), int(unfinished or 0))
+ )
+ costs = [_to_workflow_cost(workflow, aggregate_pr_cost(jobs)) for workflow, jobs in by_workflow.items()]
+ return sorted(costs, key=lambda cost: (cost.estimated_cost_usd or 0.0, cost.billable_minutes), reverse=True)
+
+
# The window-cost shape twice over — the current window and the equal-length one before it — as
# per-window conditional aggregates on one jobs⋈runs scan, so the repo hub's delta doesn't pay the
# (largest-table) join twice. Window predicates mirror the two separate calls exactly.
diff --git a/products/engineering_analytics/backend/presentation/views.py b/products/engineering_analytics/backend/presentation/views.py
index 53409d8c23bb..2a736e10cfdb 100644
--- a/products/engineering_analytics/backend/presentation/views.py
+++ b/products/engineering_analytics/backend/presentation/views.py
@@ -40,6 +40,7 @@ from products.engineering_analytics.backend.presentation.serializers import (
QuarantineRequestSerializer,
RepoOverviewSerializer,
RunFailureLogsSerializer,
+ WorkflowCostSerializer,
WorkflowHealthItemSerializer,
WorkflowJobAggregateSerializer,
WorkflowJobSerializer,
@@ -140,6 +141,7 @@ class EngineeringAnalyticsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSe
"workflow_runs",
"workflow_run_activity",
"workflow_runner_costs",
+ "author_workflow_costs",
"workflow_jobs",
"repo_overview",
"master_failures",
@@ -663,6 +665,48 @@ class EngineeringAnalyticsViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSe
return _bad_request(exc, fallback="Invalid date, repo, or source_id")
return Response(WorkflowRunnerCostSerializer(instance=costs, many=True).data)
+ @extend_schema(
+ operation_id="engineering_analytics_author_workflow_costs",
+ parameters=[
+ OpenApiParameter(
+ name="author",
+ type=OpenApiTypes.STR,
+ location=OpenApiParameter.QUERY,
+ required=True,
+ description="GitHub handle whose CI spend to break down.",
+ ),
+ _DATE_FROM,
+ _DATE_TO,
+ _SOURCE_ID,
+ ],
+ responses={
+ 200: WorkflowCostSerializer(many=True),
+ 400: OpenApiResponse(description="Missing author, or invalid date or source_id."),
+ },
+ description=(
+ "One author's estimated CI cost split by workflow over a window (date_from default -30d), "
+ "highest spend first. Runs are attributed to the author through their pull requests (attribution "
+ "is by PR number). Returns an empty list when the job-level source isn't synced."
+ ),
+ )
+ @action(detail=False, methods=["get"], pagination_class=None)
+ def author_workflow_costs(self, request: Request, **kwargs) -> Response:
+ author = request.query_params.get("author")
+ if not author:
+ return Response({"detail": "author is required"}, status=status.HTTP_400_BAD_REQUEST)
+ try:
+ costs = api.list_author_workflow_costs(
+ team=self.team,
+ author=author,
+ date_from=request.query_params.get("date_from") or None,
+ date_to=request.query_params.get("date_to") or None,
+ source_id=request.query_params.get("source_id") or None,
+ user_access_control=self.user_access_control,
+ )
+ except ValueError as exc:
+ return _bad_request(exc, fallback="Invalid author, date, or source_id")
+ return Response(WorkflowCostSerializer(instance=costs, many=True).data)
+
@extend_schema(
operation_id="engineering_analytics_workflow_jobs",
parameters=[
diff --git a/products/engineering_analytics/frontend/components/PullRequestTable.tsx b/products/engineering_analytics/frontend/components/PullRequestTable.tsx
index cef561565ae6..3318b634c93d 100644
--- a/products/engineering_analytics/frontend/components/PullRequestTable.tsx
+++ b/products/engineering_analytics/frontend/components/PullRequestTable.tsx
@@ -1,5 +1,6 @@
-// Shared by the repo hub and the PR list. Author renders as plain metadata and links nowhere
-// in-product (attribution, never a unit of analysis — see SPEC §2).
+// Shared by the repo hub, the PR list, and the author page. Author is attribution, not an aggregation
+// level (SPEC §2): the handle links to the author's PR list (a filter for finding work), never to a
+// per-author metric or ranking. Hidden on the author page itself, where every row is the same author.
import { combineUrl, router } from 'kea-router'
import { ReactNode } from 'react'
@@ -44,6 +45,8 @@ export interface PullRequestTableProps {
sourceId: string | null
/** Show the pushes / re-runs / CI cost columns. */
costLensEnabled: boolean
+ /** Author column is redundant on the author page (every row is the same author) — hide it there. */
+ showAuthor?: boolean
/** Rows per page — the list page's 50 by default; the hub passes a small page to stay scannable. */
pageSize?: number
emptyState?: ReactNode
@@ -55,6 +58,7 @@ export function PullRequestTable({
loading,
sourceId,
costLensEnabled,
+ showAuthor = true,
pageSize = 50,
emptyState,
dataAttr = 'engineering-analytics-pr-table',
@@ -92,20 +96,34 @@ export function PullRequestTable({
width: 104,
render: (_, row) => <PullRequestStateTag state={row.state} isDraft={row.isDraft} />,
},
- {
- title: 'Author',
- key: 'author',
- width: 170,
- render: (_, row) => (
- <div className="flex items-center gap-1.5">
- {row.authorAvatarUrl && (
- <img src={row.authorAvatarUrl} alt="" className="size-5 shrink-0 rounded-full" />
- )}
- <span className="text-xs font-medium">{row.authorHandle}</span>
- {row.isBot && <LemonTag type="muted">bot</LemonTag>}
- </div>
- ),
- },
+ ...(showAuthor
+ ? ([
+ {
+ title: 'Author',
+ key: 'author',
+ width: 170,
+ render: (_, row) => (
+ <div className="flex items-center gap-1.5">
+ {row.authorAvatarUrl && (
+ <img src={row.authorAvatarUrl} alt="" className="size-5 shrink-0 rounded-full" />
+ )}
+ <Link
+ to={
+ combineUrl(
+ urls.engineeringAnalyticsAuthor(row.authorHandle),
+ sourceId ? { source: sourceId } : {}
+ ).url
+ }
+ className="text-xs font-medium"
+ >
+ {row.authorHandle}
+ </Link>
+ {row.isBot && <LemonTag type="muted">bot</LemonTag>}
+ </div>
+ ),
+ },
+ ] as LemonTableColumns<PullRequestRow>)
+ : []),
{
title: 'CI',
key: 'ci',
@@ -183,7 +201,7 @@ export function PullRequestTable({
onRow={(row) => {
const detailUrl = detailUrlOf(row, sourceId)
return {
- // Inner links (#id → GitHub) keep their own behavior.
+ // Inner links (#id → GitHub, author → author page) keep their own behavior.
onClick: (e: React.MouseEvent) => {
if ((e.target as HTMLElement).closest('a, button')) {
return
diff --git a/products/engineering_analytics/frontend/generated/api.schemas.ts b/products/engineering_analytics/frontend/generated/api.schemas.ts
index 896202e37d70..14ce6845d650 100644
--- a/products/engineering_analytics/frontend/generated/api.schemas.ts
+++ b/products/engineering_analytics/frontend/generated/api.schemas.ts
@@ -7,6 +7,24 @@
* PostHog API - generated
* OpenAPI spec version: 1.0.0
*/
+export interface WorkflowCostApi {
+ /** GitHub Actions workflow name this cost is for. */
+ workflow_name: string
+ /** Billable (self-hosted) minutes for this workflow within the scope. */
+ billable_minutes: number
+ /**
+ * Estimated dollar cost for this workflow, or null when nothing was costable.
+ * @nullable
+ */
+ estimated_cost_usd: number | null
+ /** Costed jobs for this workflow (billable Linux runner, finished). */
+ costed_jobs: number
+ /** Billable Linux jobs still queued/running for this workflow. */
+ unsettled_jobs: number
+ /** Provider-hosted/non-Linux jobs for this workflow, outside the estimate. */
+ excluded_jobs: number
+}
+
export interface CICardSummaryApi {
/** Count of open pull requests. */
open_prs: number
@@ -136,24 +154,6 @@ export interface MasterFailureGroupApi {
latest_run_id: number
}
-export interface WorkflowCostApi {
- /** GitHub Actions workflow name this cost is for. */
- workflow_name: string
- /** Billable (self-hosted) minutes for this workflow within the scope. */
- billable_minutes: number
- /**
- * Estimated dollar cost for this workflow, or null when nothing was costable.
- * @nullable
- */
- estimated_cost_usd: number | null
- /** Costed jobs for this workflow (billable Linux runner, finished). */
- costed_jobs: number
- /** Billable Linux jobs still queued/running for this workflow. */
- unsettled_jobs: number
- /** Provider-hosted/non-Linux jobs for this workflow, outside the estimate. */
- excluded_jobs: number
-}
-
export interface RunCostApi {
/** GitHub Actions run id this cost is for. */
run_id: number
@@ -808,6 +808,25 @@ export interface WorkflowRunnerCostApi {
estimated_cost_usd: number | null
}
+export type EngineeringAnalyticsAuthorWorkflowCostsParams = {
+ /**
+ * GitHub handle whose CI spend to break down.
+ */
+ author: string
+ /**
+ * Window start: relative ('-30d', '-8w') or ISO8601. Defaults to -30d.
+ */
+ date_from?: string
+ /**
+ * Window end: relative or ISO8601. Defaults to now.
+ */
+ date_to?: string
+ /**
+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.
+ */
+ source_id?: string
+}
+
export type EngineeringAnalyticsCiCardsParams = {
/**
* Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.
diff --git a/products/engineering_analytics/frontend/generated/api.ts b/products/engineering_analytics/frontend/generated/api.ts
index 7689881ab4df..2ba232fe6cc1 100644
--- a/products/engineering_analytics/frontend/generated/api.ts
+++ b/products/engineering_analytics/frontend/generated/api.ts
@@ -11,6 +11,7 @@ import { apiMutator } from '../../../../frontend/src/lib/api-orval-mutator'
import type {
CICardSummaryApi,
CIFailureLogsApi,
+ EngineeringAnalyticsAuthorWorkflowCostsParams,
EngineeringAnalyticsCiCardsParams,
EngineeringAnalyticsCiFailureLogsParams,
EngineeringAnalyticsJobAggregatesParams,
@@ -38,6 +39,7 @@ import type {
QuarantineRequestResultApi,
RepoOverviewApi,
RunFailureLogsApi,
+ WorkflowCostApi,
WorkflowHealthItemApi,
WorkflowJobAggregateApi,
WorkflowJobApi,
@@ -46,6 +48,39 @@ import type {
WorkflowRunnerCostApi,
} from './api.schemas'
+export const getEngineeringAnalyticsAuthorWorkflowCostsUrl = (
+ projectId: string,
+ params: EngineeringAnalyticsAuthorWorkflowCostsParams
+) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : String(value))
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/projects/${projectId}/engineering_analytics/author_workflow_costs/?${stringifiedParams}`
+ : `/api/projects/${projectId}/engineering_analytics/author_workflow_costs/`
+}
+
+/**
+ * One author's estimated CI cost split by workflow over a window (date_from default -30d), highest spend first. Runs are attributed to the author through their pull requests (attribution is by PR number). Returns an empty list when the job-level source isn't synced.
+ */
+export const engineeringAnalyticsAuthorWorkflowCosts = async (
+ projectId: string,
+ params: EngineeringAnalyticsAuthorWorkflowCostsParams,
+ options?: RequestInit
+): Promise<WorkflowCostApi[]> => {
+ return apiMutator<WorkflowCostApi[]>(getEngineeringAnalyticsAuthorWorkflowCostsUrl(projectId, params), {
+ ...options,
+ method: 'GET',
+ })
+}
+
export const getEngineeringAnalyticsCiCardsUrl = (projectId: string, params?: EngineeringAnalyticsCiCardsParams) => {
const normalizedParams = new URLSearchParams()
diff --git a/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
new file mode 100644
index 000000000000..7700eea5576f
--- /dev/null
+++ b/products/engineering_analytics/frontend/scenes/EngineeringAnalyticsAuthorScene.tsx
@@ -0,0 +1,222 @@
+import { useActions, useValues } from 'kea'
+import { combineUrl } from 'kea-router'
+
+import { Link, Spinner } from '@posthog/lemon-ui'
+
+import { DateFilter } from 'lib/components/DateFilter/DateFilter'
+import { LemonCard } from 'lib/lemon-ui/LemonCard'
+import { Lettermark } from 'lib/lemon-ui/Lettermark'
+import { dateMapping } from 'lib/utils/dateFilters'
+import { pluralize } from 'lib/utils/strings'
+import { SceneExport } from 'scenes/sceneTypes'
+import { urls } from 'scenes/urls'
+
+import { SceneContent } from '~/layout/scenes/components/SceneContent'
+import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
+
+import { EntityHeader, VerdictPill } from '../components/EntityHeader'
+import { MetricTile } from '../components/MetricTile'
+import { PullRequestTable } from '../components/PullRequestTable'
+import { formatCost, formatMinutes } from '../components/runTables'
+import { RepoScopeChip, ScopeBar } from '../components/ScopeBar'
+import { Section, SectionNav } from '../components/Section'
+import { ShareRow } from '../components/ShareRow'
+import { AuthorLogicProps, authorLogic } from './authorLogic'
+import { SHARED_DEFAULT_DATE_FROM, engineeringAnalyticsFiltersLogic } from './engineeringAnalyticsFiltersLogic'
+
+const SHARE_COLORS = ['var(--brand-blue)', 'var(--success)', 'var(--warning)', 'var(--purple)', 'var(--danger)']
+
+// date_from only (the list floors on it); "all time" / week+month snaps and Custom are out. Every option
+// here stays within the list's 365d load window (max preset is 180d / YTD), so the client-side cost tiles
+// are always a subset of the loaded PRs — a Custom range could reach past the load and desync the tiles
+// from the server-windowed workflow breakdown.
+const AUTHOR_DATE_OPTIONS = dateMapping.filter(({ key }) =>
+ ['Last 7 days', 'Last 14 days', 'Last 30 days', 'Last 90 days', 'Last 180 days', 'Year to date'].includes(key)
+)
+
+export const scene: SceneExport<AuthorLogicProps> = {
+ component: EngineeringAnalyticsAuthorScene,
+ logic: authorLogic,
+ paramsToProps: ({ params: { handle }, searchParams: { source } }) => ({
+ handle: decodeURIComponent(handle),
+ sourceId: source ?? null,
+ }),
+}
+
+export function EngineeringAnalyticsAuthorScene(): JSX.Element {
+ const {
+ handle,
+ prs,
+ prsLoading,
+ windowedRows,
+ totalCostUsd,
+ totalBillableMinutes,
+ openPrCount,
+ workflowCosts,
+ workflowCostsLoading,
+ sourceId,
+ } = useValues(authorLogic)
+ const { dateFrom, dateTo } = useValues(engineeringAnalyticsFiltersLogic)
+ const { setDateRange } = useActions(engineeringAnalyticsFiltersLogic)
+
+ const hubUrl = combineUrl(urls.engineeringAnalytics(), sourceId ? { source: sourceId } : {}).url
+ const avatarUrl = prs[0]?.authorAvatarUrl
+ const workflowCostsTotal = workflowCosts.reduce((sum, c) => sum + (c.estimated_cost_usd ?? 0), 0)
+ // A source can hold several repos, so the author's PRs may span repos. Only claim one repo (and link
+ // per-workflow into it) when they all agree; otherwise the page is genuinely cross-repo.
+ const repoSlugs = Array.from(new Set(prs.map((pr) => `${pr.repoOwner}/${pr.repoName}`)))
+ const singleRepo = repoSlugs.length === 1 ? prs[0] : null
+
+ return (
+ <SceneContent>
+ <SceneTitleSection name={handle} resourceType={{ type: 'health' }} />
+ <ScopeBar
+ repoSlot={
+ <RepoScopeChip
+ label={
+ repoSlugs.length === 1 ? repoSlugs[0] : repoSlugs.length ? 'All repositories' : 'Repository'
+ }
+ to={hubUrl}
+ />
+ }
+ lensFilter={{ label: `author: ${handle}`, to: hubUrl }}
+ showDate={false}
+ />
+ <EntityHeader
+ icon={
+ avatarUrl ? (
+ <img src={avatarUrl} alt="" className="size-10 rounded-lg" />
+ ) : (
+ <Lettermark name={handle} />
+ )
+ }
+ title={handle}
+ slug={
+ <Link to={`https://github.com/${encodeURIComponent(handle)}`} target="_blank" targetBlankIcon>
+ github.com/{handle}
+ </Link>
+ }
+ right={
+ prsLoading ? undefined : <VerdictPill kind="muted">{pluralize(openPrCount, 'open PR')}</VerdictPill>
+ }
+ />
+ {/* The author page is a way to find and explain one's own work — it lists this author's PRs and
+ their CI cost. It carries no per-developer performance/ranking metric (no cycle time, no flaky
+ score): the cost figures are transparent spend, not a scoreboard (SPEC §2). */}
+ <div className="flex flex-col gap-4">
+ {/* The picker scopes the cost tiles only — the PR list below stays the author's recent PRs. */}
+ <div className="flex flex-col gap-2">
+ <div className="flex flex-wrap items-center gap-2">
+ <span className="text-xs font-semibold tracking-wide text-secondary uppercase">CI cost</span>
+ <span className="text-xs text-tertiary">for PRs opened in</span>
+ <DateFilter
+ dateFrom={dateFrom}
+ dateTo={dateTo}
+ onChange={(from, to) => setDateRange(from ?? SHARED_DEFAULT_DATE_FROM, to ?? null)}
+ dateOptions={AUTHOR_DATE_OPTIONS}
+ size="small"
+ />
+ </div>
+ <div className="flex flex-wrap gap-2.5">
+ <MetricTile
+ label="Pull requests opened"
+ value={windowedRows.length.toLocaleString()}
+ sub="in the selected window"
+ />
+ <MetricTile
+ label="CI cost"
+ tooltip="Full CI cost of the PRs opened in the selected window, across each PR's whole history — not only runs inside the window. The 'Where their CI minutes go' breakdown below counts CI runs started in the window instead, so the two won't reconcile exactly."
+ value={formatCost(totalCostUsd)}
+ sub={
+ totalCostUsd != null
+ ? `${formatMinutes(totalBillableMinutes)} billable · ${formatCost(
+ windowedRows.length ? totalCostUsd / windowedRows.length : null
+ )} per PR`
+ : 'no cost data yet'
+ }
+ />
+ </div>
+ </div>
+
+ <SectionNav
+ items={[
+ { id: 'author-prs', label: 'Pull requests' },
+ { id: 'author-cost', label: 'Cost' },
+ ]}
+ />
+
+ <Section
+ id="author-prs"
+ title="Pull requests"
+ note="the shared PR table, filtered to one author"
+ right={
+ !prsLoading ? <span className="text-secondary">{pluralize(prs.length, 'PR')}</span> : undefined
+ }
+ >
+ <PullRequestTable
+ rows={prs}
+ loading={prsLoading}
+ sourceId={sourceId}
+ costLensEnabled
+ showAuthor={false}
+ dataAttr="engineering-analytics-author-pr-table"
+ emptyState={`No pull requests for ${handle} in the last year.`}
+ />
+ </Section>
+
+ <Section
+ id="author-cost"
+ title="Where their CI minutes go"
+ note="CI runs started in the selected window, split by workflow (attributed via this author's PRs)"
+ >
+ {workflowCosts.length > 0 ? (
+ <LemonCard hoverEffect={false} className="p-4 lg:max-w-xl">
+ <h3 className="mb-1 flex items-center gap-1.5 text-xs font-semibold text-secondary">
+ By workflow
+ {workflowCostsLoading && <Spinner className="text-xs" />}
+ </h3>
+ {workflowCosts.slice(0, 8).map((cost, i) => (
+ <ShareRow
+ key={cost.workflow_name || '(unknown)'}
+ label={cost.workflow_name || '(unknown workflow)'}
+ sub={`${formatMinutes(cost.billable_minutes)} billable`}
+ value={formatCost(cost.estimated_cost_usd)}
+ share={
+ workflowCostsTotal > 0 ? (cost.estimated_cost_usd ?? 0) / workflowCostsTotal : 0
+ }
+ color={SHARE_COLORS[i % SHARE_COLORS.length]}
+ to={
+ singleRepo
+ ? combineUrl(
+ urls.engineeringAnalyticsWorkflowRuns(
+ singleRepo.repoOwner,
+ singleRepo.repoName,
+ cost.workflow_name
+ ),
+ sourceId ? { source: sourceId } : {}
+ ).url
+ : undefined
+ }
+ />
+ ))}
+ {workflowCosts.length > 8 && (
+ <div className="pt-2 text-xs text-tertiary">
+ +{workflowCosts.length - 8} more{' '}
+ {pluralize(workflowCosts.length - 8, 'workflow', undefined, false)}, not shown
+ </div>
+ )}
+ </LemonCard>
+ ) : (
+ <span className="text-xs text-secondary">
+ {workflowCostsLoading
+ ? 'Loading…'
+ : "No cost data — the job-level source isn't synced, or nothing ran in the window."}
+ </span>
+ )}
+ </Section>
+ </div>
+ </SceneContent>
+ )
+}
+
+export default EngineeringAnalyticsAuthorScene
diff --git a/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx b/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx
index aaa918d07f3f..9b41b786789b 100644
--- a/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx
+++ b/products/engineering_analytics/frontend/scenes/PullRequestDetailScene.tsx
@@ -691,7 +691,16 @@ export function PullRequestDetailScene(): JSX.Element {
className="size-4 shrink-0 rounded-full"
/>
)}
- <span>{pullRequest.author.handle}</span>
+ <Link
+ to={
+ combineUrl(
+ urls.engineeringAnalyticsAuthor(pullRequest.author.handle),
+ sourceId ? { source: sourceId } : {}
+ ).url
+ }
+ >
+ {pullRequest.author.handle}
+ </Link>
{pullRequest.author.is_bot && <LemonTag type="muted">bot</LemonTag>}
</span>
<span>
diff --git a/products/engineering_analytics/frontend/scenes/authorLogic.ts b/products/engineering_analytics/frontend/scenes/authorLogic.ts
new file mode 100644
index 000000000000..33413618d37a
--- /dev/null
+++ b/products/engineering_analytics/frontend/scenes/authorLogic.ts
@@ -0,0 +1,135 @@
+import { afterMount, connect, kea, key, listeners, path, props, selectors } from 'kea'
+import { loaders } from 'kea-loaders'
+
+import { ApiConfig } from 'lib/api'
+import { dayjs } from 'lib/dayjs'
+import { dateStringToDayJs } from 'lib/utils/dateFilters'
+import { urls } from 'scenes/urls'
+
+import { Breadcrumb } from '~/types'
+
+import { engineeringAnalyticsAuthorWorkflowCosts, engineeringAnalyticsPullRequests } from '../generated/api'
+import type { WorkflowCostApi } from '../generated/api.schemas'
+import type { authorLogicType } from './authorLogicType'
+import { engineeringAnalyticsFiltersLogic } from './engineeringAnalyticsFiltersLogic'
+import { PullRequestRow, toPullRequestRow } from './engineeringAnalyticsLogic'
+
+const projectId = (): string => String(ApiConfig.getCurrentProjectId())
+
+// The author page is a filtered view of the PR list (author as a filter for finding work — SPEC §2),
+// not an aggregation level. The list load needs a floor for finished PRs — wide so it reads as "this
+// author's recent PRs", and wider than any cost-tile window so the tiles stay a subset. Open PRs come
+// back regardless.
+const LIST_WINDOW = '-365d'
+
+export interface AuthorLogicProps {
+ handle: string
+ // Which GitHub source the list was scoped to, threaded from `?source=` via paramsToProps.
+ sourceId: string | null
+}
+
+export const authorLogic = kea<authorLogicType>([
+ path(['products', 'engineering_analytics', 'frontend', 'scenes', 'authorLogic']),
+ props({} as AuthorLogicProps),
+ key((props) => `author/${props.handle}@${props.sourceId ?? ''}`),
+
+ // Shares the CI-analytics window, but only to scope the cost tiles (a client-side filter over the
+ // already-loaded PRs) — the PR list below is never re-scoped, so changing the window never reloads it.
+ connect(() => ({
+ values: [engineeringAnalyticsFiltersLogic, ['dateFrom', 'dateTo']],
+ })),
+
+ loaders(({ props, values }) => ({
+ prs: [
+ [] as PullRequestRow[],
+ {
+ // Loaded once: the author's recent PRs, mapped to the shared table row shape. Stable across
+ // date changes — the picker only scopes the cost tiles.
+ loadPrs: async (): Promise<PullRequestRow[]> => {
+ const result = await engineeringAnalyticsPullRequests(projectId(), {
+ author: props.handle,
+ date_from: LIST_WINDOW,
+ source_id: props.sourceId ?? undefined,
+ })
+ return result.items.map(toPullRequestRow)
+ },
+ },
+ ],
+ // The author's CI spend split by workflow over the shared window — "where their CI minutes go".
+ // [] when the job-level source isn't synced.
+ workflowCosts: [
+ [] as WorkflowCostApi[],
+ {
+ loadWorkflowCosts: async (): Promise<WorkflowCostApi[]> =>
+ await engineeringAnalyticsAuthorWorkflowCosts(projectId(), {
+ author: props.handle,
+ date_from: values.dateFrom ?? undefined,
+ date_to: values.dateTo ?? undefined,
+ source_id: props.sourceId ?? undefined,
+ }),
+ },
+ ],
+ })),
+
+ listeners(({ actions }) => ({
+ // The shared window scopes the cost breakdown — reload it when the picker changes.
+ [engineeringAnalyticsFiltersLogic.actionTypes.setDateRange]: () => {
+ actions.loadWorkflowCosts()
+ },
+ })),
+
+ selectors({
+ sourceId: [() => [(_, p: AuthorLogicProps) => p.sourceId], (sourceId): string | null => sourceId],
+ handle: [() => [(_, p: AuthorLogicProps) => p.handle], (handle): string => handle],
+ // The cost-tile scope: PRs opened within the selected window. The list shows every loaded PR; only
+ // the cost KPIs narrow to this subset, so the date picker reads as "CI cost of PRs opened in window".
+ windowedRows: [
+ (s) => [s.prs, s.dateFrom, s.dateTo],
+ (prs: PullRequestRow[], dateFrom: string | null, dateTo: string | null): PullRequestRow[] => {
+ const from = dateFrom ? dateStringToDayJs(dateFrom) : null
+ const to = dateTo ? dateStringToDayJs(dateTo) : null
+ return prs.filter((pr) => {
+ const created = dayjs(pr.createdAt)
+ // Inclusive of both bounds so a PR opened on the boundary day isn't dropped.
+ return (!from || !created.isBefore(from)) && (!to || !created.isAfter(to))
+ })
+ },
+ ],
+ // Author CI cost across the in-window PRs — null when nothing was costable / the job source is unsynced.
+ totalCostUsd: [
+ (s) => [s.windowedRows],
+ (rows: PullRequestRow[]): number | null => {
+ const costs = rows.map((pr) => pr.estimatedCostUsd).filter((c): c is number => c != null)
+ return costs.length ? costs.reduce((sum, c) => sum + c, 0) : null
+ },
+ ],
+ totalBillableMinutes: [
+ (s) => [s.windowedRows],
+ (rows: PullRequestRow[]): number | null => {
+ const minutes = rows.map((pr) => pr.billableMinutes).filter((m): m is number => m != null)
+ return minutes.length ? minutes.reduce((sum, m) => sum + m, 0) : null
+ },
+ ],
+ openPrCount: [
+ (s) => [s.prs],
+ (prs: PullRequestRow[]): number => prs.filter((pr) => pr.state === 'open').length,
+ ],
+ breadcrumbs: [
+ (_, p) => [p.handle],
+ (handle): Breadcrumb[] => [
+ {
+ key: 'EngineeringAnalytics',
+ name: 'Engineering analytics',
+ path: urls.engineeringAnalytics(),
+ iconType: 'health',
+ },
+ { key: ['EngineeringAnalyticsAuthor', handle], name: handle, iconType: 'health' },
+ ],
+ ],
+ }),
+
+ afterMount(({ actions }) => {
+ actions.loadPrs()
+ actions.loadWorkflowCosts()
+ }),
+])
diff --git a/products/engineering_analytics/manifest.tsx b/products/engineering_analytics/manifest.tsx
index 76f7a82076fd..7f0a1a7c5db3 100644
--- a/products/engineering_analytics/manifest.tsx
+++ b/products/engineering_analytics/manifest.tsx
@@ -41,6 +41,14 @@ export const manifest: ProductManifest = {
description: "A single workflow's recent runs across the connected repo.",
iconType: 'health',
},
+ EngineeringAnalyticsAuthor: {
+ import: () => import('./frontend/scenes/EngineeringAnalyticsAuthorScene'),
+ projectBased: true,
+ name: 'Author',
+ layout: 'app-container',
+ description: "One author's pull requests — a filtered view for finding work, not a ranking.",
+ iconType: 'health',
+ },
},
// Detail paths mirror GitHub 1:1 (owner/repo/pull/:n, owner/repo/actions/runs/:id); cross-repo
// aggregates stay at the product root. Provider lives on the data (RepoRef.provider), so these url
@@ -62,11 +70,13 @@ export const manifest: ProductManifest = {
'EngineeringAnalyticsWorkflowRuns',
'engineeringAnalyticsWorkflowRuns',
],
+ '/engineering-analytics/author/:handle': ['EngineeringAnalyticsAuthor', 'engineeringAnalyticsAuthor'],
},
redirects: {
- // The author surface was removed: analytics stay at team/repo level (see README locked decisions).
+ // The author *list* (leaderboards / rankings) stays removed — analytics aggregate at team/repo
+ // level only (see README locked decisions). The per-author page is a filtered PR view, reachable
+ // only via the author links on PR rows, so it keeps its route above.
'/engineering-analytics/authors': '/engineering-analytics',
- '/engineering-analytics/author/:handle': '/engineering-analytics',
},
urls: {
engineeringAnalytics: (): string => '/engineering-analytics',
@@ -79,6 +89,8 @@ export const manifest: ProductManifest = {
`/engineering-analytics/${encodeURIComponent(repoOwner)}/${encodeURIComponent(repoName)}/actions/runs/${runId}`,
engineeringAnalyticsWorkflowRuns: (repoOwner: string, repoName: string, workflowName: string): string =>
`/engineering-analytics/${encodeURIComponent(repoOwner)}/${encodeURIComponent(repoName)}/actions/workflows/${encodeURIComponent(workflowName)}`,
+ engineeringAnalyticsAuthor: (handle: string): string =>
+ `/engineering-analytics/author/${encodeURIComponent(handle)}`,
},
fileSystemTypes: {},
treeItemsNew: [],
diff --git a/products/engineering_analytics/mcp/tools.yaml b/products/engineering_analytics/mcp/tools.yaml
index 322c14508b4a..21c9d47d7106 100644
--- a/products/engineering_analytics/mcp/tools.yaml
+++ b/products/engineering_analytics/mcp/tools.yaml
@@ -9,6 +9,9 @@ feature: engineering_analytics
url_prefix: /engineering-analytics
ui_apps: {}
tools:
+ engineering-analytics-author-workflow-costs:
+ operation: engineering_analytics_author_workflow_costs
+ enabled: false
engineering-analytics-ci-cards:
operation: engineering_analytics_ci_cards
enabled: false
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 682d267d96d9..f14e24d12556 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -62702,6 +62702,25 @@ export namespace Schemas {
offset?: number;
};
+ export type EngineeringAnalyticsAuthorWorkflowCostsParams = {
+ /**
+ * GitHub handle whose CI spend to break down.
+ */
+ author: string;
+ /**
+ * Window start: relative ('-30d', '-8w') or ISO8601. Defaults to -30d.
+ */
+ date_from?: string;
+ /**
+ * Window end: relative or ISO8601. Defaults to now.
+ */
+ date_to?: string;
+ /**
+ * Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.
+ */
+ source_id?: string;
+ };
+
export type EngineeringAnalyticsCiCardsParams = {
/**
* Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.