-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Features contribute lifecycle hooks (#390)
* refactor Feature interface * Feat: Add in inline command lifecycle hook contribution from Features * markerfile to exercise order of execution * add in two helper scripts with the same name in two different Features * test with ${featureRoot} * make Feature artifacts executable by all users * test for advanced lifehook scenario * add * typecheck * improve test * refactor variable names from 'postCreate' -> 'lifecycleHook' * refactor variable names from 'postCreate' -> 'lifecycleHook' * update test for running in parallel * update test * Display the 'origin' of the lifecycle command in the output log during 'up' Logs like 'Running the postCreateCommand from devcontainer.json' are updated to include the origin of the command e.g: 'Running the postCreateCommand from Feature 'common-utils'. This patch adds in a mapping object that is passed along and used to map a command to an origin. This change is a bit less efficient, with the added benefit of not needing to modify the existing merging logic. * Change copy path for Features on-container from /tmp-build-features to /opt/build-features This is to support resuming a container in Codespaces with Feature-contributed lifecycle hooks. Codespaces bind-mounts a different volume on top of /tmp, so the container's /tmp directory is not persisted. * run lifecycle commands in Feature install order * stop passing config object where unused * Rename LifecycleCommandOriginMap -> LifecycleHooksInstallMap * add test to assert installsAfter is respected * rm -rf test dir * assert contents in metadata label * unused test stub * exercise dev container test cmd * increase test timeouts * '' -> '' * pass contentSourceRootPath as a variable instead of string subst * remove dead code referencing "hasAcquires" * cannot change line 256 * persist final Features copy to /usr/share/devcontainer/features * update existing test * feature dir need not be writable by anyone but its owner * add test to assert resume will trigger lifecycle hooks * Test: "${featureRootFolder} substituted lifecycle hooks trigger on resume * missing semicolon * preserve featureRootFolder in metadata and replace right before usage * rename metadata entry to featureRootFolder for clarity and only emit in featureRaw * merged config has substituted featureRootFolder values * update tests to remove ${featureRootFolder} * remove ${featureRootFolder} variable substiution * move Features container build folder back to /tmp
- Loading branch information
1 parent
6ee5243
commit ebdb5ae
Showing
47 changed files
with
895 additions
and
183 deletions.
There are no files selected for viewing
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.