Skip to content

fix(extensions): restore UI extension targets on add + deploy (DEVX-541)#107

Open
smukherjee-godaddy wants to merge 1 commit into
godaddy:rust-portfrom
smukherjee-godaddy:DEVX-541-extension-targets
Open

fix(extensions): restore UI extension targets on add + deploy (DEVX-541)#107
smukherjee-godaddy wants to merge 1 commit into
godaddy:rust-portfrom
smukherjee-godaddy:DEVX-541-extension-targets

Conversation

@smukherjee-godaddy

Copy link
Copy Markdown
Contributor

Problem

UI extension targets were lost end to end:

  • application add extension embed/checkout had no --target flag and wrote targets: [] to godaddy.toml.
  • collect_extensions() dropped targets entirely.
  • deploy_extension() uploaded every extension with target = <extension name> instead of the configured target surface.

So embed/checkout artifacts were uploaded to the wrong target locations, and there was no way to specify where an extension should render.

Fix

Ports the TS target handling:

  • add extension embed / checkout — add a required --target (comma-separated, at least one). parse_targets() trims, splits, and drops empty entries; the parsed targets are written to godaddy.toml (previously hard-coded empty). blocks is unchanged (it takes no target).

  • collect_extensions() — carry each extension's targets via a small ExtensionDeploy struct instead of discarding them.

  • deploy_extension() — bundle once, then upload once per resolved target. resolve_upload_targets() maps:

    • blocks → the fixed "blocks" target,
    • embed/checkout → each configured target, or a single untargeted upload (None) when none are configured.

    The upload's target is now the configured value, not the extension name.

Impact

  • Extensions upload to their configured target surfaces.
  • Multi-target extensions upload once per target.
  • Closes the extension chain: add (--target)release maps targets (DEVX-540)deploy uploads per target.

Testing

  • Unit tests: parse_targets (trim/split/drop-empty) and resolve_upload_targets (blocks / no-target / multi-target).
  • cargo test / cargo clippy --all-targets -- -D warnings / cargo fmt --check — all clean.

Context

Track A ("ship an app"). Pairs with DEVX-540 (release input maps these targets) and DEVX-539 (deploy activation).

`application add extension embed/checkout` had no --target flag and wrote
targets: [], and deploy uploaded every extension to a target equal to the
extension *name* — so configured target surfaces were lost and artifacts landed
in the wrong place. Ports the TS target handling.

- add extension embed/checkout: add required --target (comma-separated, >=1);
  parse_targets() trims/splits/drops empties; write the parsed targets to
  godaddy.toml (was hard-coded empty).
- collect_extensions: carry each extension's targets (ExtensionDeploy struct)
  instead of dropping them.
- deploy_extension: bundle once, then upload once per resolved target —
  resolve_upload_targets() maps blocks -> "blocks", embed/checkout -> each
  configured target (or a single untargeted upload when none). The upload target
  is the configured value, not the extension name.
- tests: parse_targets + resolve_upload_targets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant