Skip to content

feat(render): Allow opt-out for file filtering#120

Merged
dmcilvaney merged 1 commit intomicrosoft:mainfrom
dmcilvaney:damcilva/add_file_filter_skip
Apr 24, 2026
Merged

feat(render): Allow opt-out for file filtering#120
dmcilvaney merged 1 commit intomicrosoft:mainfrom
dmcilvaney:damcilva/add_file_filter_skip

Conversation

@dmcilvaney
Copy link
Copy Markdown
Contributor

Add an escape hatch for rendering packages which have unparsable spec files (ie source entries use dynamic macros that can't be resolved by a basic spec parse).

Copilot AI review requested due to automatic review settings April 24, 2026 14:44
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 per-component “escape hatch” to skip post-render file filtering when spectool can’t correctly expand Source/Patch macro paths, preventing valid files from being incorrectly removed during azldev component render.

Changes:

  • Introduces [components.<name>.render] config with skip-file-filter to disable the post-render filtering step per component.
  • Wires the new config into the render pipeline to conditionally bypass removeUnreferencedFiles.
  • Updates component fingerprint exclusions and JSON schema to reflect the new config surface.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
schemas/azldev.schema.json Adds schema entries for the new component render section and skip-file-filter field.
internal/projectconfig/render.go Defines ComponentRenderConfig and the skip-file-filter field.
internal/projectconfig/fingerprint_test.go Registers ComponentConfig.Render as excluded from fingerprinting.
internal/projectconfig/component.go Adds Render ComponentRenderConfig to ComponentConfig and preserves it in WithAbsolutePaths.
internal/app/azldev/cmds/component/render.go Skips post-render file filtering when Render.SkipFileFilter is set.

Comment thread internal/projectconfig/component.go
Comment thread internal/app/azldev/cmds/component/render.go Outdated
Copilot AI review requested due to automatic review settings April 24, 2026 15:14
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 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread internal/app/azldev/cmds/component/render.go Outdated
Comment thread internal/projectconfig/render.go
Auto-detect unexpanded RPM macros in spectool output during rendering.
When spectool cannot resolve macros in Source/Patch tags, the reported
filenames contain literal %{...} sequences that don't match real files
on disk, causing the post-render file filter to incorrectly delete them.

The renderer now checks for unexpanded macros and automatically skips
file filtering when found. A manual escape hatch is also available:

  [components.<name>.render]
  skip-file-filter = true

- Add findUnexpandedMacro() to detect unresolved macros in spectool output
- Add ComponentRenderConfig with SkipFileFilter field
- Wire auto-detection and manual config into finishComponentRender
- Add ComponentRenderConfig to fingerprinted structs (affects build output)
- Document render config in components.md and update JSON schema
@dmcilvaney dmcilvaney force-pushed the damcilva/add_file_filter_skip branch from 7058cdc to a6714d2 Compare April 24, 2026 17:33
@dmcilvaney dmcilvaney requested a review from reubeno April 24, 2026 17:39
@dmcilvaney dmcilvaney merged commit 2d09c54 into microsoft:main Apr 24, 2026
15 checks passed
@dmcilvaney dmcilvaney deleted the damcilva/add_file_filter_skip branch April 24, 2026 18:02
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.

3 participants