Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Build tracing filtering: path-based inclusion & content-based exclusion

Aperta
#21,572 4 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
java, kotlin

Direzione di ricerca

Inizia dal flusso database trace-command di CodeQL CLI e dall’opzione exclude esistente dell’estrattore, quindi traccia come gli input dei compilatori Java e Kotlin vengono passati all’estrazione. La richiesta ha due obiettivi distinti: inclusione basata sui percorsi ed esclusione basata sul contenuto. Il lavoro sarà considerato completato quando entrambi i comportamenti di filtro saranno definiti e implementati e saranno documentate la relativa configurazione da riga di comando e le semantiche di corrispondenza supportate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I'm using the CodeQL CLI with a large Java/Kotlin project that makes heavy use of autogenerated source during the build process. Because of this, I am using build tracing (codeql database trace-command) to extract CodeQL databases.

Is there any way to filter the files processed by the extractor in the following ways? If not, please consider this a feature request :)


Include-filtering by path

I'd like to be able to extract databases for certain components of the project. Due to the complexity of the project's build system, it's not easy to just build/trace only those components of the project; instead it would be much easier if I could just restrict extraction to those components' files by providing path globs during build tracing.

I'm aware that files can be excluded using the exclude extractor option, but this only allows certain path globs to be excluded, not included.

Exclude-filtering by file contents

As mentioned earlier, the project has a lot of autogenerated code, some (but only some) of which needs to be ignored. This code is often generated with paths that are not easily excludable using the existing path-glob-based exclusions. It would be great if I can specify regexes to search for in the content of files that indicate that the file should not be extracted (e.g. to look for things like "// Autogenerated file, do not edit", etc.)


If there isn't a way to do these, I'm happy to hear about hacky workarounds. For example, the commands I trace are already wrapped in shell scripts that wrap the underlying compilers (javac etc.) in order to provide for more filtering criteria than mentioned here. However, it's hard to do the above properly using such a wrapper because of i.e. the need to properly parse the original compiler command line arguments, handle things like files in JAR files, indirect command line options, etc. The extractor is much better placed to handle such filtering.

Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 16h
PR unite (30g)
143

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/codeql

Tutte le issue di github/codeql

Issue simili

Altre issue su Build System

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.