Skip to content

Track paths-ignore gap for transitive CDS dependencies (index.cds -> model.cds.json) #390

Description

@data-douser

This issue is a follow-up to PR #389.

Problem statement

Verify/enforce expected behavior for paths-ignore in the CDS extractor when compiling from CAP entrypoints (for example index.cds) to model.cds.json.

Potential gap: even if paths-ignore correctly excludes certain .cds files from initial target selection, an included entrypoint may still reference those ignored files transitively. If the CDS compiler resolves those dependencies from disk without an extractor-level guard, ignored files could still influence model.cds.json.

Scope

This issue is intentionally limited to the index.cds -> model.cds.json flow and transitive dependency resolution behavior.

Expected behavior (to decide and enforce)

When index.cds references a .cds file matched by paths-ignore, we should have one clear, tested behavior:

  1. Strict exclusion mode (preferred candidate): compilation fails with a clear diagnostic indicating an ignored dependency was referenced; or
  2. Soft exclusion mode: compilation succeeds, but artifacts from ignored files are guaranteed not to appear in model.cds.json.

Whichever mode we choose, behavior must be deterministic and documented.

Acceptance criteria

  • Add/confirm integration tests where a non-ignored index.cds references ignored .cds files.
  • Validate extractor behavior for using from / include patterns relevant to CAP CDS dependencies.
  • Ensure resulting model.cds.json behavior matches the chosen policy (strict fail or guaranteed exclusion).
  • Ensure diagnostics are explicit (no misleading “project detection bug” messaging for intentional ignore configurations).
  • Document policy and rationale in extractor docs/comments near target/dependency selection logic.

Suggested test matrix (minimal)

  • index.cds (included) -> direct reference to ignored.cds (ignored by paths-ignore)
  • nested/transitive reference (index.cds -> a.cds -> ignored.cds)
  • path normalization variants (relative path forms that should still match ignore policy)

Context

PR #389 improved honoring paths-ignore during target selection and no-project diagnostics.
This issue tracks whether transitive dependency resolution can still bypass intended ignore semantics for the index.cds compilation flow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions