Skip to content

feat(overlays): make source optional in file-add overlays#119

Open
Kelvinoppong wants to merge 1 commit intomicrosoft:mainfrom
Kelvinoppong:feat/optional-source-file-add
Open

feat(overlays): make source optional in file-add overlays#119
Kelvinoppong wants to merge 1 commit intomicrosoft:mainfrom
Kelvinoppong:feat/optional-source-file-add

Conversation

@Kelvinoppong
Copy link
Copy Markdown
Contributor

@Kelvinoppong Kelvinoppong commented Apr 24, 2026

Summary

  • Makes the source field optional for file-add overlays.
  • When source is omitted, it defaults to the value of file, covering the common case where destination and source filenames match.
  • Removes redundancy in overlay definitions and improves usability.

Closes #30

Changes

  • internal/projectconfig/overlay.go: apply the source-defaults-to-file logic in WithAbsolutePaths; relax Validate() so source is no longer required for file-add; update struct tag / JSON schema description.
  • internal/projectconfig/overlay_test.go: flip the "file-add missing source" case to expect success; add TestComponentOverlay_WithAbsolutePaths covering explicit source preserved, default-from-file, no-mutation-of-original, and non-file-add types untouched.
  • docs/user/reference/config/overlays.md: document the optional field and add a shorthand example.

Test plan

  • go test ./internal/projectconfig/... passes locally
  • go test ./internal/app/azldev/core/sources/... passes locally
  • Generated schema (schemas/azldev.schema.json) already reflects the new description (diff verified clean)
  • CI scenario / unit / check jobs pass

When the destination filename matches the source filename (the common
case), users no longer need to specify both `file` and `source`. For
`file-add` overlays, `source` now defaults to the value of `file` when
omitted.

Closes microsoft#30
@Kelvinoppong
Copy link
Copy Markdown
Contributor Author

@reubeno this PR is ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

overlays: file-add source field should be optional

1 participant