Skip to content

Commit b5c62c0

Browse files
refactor(git): remove public fixture fallback and require repo URL + token for all providers
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 37e5c89 commit b5c62c0

3 files changed

Lines changed: 12 additions & 19 deletions

File tree

benchmarks/git/git.bench.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
* HTTPS for git hosting providers by shelling out to `git`.
44
* Declarative — exports `config` + `task`; `bench run` owns the entrypoint.
55
*
6-
* The push/pull workflow runs only when BOTH the participant's token env var
7-
* AND the writable repo URL override are set. For the read-only public fixtures
8-
* (GitHub/GitLab/Bitbucket defaults), only the `clone` step is exercised.
6+
* Every participant requires both a writable `*_GIT_REPO_URL` env var and a
7+
* matching `*_TOKEN` env var; the runner skips providers without credentials.
98
*
109
* bench run benchmarks/git/git.bench.ts
1110
* bench run benchmarks/git/git.bench.ts --provider tensorlake --iterations 5
@@ -33,7 +32,7 @@ const COMMITTER_EMAIL = 'bench@example.com';
3332

3433
function resolveRepoConfig(config: GitProviderConfig): { repoUrl: string; writable: boolean } {
3534
const override = config.repoUrlEnvVar ? process.env[config.repoUrlEnvVar] : undefined;
36-
const repoUrl = override ? sanitizeRepoUrl(override) : sanitizeRepoUrl(config.url);
35+
const repoUrl = override ? sanitizeRepoUrl(override) : sanitizeRepoUrl(config.url ?? '');
3736
return { repoUrl, writable: !!override };
3837
}
3938

benchmarks/git/providers.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,35 @@ import type { GitProviderConfig } from './types.js';
33
/**
44
* Git hosting provider benchmark configurations.
55
*
6-
* Each participant points at an HTTPS repo. The `url` field provides a
7-
* read-only default (where a public fixture exists); set the matching
8-
* `*_GIT_REPO_URL` env var to a writable repo and the matching token env var
9-
* to enable the push/pull workflow. Tensorlake is gated by required env vars
10-
* because it has no public fixture.
6+
* Every participant requires both a writable `*_GIT_REPO_URL` env var and a
7+
* matching `*_TOKEN` env var. The runner skips providers whose credentials are
8+
* missing, so there is no read-only fallback.
119
*/
1210
export const providers: GitProviderConfig[] = [
1311
{
1412
name: 'github',
15-
requiredEnvVars: [],
16-
url: 'https://github.com/octocat/Spoon-Knife.git',
13+
requiredEnvVars: ['GITHUB_GIT_REPO_URL', 'GITHUB_TOKEN'],
1714
repoUrlEnvVar: 'GITHUB_GIT_REPO_URL',
1815
tokenEnvVar: 'GITHUB_TOKEN',
1916
tokenUsername: 'token',
2017
},
2118
{
2219
name: 'gitlab',
23-
requiredEnvVars: [],
24-
url: 'https://gitlab.com/gitlab-org/gitlab-test.git',
20+
requiredEnvVars: ['GITLAB_GIT_REPO_URL', 'GITLAB_TOKEN'],
2521
repoUrlEnvVar: 'GITLAB_GIT_REPO_URL',
2622
tokenEnvVar: 'GITLAB_TOKEN',
2723
tokenUsername: 'oauth2',
2824
},
2925
{
3026
name: 'bitbucket',
31-
requiredEnvVars: [],
32-
url: 'https://bitbucket.org/atlassian/hello-world.git',
27+
requiredEnvVars: ['BITBUCKET_GIT_REPO_URL', 'BITBUCKET_TOKEN'],
3328
repoUrlEnvVar: 'BITBUCKET_GIT_REPO_URL',
3429
tokenEnvVar: 'BITBUCKET_TOKEN',
3530
tokenUsername: 'x-token-auth',
3631
},
3732
{
3833
name: 'tensorlake',
3934
requiredEnvVars: ['TENSORLAKE_GIT_REPO_URL', 'TENSORLAKE_API_KEY'],
40-
url: process.env.TENSORLAKE_GIT_REPO_URL ?? '',
4135
repoUrlEnvVar: 'TENSORLAKE_GIT_REPO_URL',
4236
tokenEnvVar: 'TENSORLAKE_API_KEY',
4337
tokenUsername: 't',

benchmarks/git/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { BaseParticipant } from '@benchsdk/client';
22

33
export interface GitProviderConfig extends BaseParticipant {
4-
/** HTTPS URL of the repo to clone (used when no env override is set). */
5-
url: string;
6-
/** Optional env var that overrides `url` for the read/write repo. */
4+
/** Optional fallback HTTPS URL of the repo to clone. */
5+
url?: string;
6+
/** Env var that overrides `url` for the read/write repo. */
77
repoUrlEnvVar?: string;
88
/** Optional env var holding an HTTPS auth token for push/pull. */
99
tokenEnvVar?: string;

0 commit comments

Comments
 (0)