Skip to content

fix: preserve custom source script paths across merged configs - #319

Open
Antonio Salinas (Tonisal-byte) wants to merge 2 commits into
microsoft:mainfrom
Tonisal-byte:asalinas/fix-custom-path-resolution
Open

fix: preserve custom source script paths across merged configs#319
Antonio Salinas (Tonisal-byte) wants to merge 2 commits into
microsoft:mainfrom
Tonisal-byte:asalinas/fix-custom-path-resolution

Conversation

@Tonisal-byte

@Tonisal-byte Antonio Salinas (Tonisal-byte) commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Resolve custom source scripts relative to the TOML file that declares them before component definitions are merged. Keep script names portable in chroot execution, fingerprints, history, and serialized config output, with regression coverage for components defined across multiple configuration files. Fixes #306

Copilot AI lite review requested due to automatic review settings August 21, 2026 22:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes custom source script paths across merged TOML configurations while keeping names portable for execution, fingerprints, history, and serialized output.

Changes:

  • Resolve scripts relative to their declaring configuration file.
  • Normalize paths for runtime and serialized consumers.
  • Add regression coverage and update documentation.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Summary Findings
internal/providers/sourceproviders/customsourceprovider.go Resolves and stages custom scripts. None
internal/providers/sourceproviders/customsourceprovider_internal_test.go Tests normalized script errors. None
internal/projectconfig/origin_json.go Serializes portable script names. None
internal/projectconfig/loader_test.go Tests merged configuration paths. None
internal/projectconfig/component.go Resolves and normalizes script paths. Moderate (4 votes): split-file component declarations can resolve scripts against the wrong directory. Nit (3 votes): update metadata and regenerate schema/snapshots.
internal/projectconfig/component_test.go Tests path normalization. None
internal/fingerprint/fingerprint.go Makes fingerprints checkout-independent. None
internal/fingerprint/fingerprint_test.go Tests fingerprint stability. None
internal/app/azldev/cmds/config/dump.go Produces portable configuration output. None
internal/app/azldev/cmds/config/dump_test.go Tests portable dumps. None
internal/app/azldev/cmds/component/history_internal_test.go Tests portable history values. None
internal/app/azldev/cmds/component/history_customizations.go Uses portable script names. None
docs/user/reference/config/components.md Documents script path semantics. Nit (2 votes): update the generated schema description and regenerate the schema.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/user/reference/config/components.md
Comment thread internal/projectconfig/component.go
Comment thread internal/projectconfig/component.go
Copilot AI review requested due to automatic review settings August 21, 2026 23:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

Suppressed comments (1)

internal/projectconfig/component.go:475

  • This rebasing loses the declaration directory when a component changes from local to upstream in a later merged config. The earlier WithAbsolutePaths call has already turned the script into (for example) /repo/specs/generate.sh; once Spec.SourceType becomes upstream this function stops rebasing, so the upstream provider still uses the local spec directory instead of the TOML file that declared the entry. Preserve per-entry provenance (or explicitly rebase on a local-to-upstream transition) so field-level component overrides do not break script lookup.
			origin.Script = filepath.Join(scriptDir, origin.EffectiveScriptName())

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.

[Bug]: Preserve origin.script resolution context across merged component definitions

2 participants