Skip to content

feat(overlays): add archive overlay engine and config model#275

Merged
Tonisal-byte merged 4 commits into
mainfrom
asalinas/tarball-overlays-1
Jul 15, 2026
Merged

feat(overlays): add archive overlay engine and config model#275
Tonisal-byte merged 4 commits into
mainfrom
asalinas/tarball-overlays-1

Conversation

@Tonisal-byte

@Tonisal-byte Tonisal-byte commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

[Part 1 of 2] Adds the foundation for archive-scoped overlays.

This introduces the archive field on component overlays, allowing supported file overlays to target files inside source archives rather than loose files in the sources tree. It adds validation, fingerprint handling, schema updates, and archive utility support for safe extract/repack behavior, including compression sniffing and strict handling of unsupported tar entry types.

Example config:

[components.apache-commons-compress]
spec = "apache-commons-compress.spec"

[[components.apache-commons-compress.overlays]]
type = "file-remove"
archive = "commons-compress-1.27.1-src.tar.gz"
file = "src/test/resources/malware/**"
description = "Remove test fixtures flagged by the signing pipeline"

Follow-up PR #276

Copilot AI review requested due to automatic review settings July 10, 2026 20:49

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

This PR introduces the configuration surface and core utilities for archive-scoped overlays, extending component overlays so certain file overlays can target paths inside a source archive (extract → modify → repack), alongside schema/doc updates and supporting archive utilities.

Changes:

  • Adds archive to ComponentOverlay with validation and fingerprint handling for archive-scoped overlays.
  • Extends internal/utils/archive with compression sniffing, strict unsupported-entry handling, and related tests.
  • Adds an (currently internal) archive overlay processing implementation plus tests, and updates user/config documentation and schema snapshots.

Reviewed changes

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

Show a summary per file
File Description
schemas/azldev.schema.json Adds archive field to overlay schema and updates file description.
scenario/snapshots/TestSnapshotsContainer_config_generate-schema_stdout_1.snap Updates schema snapshot output to include archive.
scenario/snapshots/TestSnapshots_config_generate-schema_stdout_1.snap Updates schema snapshot output to include archive.
internal/utils/archive/archive.go Adds compression sniffing, ExtractAuto, extract options, and strict unsupported-entry behavior.
internal/utils/archive/archive_test.go Adds coverage for compression sniffing/mislabeled archives and strict unsupported-entry behavior.
internal/projectconfig/overlay.go Adds Archive field, archive validation helpers, and fingerprint inclusion behavior.
internal/projectconfig/overlay_test.go Adds validation and behavior tests for archive-scoped overlays.
internal/projectconfig/fingerprint_test.go Tightens validation of allowed fingerprint struct tag forms/options.
internal/fingerprint/fingerprint_test.go Adds a fingerprint regression test ensuring archive scoping changes the computed identity.
internal/app/azldev/core/sources/overlays.go Updates overlay application gating to “loose-file” overlays (excludes archive-scoped).
internal/app/azldev/core/sources/archiveoverlays.go Introduces archive extract/modify/repack engine with atomic repack behavior.
internal/app/azldev/core/sources/archiveoverlays_internal_test.go Adds internal tests covering archive overlay processing, batching semantics, and safety behaviors.
docs/user/reference/config/overlays.md Documents archive overlays and adds examples/field reference updates.

Comment thread internal/app/azldev/core/sources/overlays.go
Comment thread internal/projectconfig/overlay.go
Comment thread docs/user/reference/config/overlays.md Outdated
Comment thread docs/user/reference/config/overlays.md Outdated
Comment thread internal/app/azldev/core/sources/archiveoverlays.go
Comment thread internal/projectconfig/fingerprint_test.go Outdated
Comment thread internal/app/azldev/core/sources/archiveoverlays.go Outdated
Antonio Salinas added 2 commits July 14, 2026 17:12
Add the archive extract/apply/repack engine plus the ComponentOverlay 'archive' field, validation, and fingerprint handling. Extends internal/utils/archive with compression sniffing, ExtractAuto, and strict unsupported-entry handling. Pipeline wiring and hash tracking follow in a subsequent change.
Copilot AI review requested due to automatic review settings July 14, 2026 17:19
@Tonisal-byte
Tonisal-byte force-pushed the asalinas/tarball-overlays-1 branch from c8b6390 to 0a209cc Compare July 14, 2026 17:19

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

Comment thread internal/utils/archive/archive.go
Comment thread internal/app/azldev/core/sources/archiveoverlays.go Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 17:50

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

Comment thread docs/user/reference/config/overlays.md Outdated
Comment thread internal/app/azldev/core/sources/archiveoverlays_internal_test.go
Comment thread internal/projectconfig/overlay.go

@trungams trungams left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a high level question: what is the intended use case for file-search-replace? It looks to me like something that can be achieved via a patch file.

@Tonisal-byte

Copy link
Copy Markdown
Contributor Author

Just a high level question: what is the intended use case for file-search-replace? It looks to me like something that can be achieved via a patch file.

This can be achieved through a patch file yes, but the source itself must be modified because we cannot check in source code that is perceived to have malware/zipbomb type files. Both of which cause scanning to fail

@Tonisal-byte Tonisal-byte left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should resolve #281

Comment thread internal/projectconfig/fingerprint_test.go Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 18:51

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

Comment thread internal/projectconfig/overlay.go
@Tonisal-byte
Tonisal-byte merged commit 810669a into main Jul 15, 2026
20 checks passed
@trungams
trungams deleted the asalinas/tarball-overlays-1 branch July 16, 2026 00:14
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.

5 participants