cleanup unused `allowBuildArtifacts` (#1010)

This commit is contained in:
Anas H. Sulaiman 2025-06-13 12:00:38 -04:00 committed by GitHub
parent c886f08525
commit 34e0d9c0b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 0 additions and 61 deletions

View File

@ -49,12 +49,10 @@ When you create a `.gemini/settings.json` file for project-specific settings, or
- **Description:** Controls git-aware file filtering behavior for @ commands and file discovery tools.
- **Properties:**
- **`respectGitIgnore`** (boolean, default: `true`): Whether to respect .gitignore patterns when discovering files. When enabled, git-ignored files (like `node_modules/`, `dist/`, `.env`) are automatically excluded from @ commands and file listing operations.
- **`allowBuildArtifacts`** (boolean, default: `false`): Whether to include build artifacts and generated files in file discovery operations.
- **Example:**
```json
"fileFiltering": {
"respectGitIgnore": true,
"allowBuildArtifacts": false
}
```

View File

@ -367,7 +367,6 @@ These are timestamped records of specific events.
- `code_assist_enabled` (boolean)
- `log_user_prompts_enabled` (boolean)
- `file_filtering_respect_git_ignore` (boolean)
- `file_filtering_allow_build_artifacts` (boolean)
- `debug_mode` (boolean)
- `mcp_servers` (string)

View File

@ -60,13 +60,11 @@ describe('Configuration Integration Tests', () => {
targetDir: tempDir,
debugMode: false,
fileFilteringRespectGitIgnore: undefined, // Should default to true
fileFilteringAllowBuildArtifacts: undefined, // Should default to false
};
const config = new Config(configParams);
expect(config.getFileFilteringRespectGitIgnore()).toBe(true);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(false);
});
it('should load custom file filtering settings from configuration', async () => {
@ -78,13 +76,11 @@ describe('Configuration Integration Tests', () => {
targetDir: tempDir,
debugMode: false,
fileFilteringRespectGitIgnore: false,
fileFilteringAllowBuildArtifacts: true,
};
const config = new Config(configParams);
expect(config.getFileFilteringRespectGitIgnore()).toBe(false);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(true);
});
it('should merge user and workspace file filtering settings', async () => {
@ -96,12 +92,10 @@ describe('Configuration Integration Tests', () => {
targetDir: tempDir,
debugMode: false,
fileFilteringRespectGitIgnore: true,
fileFilteringAllowBuildArtifacts: true,
};
const config = new Config(configParams);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(true);
expect(config.getFileFilteringRespectGitIgnore()).toBe(true);
});
});
@ -116,16 +110,12 @@ describe('Configuration Integration Tests', () => {
targetDir: tempDir,
debugMode: false,
fileFilteringRespectGitIgnore: false,
fileFilteringAllowBuildArtifacts: undefined, // Should default to false
};
const config = new Config(configParams);
// Specified settings should be applied
expect(config.getFileFilteringRespectGitIgnore()).toBe(false);
// Missing settings should use defaults
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(false);
});
it('should handle empty configuration objects gracefully', async () => {
@ -137,14 +127,12 @@ describe('Configuration Integration Tests', () => {
targetDir: tempDir,
debugMode: false,
fileFilteringRespectGitIgnore: undefined,
fileFilteringAllowBuildArtifacts: undefined,
};
const config = new Config(configParams);
// All settings should use defaults
expect(config.getFileFilteringRespectGitIgnore()).toBe(true);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(false);
});
it('should handle missing configuration sections gracefully', async () => {
@ -162,7 +150,6 @@ describe('Configuration Integration Tests', () => {
// All git-aware settings should use defaults
expect(config.getFileFilteringRespectGitIgnore()).toBe(true);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(false);
});
});
@ -176,30 +163,11 @@ describe('Configuration Integration Tests', () => {
targetDir: tempDir,
debugMode: false,
fileFilteringRespectGitIgnore: true,
fileFilteringAllowBuildArtifacts: false,
};
const config = new Config(configParams);
expect(config.getFileFilteringRespectGitIgnore()).toBe(true);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(false);
});
it('should handle a development-focused configuration', async () => {
const configParams: ConfigParameters = {
cwd: '/tmp',
contentGeneratorConfig: TEST_CONTENT_GENERATOR_CONFIG,
embeddingModel: 'test-embedding-model',
sandbox: false,
targetDir: tempDir,
debugMode: false,
fileFilteringRespectGitIgnore: true,
fileFilteringAllowBuildArtifacts: true,
};
const config = new Config(configParams);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(true);
});
it('should handle a CI/CD environment configuration', async () => {
@ -211,13 +179,11 @@ describe('Configuration Integration Tests', () => {
targetDir: tempDir,
debugMode: false,
fileFilteringRespectGitIgnore: false, // CI might need to see all files
fileFilteringAllowBuildArtifacts: true,
};
const config = new Config(configParams);
expect(config.getFileFilteringRespectGitIgnore()).toBe(false);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(true);
});
});
});

View File

@ -195,8 +195,6 @@ export async function loadCliConfig(
: (settings.telemetry ?? false),
// Git-aware file filtering settings
fileFilteringRespectGitIgnore: settings.fileFiltering?.respectGitIgnore,
fileFilteringAllowBuildArtifacts:
settings.fileFiltering?.allowBuildArtifacts,
checkpoint: argv.checkpoint,
proxy:
process.env.HTTPS_PROXY ||

View File

@ -43,7 +43,6 @@ export interface Settings {
// Git-aware file filtering settings
fileFiltering?: {
respectGitIgnore?: boolean;
allowBuildArtifacts?: boolean;
};
// UI setting. Does not display the ANSI-controlled terminal title.

View File

@ -21,7 +21,6 @@ const mockConfig = {
isSandboxed: vi.fn(() => false),
getFileService: vi.fn(),
getFileFilteringRespectGitIgnore: vi.fn(() => true),
getFileFilteringAllowBuildArtifacts: vi.fn(() => false),
} as unknown as Config;
const mockReadManyFilesExecute = vi.fn();

View File

@ -47,7 +47,6 @@ describe('useCompletion git-aware filtering integration', () => {
mockConfig = {
getFileFilteringRespectGitIgnore: vi.fn(() => true),
getFileFilteringAllowBuildArtifacts: vi.fn(() => false),
getFileService: vi.fn().mockResolvedValue(mockFileDiscoveryService),
};

View File

@ -106,18 +106,15 @@ describe('Server Config (config.ts)', () => {
it('should set default file filtering settings when not provided', () => {
const config = new Config(baseParams);
expect(config.getFileFilteringRespectGitIgnore()).toBe(true);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(false);
});
it('should set custom file filtering settings when provided', () => {
const paramsWithFileFiltering: ConfigParameters = {
...baseParams,
fileFilteringRespectGitIgnore: false,
fileFilteringAllowBuildArtifacts: true,
};
const config = new Config(paramsWithFileFiltering);
expect(config.getFileFilteringRespectGitIgnore()).toBe(false);
expect(config.getFileFilteringAllowBuildArtifacts()).toBe(true);
});
it('Config constructor should set telemetry to true when provided as true', () => {

View File

@ -81,7 +81,6 @@ export interface ConfigParameters {
telemetryLogUserPromptsEnabled?: boolean;
telemetryOtlpEndpoint?: string;
fileFilteringRespectGitIgnore?: boolean;
fileFilteringAllowBuildArtifacts?: boolean;
checkpoint?: boolean;
proxy?: string;
cwd: string;
@ -114,7 +113,6 @@ export class Config {
private readonly geminiClient: GeminiClient;
private readonly geminiIgnorePatterns: string[] = [];
private readonly fileFilteringRespectGitIgnore: boolean;
private readonly fileFilteringAllowBuildArtifacts: boolean;
private fileDiscoveryService: FileDiscoveryService | null = null;
private gitService: GitService | undefined = undefined;
private readonly checkpoint: boolean;
@ -148,8 +146,6 @@ export class Config {
this.telemetryOtlpEndpoint = params.telemetryOtlpEndpoint ?? '';
this.fileFilteringRespectGitIgnore =
params.fileFilteringRespectGitIgnore ?? true;
this.fileFilteringAllowBuildArtifacts =
params.fileFilteringAllowBuildArtifacts ?? false;
this.checkpoint = params.checkpoint ?? false;
this.proxy = params.proxy;
this.cwd = params.cwd ?? process.cwd();
@ -296,10 +292,6 @@ export class Config {
return this.fileFilteringRespectGitIgnore;
}
getFileFilteringAllowBuildArtifacts(): boolean {
return this.fileFilteringAllowBuildArtifacts;
}
getCheckpointEnabled(): boolean {
return this.checkpoint;
}
@ -317,7 +309,6 @@ export class Config {
this.fileDiscoveryService = new FileDiscoveryService(this.targetDir);
await this.fileDiscoveryService.initialize({
respectGitIgnore: this.fileFilteringRespectGitIgnore,
includeBuildArtifacts: this.fileFilteringAllowBuildArtifacts,
});
}
return this.fileDiscoveryService;

View File

@ -62,7 +62,6 @@ describe('loggers', () => {
}),
getTelemetryLogUserPromptsEnabled: () => true,
getFileFilteringRespectGitIgnore: () => true,
getFileFilteringAllowBuildArtifacts: () => false,
getDebugMode: () => true,
getMcpServers: () => ({
'test-server': {
@ -90,7 +89,6 @@ describe('loggers', () => {
code_assist_enabled: false,
log_user_prompts_enabled: true,
file_filtering_respect_git_ignore: true,
file_filtering_allow_build_artifacts: false,
debug_mode: true,
mcp_servers: 'test-server',
},

View File

@ -89,8 +89,6 @@ export function logCliConfiguration(config: Config): void {
log_user_prompts_enabled: config.getTelemetryLogUserPromptsEnabled(),
file_filtering_respect_git_ignore:
config.getFileFilteringRespectGitIgnore(),
file_filtering_allow_build_artifacts:
config.getFileFilteringAllowBuildArtifacts(),
debug_mode: config.getDebugMode(),
mcp_servers: mcpServers ? Object.keys(mcpServers).join(',') : '',
};

View File

@ -67,7 +67,6 @@ export interface CliConfigEvent {
vertex_ai_enabled: boolean;
log_user_prompts_enabled: boolean;
file_filtering_respect_git_ignore: boolean;
file_filtering_allow_build_artifacts: boolean;
}
export type TelemetryEvent =

View File

@ -26,7 +26,6 @@ describe('GlobTool', () => {
return service;
},
getFileFilteringRespectGitIgnore: () => true,
getFileFilteringAllowBuildArtifacts: () => false,
} as Partial<Config> as Config;
beforeEach(async () => {

View File

@ -29,7 +29,6 @@ describe('ReadManyFilesTool', () => {
return service;
},
getFileFilteringRespectGitIgnore: () => true,
getFileFilteringAllowBuildArtifacts: () => false,
getGeminiIgnorePatterns: () => ['**/foo.bar', 'foo.baz', 'foo.*'],
} as Partial<Config> as Config;