Conversation
…ensions, stabilize component IDs (#932) Three fixes for deploying from clean GitHub tag clones: 1. Preserve remote_path on reattach: when attach-path updates an existing component's local_path, and the new path's homeboy.json omits remote_path, automatically store the current remote_path as a project override. This prevents clean clones from blanking the deploy target. 2. Inherit project extensions: when a component's homeboy.json (at the checked-out tag) doesn't declare extensions, inherit the project-level extensions map. This ensures build script resolution works even with older tags that predate the extensions field in homeboy.json. 3. Stabilize component ID on attach: when the inferred ID from a clone directory doesn't match an existing project component, check for version-stamped directory name patterns (e.g. 'data-machine-v0402-clean') and match against existing component IDs by prefix. Prevents identity mutation from clone paths.
Contributor
Homeboy Results —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #932 — three gaps in homeboy core that broke deploying from clean GitHub tag clones.
Changes
1. Preserve
remote_pathon re-attach (attachments.rs)When
attach_component_pathupdates an existing component'slocal_path, it now checks whether the new path'shomeboy.jsonwould blank theremote_path. If so, it auto-creates a project-levelcomponent_overridesentry to preserve the existing value.Root cause:
discover_from_portabledefaultsremote_pathto empty string when the repo'shomeboy.jsonomits it. Clean tag clones intentionally omitremote_path(it's deploy config, not source config), so re-attaching a clone path silently blanked the deploy target.2. Inherit project-level extensions (
resolution.rs)When a discovered component has no
extensionsfield (or it's empty),resolve_project_componentnow inherits the project'sextensionsmap.Root cause: Older tag releases may predate the
extensionsfield inhomeboy.json. Without extensions,resolve_build_commandcan't find a build-capable extension, and the build fails.3. Stabilize component ID on attach (
attachments.rs)When
attach_discovered_component_pathinfers a component ID that doesn't match any existing project component, it now checks for version-stamped directory patterns (e.g.,data-machine-v0402-clean) and matches against existing component IDs by prefix.Root cause:
infer_portable_component_idfalls back to the directory name whenhomeboy.jsonhas noidfield. Clone directories like/tmp/data-machine-v0.40.2-cleanget slugified todata-machine-v0402-clean, creating a phantom component instead of updating the existingdata-machine.Tests
find_prefix_matchcovering version suffixes, numeric suffixes, non-version suffixes, exact matches, longest-prefix preference, and empty project.cargo checkpasses clean (pre-existing warnings only).conventions.rs,wrapper_inference.rs,version_overrides.rspreventcargo testfrom compiling — unrelated to this PR.