Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .agents/skills/no-greptile/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: no-greptile
description: Apply and verify Rudder's no-greptile pull-request label. Use when creating, updating, or reviewing a PR that the user explicitly wants to exclude from Greptile automated review.
---

# No Greptile

Use the `no-greptile` GitHub label to skip Greptile automated review for a specific pull request.
Apply it only when the user explicitly requests that review skip.

1. Resolve the pull request number from the current branch or user request.
2. Apply the label:

```bash
gh pr edit <pr-number> --add-label no-greptile
```

3. Verify that the label is present:

```bash
gh pr view <pr-number> --json labels
```

Do not remove the label or alter other review settings unless the user asks.
4 changes: 4 additions & 0 deletions .agents/skills/no-greptile/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "No Greptile"
short_description: "Skip Greptile review for a pull request"
default_prompt: "Use $no-greptile to skip Greptile review for this pull request."
8 changes: 2 additions & 6 deletions test/plugin-package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ test('keeps the release PostHog host explicit', () => {
join(pluginRoot, '.github', 'workflows', 'publish.yml'),
'utf8'
);
const telemetryBuildConfig = readFileSync(
join(pluginRoot, 'src', 'telemetry-build-config.ts'),
'utf8'
);
const telemetrySource = readFileSync(
join(pluginRoot, 'src', 'telemetry.ts'),
'utf8'
Expand All @@ -204,8 +200,8 @@ test('keeps the release PostHog host explicit', () => {
/const host = process\.env\.POSTHOG_HOST\?\.trim\(\) \|\| '';/
);
assert.match(
telemetryBuildConfig,
/export const BUILT_IN_POSTHOG_HOST = '';/,
publishWorkflow,
/BUILT_IN_POSTHOG_HOST = \$\{JSON\.stringify\(host\)\}/
);
assert.match(
telemetrySource,
Expand Down
83 changes: 50 additions & 33 deletions test/prompt-hook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,45 @@ let originalRudderHome: string | undefined;
const hookExecutable = fileURLToPath(new URL('../bin/rudder-prompt-hook.ts', import.meta.url));
const pluginRoot = fileURLToPath(new URL('../', import.meta.url));

function buildHookWithTelemetryConfig(
buildRoot: string,
projectToken: string,
host: string
): string {
const dist = join(buildRoot, 'dist');
cpSync(join(pluginRoot, 'bin'), join(buildRoot, 'bin'), {
recursive: true,
});
cpSync(join(pluginRoot, 'src'), join(buildRoot, 'src'), {
recursive: true,
});
symlinkSync(join(pluginRoot, 'node_modules'), join(buildRoot, 'node_modules'));
writeFileSync(
join(buildRoot, 'src', 'telemetry-build-config.ts'),
[
`export const BUILT_IN_POSTHOG_PROJECT_TOKEN = ${JSON.stringify(projectToken)};`,
`export const BUILT_IN_POSTHOG_HOST = ${JSON.stringify(host)};`,
'',
].join('\n')
);
execFileSync(
join(pluginRoot, 'node_modules', '.bin', 'esbuild'),
[
join(buildRoot, 'bin', 'rudder-prompt-hook.ts'),
'--bundle',
'--platform=node',
'--format=esm',
'--target=node23',
`--outfile=${join(dist, 'rudder-prompt-hook.mjs')}`,
],
{
cwd: buildRoot,
stdio: 'ignore',
}
);
return join(dist, 'rudder-prompt-hook.mjs');
}

function git(cwd: string, ...args: string[]): string {
return execFileSync('git', ['-C', cwd, ...args], { encoding: 'utf8' }).trim();
}
Expand Down Expand Up @@ -459,9 +498,14 @@ test('the legacy PostHog API key does not enable telemetry', async () => {
const receiver = await startTelemetryReceiver(capturePath);

try {
const legacyHookExecutable = buildHookWithTelemetryConfig(
join(root, 'legacy-build'),
'',
''
);
const stdout = execFileSync(
process.execPath,
[hookExecutable, '--source', 'codex'],
[legacyHookExecutable, '--source', 'codex'],
{
cwd: repo,
encoding: 'utf8',
Expand Down Expand Up @@ -496,40 +540,13 @@ test('a release build sends telemetry without user environment configuration', a
const capturePath = join(root, 'built-telemetry-capture.jsonl');
const receiver = await startTelemetryReceiver(capturePath);
const releaseRoot = join(root, 'release');
const dist = join(releaseRoot, 'dist');

try {
cpSync(join(pluginRoot, 'bin'), join(releaseRoot, 'bin'), {
recursive: true,
});
cpSync(join(pluginRoot, 'src'), join(releaseRoot, 'src'), {
recursive: true,
});
symlinkSync(join(pluginRoot, 'node_modules'), join(releaseRoot, 'node_modules'));
writeFileSync(
join(releaseRoot, 'src', 'telemetry-build-config.ts'),
[
"export const BUILT_IN_POSTHOG_PROJECT_TOKEN = 'built-test-project-token';",
`export const BUILT_IN_POSTHOG_HOST = ${JSON.stringify(receiver.host)};`,
'',
].join('\n')
);
execFileSync(
join(pluginRoot, 'node_modules', '.bin', 'esbuild'),
[
join(releaseRoot, 'bin', 'rudder-prompt-hook.ts'),
'--bundle',
'--platform=node',
'--format=esm',
'--target=node23',
`--outfile=${join(dist, 'rudder-prompt-hook.mjs')}`,
],
{
cwd: releaseRoot,
stdio: 'ignore',
}
const releaseHookExecutable = buildHookWithTelemetryConfig(
releaseRoot,
'built-test-project-token',
receiver.host
);

const environment: NodeJS.ProcessEnv = {
...process.env,
RUDDER_HOME: process.env.RUDDER_HOME,
Expand All @@ -542,7 +559,7 @@ test('a release build sends telemetry without user environment configuration', a

const stdout = execFileSync(
process.execPath,
[join(dist, 'rudder-prompt-hook.mjs'), '--source', 'codex'],
[releaseHookExecutable, '--source', 'codex'],
{
cwd: repo,
encoding: 'utf8',
Expand Down
Loading