Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8325836
feat(evals): link Braintrust experiments to their CI run and the PR
mattrossman Oct 8, 2026
32830ac
feat(evals): find the PR for dispatched runs
mattrossman Oct 8, 2026
68c06b6
chore: refresh eval results
github-actions[bot] Oct 8, 2026
67eb010
Revert "chore: refresh eval results"
mattrossman Oct 8, 2026
59f3c94
feat(evals): show the PR number in the Braintrust job summary link
mattrossman Oct 8, 2026
75ec026
feat(evals): show the PR number above the Braintrust section of the j…
mattrossman Oct 8, 2026
0729f33
chore: refresh eval results
github-actions[bot] Oct 8, 2026
71d78fb
chore: refresh eval results
github-actions[bot] Oct 8, 2026
c5b9e98
Revert "chore: refresh eval results"
mattrossman Oct 8, 2026
478bb33
Revert "chore: refresh eval results"
mattrossman Oct 8, 2026
fd34cbb
feat(evals): label the PR link in the job summary
mattrossman Oct 8, 2026
43f5cfe
chore: refresh eval results
github-actions[bot] Oct 8, 2026
ccc9614
Revert "chore: refresh eval results"
mattrossman Oct 8, 2026
8772815
feat(evals): use a plain section label in the Braintrust job summary
mattrossman Oct 8, 2026
dcb5dbb
feat(evals): use a plain section label in the Braintrust job summary
mattrossman Oct 8, 2026
b9c9bc7
chore: refresh eval results
github-actions[bot] Oct 8, 2026
140bad2
chore: refresh eval results
github-actions[bot] Oct 8, 2026
b5f00a1
Revert "chore: refresh eval results"
mattrossman Oct 8, 2026
96f92ff
Revert "chore: refresh eval results"
mattrossman Oct 8, 2026
28b7683
chore(evals): format the job summary lines
mattrossman Oct 8, 2026
8e1fc6a
chore(evals): link the parenthesized view all text
mattrossman Oct 9, 2026
9c75553
chore: refresh eval results
github-actions[bot] Oct 9, 2026
7d7e01c
Revert "chore: refresh eval results"
mattrossman Oct 9, 2026
7a71bd8
chore: refresh eval results
github-actions[bot] Oct 9, 2026
1d28324
Revert "chore: refresh eval results"
mattrossman Oct 9, 2026
f97d59d
feat(evals): list every related PR in the job summary
mattrossman Oct 9, 2026
55f8b8c
chore: refresh eval results
github-actions[bot] Oct 9, 2026
3b267d6
Revert "chore: refresh eval results"
mattrossman Oct 9, 2026
85b9c81
chore: refresh eval results
github-actions[bot] Oct 9, 2026
fd3462a
Revert "chore: refresh eval results"
mattrossman Oct 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/eval-refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,17 @@ jobs:
fi
done

- name: Find the PRs for this branch
# Dispatched runs have a branch ref, not a PR ref, so look up the
# branch's open PRs for the job summary.
if: github.event_name == 'workflow_dispatch'
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
urls=$(gh pr list --head "$GITHUB_REF_NAME" --state open --json url,isCrossRepository --jq '.[] | select(.isCrossRepository == false) | .url' | paste -sd ' ' -)
echo "PR_URLS=$urls" >> "$GITHUB_ENV"

- name: Upload results to Braintrust
# A Braintrust outage shouldn't block publishing results.
continue-on-error: true
Expand Down
37 changes: 36 additions & 1 deletion apps/framework/scripts/upload-braintrust.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { describe, expect, it } from 'vitest';
import { afterEach, describe, expect, it, vi } from 'vitest';
import {
ciRunUrl,
experimentName,
judgeMetrics,
logTranscript,
relatedPrLines,
runViewUrl,
unwrapShell,
type SpanSink,
Expand Down Expand Up @@ -80,6 +82,39 @@ describe('utcStamp', () => {
});
});

describe('relatedPrLines', () => {
it('lists each PR, or says none', () => {
expect(
relatedPrLines([
'https://github.com/supabase/evals/pull/386',
'https://github.com/supabase/evals/pull/384',
])
).toEqual([
'**Related PRs:**',
'',
'- [#386](https://github.com/supabase/evals/pull/386)',
'- [#384](https://github.com/supabase/evals/pull/384)',
'',
]);
expect(relatedPrLines([])).toEqual(['**Related PRs:** (none)', '']);
});
});

describe('ciRunUrl', () => {
afterEach(() => vi.unstubAllEnvs());

it('links the GitHub Actions run, and is empty outside CI', () => {
vi.stubEnv('GITHUB_SERVER_URL', 'https://github.com');
vi.stubEnv('GITHUB_REPOSITORY', 'supabase/evals');
vi.stubEnv('GITHUB_RUN_ID', '123');
expect(ciRunUrl()).toEqual({
ci_run_url: 'https://github.com/supabase/evals/actions/runs/123',
});
vi.stubEnv('GITHUB_RUN_ID', '');
expect(ciRunUrl()).toEqual({});
});
});

describe('runViewUrl', () => {
it('filters the experiments list by run id', () => {
const url = runViewUrl(
Expand Down
32 changes: 29 additions & 3 deletions apps/framework/scripts/upload-braintrust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,26 @@ function prUrl(): Record<string, string> {
: {};
}

export function relatedPrLines(urls: string[]) {
return urls.length
? [
'**Related PRs:**',
'',
...urls.map((url) => `- [#${url.split('/').pop()}](${url})`),
'',
]
: ['**Related PRs:** (none)', ''];
}

export function ciRunUrl() {
const { GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID } = process.env;
return GITHUB_SERVER_URL && GITHUB_REPOSITORY && GITHUB_RUN_ID
? {
ci_run_url: `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`,
}
: {};
}

async function collectRows(
experimentMetadata: Map<string, ExperimentMetadata>
): Promise<Map<string, PendingRow[]>> {
Expand Down Expand Up @@ -731,6 +751,7 @@ async function main() {
// Duplicated from repo_info because grouping only reads metadata.
...(info?.branch ? { branch: info.branch } : {}),
...prUrl(),
...ciRunUrl(),
},
});

Expand Down Expand Up @@ -782,10 +803,15 @@ async function main() {
console.log(`🔗 All experiments in this run → ${runUrl}`);
// https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#adding-a-job-summary
if (process.env.GITHUB_STEP_SUMMARY) {
// PR events know their PR from the ref. Dispatched runs get theirs from
// the "Find the PRs for this branch" step.
const { pr_url } = prUrl();
const prUrls = pr_url
? [pr_url]
: (process.env.PR_URLS?.split(' ').filter(Boolean) ?? []);
const lines = [
'## Braintrust',
'',
`[All experiments in this run](${runUrl})`,
...relatedPrLines(prUrls),
`**Braintrust experiments:** [(view all)](${runUrl})`,
'',
...uploaded.map(({ name, url }) => `- [${name}](${url})`),
'',
Expand Down