Skip to content

feat: include rendered spec location in component list output#85

Merged
reubeno merged 8 commits intomainfrom
copilot/add-spec-location-to-component-list
Apr 9, 2026
Merged

feat: include rendered spec location in component list output#85
reubeno merged 8 commits intomainfrom
copilot/add-spec-location-to-component-list

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

azldev component list now includes each component's rendered spec output directory (derived from rendered-specs-dir config). Empty when not configured.

  • internal/app/azldev/core/components/renderedspecdir.go — Reusable RenderedSpecDir(renderedSpecsDir, componentName) helper computing {rendered-specs-dir}/{component-name}. Future component render (PR feat(render): add azldev component render command #81) and subfolder-split work can use this single calculation point.
  • internal/projectconfig/component.go — Added RenderedSpecDir as a derived field on ComponentConfig (toml:"-" excludes it from serialization; table:"-" hides it from human-readable table output; JSON tag exposes it for programmatic use). Follows the same pattern as other derived fields like Name and SourceConfigFile.
  • internal/app/azldev/core/components/resolver.go — The resolver's createComponentFromConfig populates RenderedSpecDir at resolve time, making it available to all consumers of resolved components (not just the list command).
  • Tests — Helper unit tests + list command tests covering configured, unconfigured, and multi-component cases.

Example JSON output when rendered-specs-dir = "SPECS" is configured:

[{"name": "vim", "renderedSpecDir": "/project/SPECS/vim", ...}]

When rendered-specs-dir is not set, renderedSpecDir is omitted. The field is only included in JSON output (-O json), not in the default table view.

Copilot AI requested review from Copilot and removed request for Copilot April 8, 2026 21:17
Copilot AI requested review from Copilot and removed request for Copilot April 8, 2026 21:26
Copilot AI changed the title [WIP] Add rendered spec location to component list output feat: include rendered spec location in component list output Apr 8, 2026
Copilot AI requested a review from dmcilvaney April 8, 2026 21:29
Copilot AI requested review from Copilot and removed request for Copilot April 8, 2026 22:58
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 8, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dario.cat
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/vet cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet diff�� /home/REDACTED/work/azure-linux-dev-tools/azure-liGOINSECURE 0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/veGOMOD ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/too-trimpath cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • example.com
    • Triggering command: /tmp/go-build120458271/b648/sourceproviders.test /tmp/go-build120458271/b648/sourceproviders.test -test.testlogfile=/tmp/go-build120458271/b648/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build120458271/b526/vet.cfg iles/mageutil %cd ux-amd64/pkg/tool/linux_amd64/vet -- v-tools/azure-li-atomic ux-amd64/pkg/too-bool ux-amd64/pkg/too-buildtags ls/f�� k/azure-linux-de-errorsas ux-amd64/pkg/too-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet world/helloworld/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/too-test.timeout=10m0s ternal/app/azlde-atomic ux-amd64/pkg/too-bool ux-amd64/pkg/too-buildtags (dns block)
  • go.opentelemetry.io
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/vet cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet diff�� /home/REDACTED/work/azure-linux-dev-tools/azure-liGOINSECURE 0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/veGOMOD ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/too-trimpath cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • go.szostok.io
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/vet cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet diff�� /home/REDACTED/work/azure-linux-dev-tools/azure-liGOINSECURE 0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/veGOMOD ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/too-trimpath cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • go.uber.org
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/vet cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet diff�� /home/REDACTED/work/azure-linux-dev-tools/azure-liGOINSECURE 0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/veGOMOD ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/too-trimpath cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • go.yaml.in
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/vet cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet diff�� /home/REDACTED/work/azure-linux-dev-tools/azure-liGOINSECURE 0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/veGOMOD ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/too-trimpath cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • gopkg.in
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/vet cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet diff�� /home/REDACTED/work/azure-linux-dev-tools/azure-liGOINSECURE 0.1-go1.25.6.linux-amd64/pkg/tool/linux_amd64/veGOMOD ux-amd64/pkg/tool/linux_amd64/vet soft/azure-linux/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.6.linux-amd64/pkg/too-trimpath cfg ux-amd64/bin/go ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • invalid-domain.there.is.no.such.resource
    • Triggering command: /tmp/go-build120458271/b641/rpmprovider.test /tmp/go-build120458271/b641/rpmprovider.test -test.testlogfile=/tmp/go-build120458271/b641/testlog.txt -test.paniconexit0 -test.timeout=10m0s env nal/projectconfi-errorsas GO111MODULE ux-amd64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ux-amd64/pkg/too-buildtags diff�� k/azure-linux-de-errorsas GOPROXY ux-amd64/pkg/tool/linux_amd64/vet GOSUMDB GOWORK ux-amd64/pkg/too-unreachable=false ux-amd64/pkg/too/tmp/go-build120458271/b524/vet.cfg (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from dmcilvaney April 8, 2026 22:59
Copilot AI requested review from Copilot and removed request for Copilot April 8, 2026 23:10
Copilot AI requested a review from dmcilvaney April 8, 2026 23:11
@dmcilvaney dmcilvaney marked this pull request as ready for review April 9, 2026 00:56
Copilot AI review requested due to automatic review settings April 9, 2026 00:56
Copy link
Copy Markdown
Contributor

@dmcilvaney dmcilvaney left a comment

Choose a reason for hiding this comment

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

Approve pending scenario test results

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a derived renderedSpecDir field to resolved component configs so azldev component list -O json can include each component’s rendered spec output directory (based on the project’s rendered-specs-dir setting).

Changes:

  • Introduce components.RenderedSpecDir(renderedSpecsDir, componentName) helper to compute {rendered-specs-dir}/{component-name}.
  • Add RenderedSpecDir derived field to projectconfig.ComponentConfig and populate it during component resolution.
  • Update component list config extraction logic and extend tests for configured/unconfigured rendered-specs-dir behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/projectconfig/component.go Adds RenderedSpecDir derived field and preserves it through WithAbsolutePaths cloning.
internal/app/azldev/core/components/resolver.go Populates RenderedSpecDir at resolve time for all resolved components.
internal/app/azldev/core/components/renderedspecdir.go New helper that computes the per-component rendered spec output directory.
internal/app/azldev/core/components/renderedspecdir_test.go Unit tests for the helper behavior.
internal/app/azldev/cmds/component/list.go Removes lo.Map usage and returns resolved component configs via a loop.
internal/app/azldev/cmds/component/list_test.go Adds test coverage for rendered-specs-dir propagation into list output.

Copilot AI and others added 6 commits April 9, 2026 12:13
Add RenderedSpecDir field to component list results, computed from
the project's rendered-specs-dir config and component name. The path
calculation is extracted into a reusable RenderedSpecDir helper function
in the components package for use by future commands (e.g. component render).

Agent-Logs-Url: https://github.com/microsoft/azure-linux-dev-tools/sessions/10d51939-dcb0-47d4-bbb0-1ebe7341e052

Co-authored-by: dmcilvaney <23200982+dmcilvaney@users.noreply.github.com>
Move RenderedSpecDir from the ComponentListEntry wrapper into
ComponentConfig directly (with toml:"-" to exclude from serialization).
The field is now populated by the resolver's createComponentFromConfig,
making it available to all consumers of resolved components.

Agent-Logs-Url: https://github.com/microsoft/azure-linux-dev-tools/sessions/e7cc285b-04b7-4227-94f2-79231f4455b0

Co-authored-by: dmcilvaney <23200982+dmcilvaney@users.noreply.github.com>
@dmcilvaney dmcilvaney force-pushed the copilot/add-spec-location-to-component-list branch from 29edcf5 to 3bd1ac1 Compare April 9, 2026 20:29
@dmcilvaney dmcilvaney requested a review from Copilot April 9, 2026 20:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 10 out of 10 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings April 9, 2026 21:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 9 out of 9 changed files in this pull request and generated 1 comment.

Comment on lines +16 to +22
// Returns an error if componentName is unsafe (absolute, contains path separators
// or traversal sequences).
func RenderedSpecDir(renderedSpecsDir, componentName string) (string, error) {
if err := fileutils.ValidateFilename(componentName); err != nil {
return "", fmt.Errorf("invalid component name for rendered spec dir:\n%w", err)
}

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

RenderedSpecDir relies on fileutils.ValidateFilename(componentName), but ValidateFilename does not reject Windows volume-qualified names (e.g. "C:tmp"). On Windows, filepath.Join(renderedSpecsDir, "C:tmp") can discard the base directory and produce a path on another volume, undermining the safety guarantee this helper is meant to provide. Consider rejecting componentName values where filepath.VolumeName(componentName) != "" (ideally inside ValidateFilename so all callers benefit).

Suggested change
// Returns an error if componentName is unsafe (absolute, contains path separators
// or traversal sequences).
func RenderedSpecDir(renderedSpecsDir, componentName string) (string, error) {
if err := fileutils.ValidateFilename(componentName); err != nil {
return "", fmt.Errorf("invalid component name for rendered spec dir:\n%w", err)
}
// Returns an error if componentName is unsafe (absolute, contains path separators,
// traversal sequences, or a platform-specific volume name).
func RenderedSpecDir(renderedSpecsDir, componentName string) (string, error) {
if err := fileutils.ValidateFilename(componentName); err != nil {
return "", fmt.Errorf("invalid component name for rendered spec dir:\n%w", err)
}
if filepath.VolumeName(componentName) != "" {
return "", fmt.Errorf("invalid component name for rendered spec dir:\ncomponent name %#q must not include a volume name", componentName)
}

Copilot uses AI. Check for mistakes.
@reubeno reubeno merged commit ab603ff into main Apr 9, 2026
19 checks passed
@reubeno reubeno deleted the copilot/add-spec-location-to-component-list branch April 9, 2026 22:08
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.

[Copilot] Component list should include rendered spec location if configured

4 participants