Skip to content

fix(#4756): derive builder.resources.excludes for ABAP deploy at runtime#4828

Open
longieirl wants to merge 57 commits into
mainfrom
fix/4756-gap2-builder-resource-excludes-derive
Open

fix(#4756): derive builder.resources.excludes for ABAP deploy at runtime#4828
longieirl wants to merge 57 commits into
mainfrom
fix/4756-gap2-builder-resource-excludes-derive

Conversation

@longieirl

@longieirl longieirl commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #4756

Summary

Fixes a silent misalignment between build-time and deploy-time exclusions: builder.resources.excludes in ui5-deploy.yaml was correctly set but never read by the deploy task, which maintained its own hardcoded configuration.exclude list. As a result, folders like localService/ were excluded at build time but still
uploaded during ABAP deployment.

Changes:

  • @sap-ux/ui5-config: adds getBuilderResourceExcludes() to read builder.resources.excludes from a UI5Config instance
  • @sap-ux/ui5-config: addAbapDeployTask no longer hardcodes /test/ and /localService/ in configuration.exclude
  • @sap-ux/abap-deploy-config-writer: removes hardcoded configuration.exclude from getDeployConfig
  • @sap-ux/deploy-tooling: merges builder.resources.excludes from the project's UI5 config with any explicit configuration.exclude entries at runtime, so the deploy task stays in sync with build-time exclusions automatically

Test plan

  • pnpm --filter @sap-ux/ui5-config test
  • pnpm --filter @sap-ux/abap-deploy-config-writer test
  • pnpm --filter @sap-ux/deploy-tooling test
  • pnpm validate:changesets

longieirl and others added 30 commits June 3, 2026 14:00
…onfig

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…eployTask/addCloudFoundryDeployTask

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…i5.yaml via addBuilderResourceExcludes

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…angeset

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…f-contained

Call addBuilderResourceExcludes() inside the deploy task methods so callers
do not need to call it explicitly. Remove redundant explicit calls from
adp-tooling, cf-deploy-config-writer, and abap-deploy-config-writer
getDeployConfig. updateBaseConfig retains its call (only source of excludes
for base ui5.yaml). updateBaseConfig now skips fs.write when content
unchanged. Adds test for malformed excludes: null.
Combined HEAD's idempotent addBuilderResourceExcludes() with main's deployExclude
logic (#4757) that injects /test/ and /localService/ into the ABAP task exclude config.
Updated two abap-deploy-config-writer snapshots to include builder.resources.excludes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ources.excludes

addCloudFoundryDeployTask now calls addBuilderResourceExcludes() internally,
adding builder.resources.excludes to generated ui5.yaml snapshots.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…configuration.exclude from addAbapDeployTask
…tion.exclude at runtime

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
….yaml

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…nts; strengthen test assertions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ed ui5.yaml

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ration

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ill generated by deploy task

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…cludes added to generated ui5.yaml

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…er.resources.excludes added to generated ui5.yaml

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…excludes added to generated ui5.yaml

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…cal.yaml; strengthen test assertions; fix changeset prefix

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
longieirl and others added 2 commits June 12, 2026 10:09
…eDoS-prone regex, improve coverage, restore snapshot ordering

- Replace /\/?\*+$/ regex with safe string ops in addAbapDeployTask
- Add test covering exclude-branch in cli/createArchiveFromFolder (lines 65-66)
- Rebuild ui5-config and regenerate abap-deploy-config-writer snapshot so field order (exclude before lrep) matches main

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…xclude reach getArchive

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

@hyperspace-insights hyperspace-insights Bot 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.

The PR introduces a useful feature but has several correctness issues that need to be addressed before merging: the changeset summary will fail CI validation, the RegExp with the 'g' flag in the archive exclusion loop is both unnecessary and produces unreliable results, the glob-normalisation logic in addAbapDeployTask can silently mangle non-standard patterns like /assets/my*, and the CLI --exclude flag's interaction with YAML-configured excludes (override vs. additive) is ambiguous and potentially lossy.

PR Bot Information

Version: 1.23.0

  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet
  • Agent Instructions:
  • Correlation ID: dd567c6c-78b7-46b5-96ff-ba7017bee03a
  • Event Trigger: pull_request.ready_for_review

Comment thread packages/deploy-tooling/src/cli/archive.ts Outdated
Comment thread packages/ui5-config/src/ui5config.ts Outdated
Comment thread packages/deploy-tooling/src/cli/config.ts Outdated
Comment thread .changeset/gap2-builder-resource-excludes-derive.md Outdated
longieirl and others added 5 commits June 15, 2026 22:15
…e matching

- addAbapDeployTask no longer writes configuration.exclude; runtime derives from builder.resources.excludes in the deploy config
- mergeConfig merges all three sources: CLI --exclude, YAML configuration.exclude, and builder.resources.excludes (deduplicated)
- fix archive exclusion: startsWith with leading-slash strip replaces broken RegExp approach
- fix changeset prefix: fix: -> FIX:
- add fixtures and tests for new exclude flow

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace while-loop star-stripping with p.replace(/\/\*+$/, '/') to avoid
mangling patterns like /assets/my* into /assets/my/ (an incorrect dir prefix).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…uration.exclude

addAbapDeployTask no longer writes configuration.exclude by default;
update toStrictEqual assertions and snapshots in abap-deploy-config-sub-generator,
abap-deploy-config-writer, and deploy-config-sub-generator to reflect this.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@longieirl

Copy link
Copy Markdown
Contributor Author

the glob-normalisation logic in addAbapDeployTask can silently mangle non-standard patterns like /assets/my*, and the CLI --exclude flag's interaction with YAML-configured excludes (override vs. additive) is ambiguous and potentially lossy

These comments have beeb addressed.

@sonarqubecloud

Copy link
Copy Markdown

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(abap-deploy): ui5-deploy.yaml deploy task does not exclude localService from deployment

2 participants