Skip to content

CDS extractor should respect paths-ignore from CodeQL config #326

@data-douser

Description

@data-douser

Problem

The CodeQL CDS extractor does not respect the paths-ignore configuration from the user's CodeQL config file (.github/codeql/codeql-config.yml). When a user configures paths-ignore to exclude certain directories or file patterns from analysis, the JavaScript extractor already honors this via LGTM_INDEX_FILTERS, but the CDS extractor independently discovers and compiles CDS files without consulting the config — resulting in ignored directories still being compiled and extracted.

Expected Behavior

When a paths-ignore list is present in the CodeQL configuration file, the CDS extractor should:

  1. Skip CDS projects whose directory matches a paths-ignore pattern
  2. Filter out individual CDS files that match a paths-ignore pattern before compilation
  3. Propagate the patterns to the JavaScript extractor (via LGTM_INDEX_FILTERS) so compiled .cds.json output files in ignored directories are also excluded from extraction

References

  • CodeQL paths-ignore documentation
  • The JavaScript extractor already supports this via the LGTM_INDEX_FILTERS environment variable, which the CodeQL CLI populates from the config file

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjavascriptPull requests that update javascript code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions