refactor(coder/modules/agentapi): decouple boundary logic and improve script sourcing#851
Draft
refactor(coder/modules/agentapi): decouple boundary logic and improve script sourcing#851
Conversation
The coder_script resources write scripts to module_directory (default $HOME/.coder-modules/coder/agentapi) but never create the directory first, causing 'No such file or directory' in every test. Also fix stale chmod targets that still referenced /tmp/.
…tests - Remove PRE_INSTALL_SCRIPT, INSTALL_SCRIPT, START_SCRIPT, POST_INSTALL_SCRIPT from main.sh (variables removed from main.tf but still read under set -o nounset). - Remove pre-install, install, and post-install execution blocks from main.sh. Consumer modules are now responsible for placing the start script at the expected path. - Remove pre-post-install-scripts test (tests removed functionality). - Write test start script directly to container instead of passing via Terraform variable. - Pass ARG_LIB_SCRIPT_PATH in shutdown tests (required after lib sourcing was made configurable).
The module_directory default contains $HOME which needs shell expansion at runtime. Single quotes prevented expansion, causing 'No such file or directory' when sourcing the lib script.
Collaborator
Author
|
wip: do not review |
…directory rename
- Replace all stale $module_path references in main.sh with
${MODULE_DIRECTORY}.
- Update main.test.ts: moduleDirName → moduleDirectory, pass
module_directory instead of module_dir_name, fix shutdown test
to use ARG_MODULE_DIRECTORY.
- Remove start_script from agentapi.tftest.hcl (deleted variable).
- Rename module_path → module_directory in testdata/agentapi-start.sh.
…ename - Replace module_dir_name with module_directory in example snippet. - Remove deleted variables (pre_install_script, post_install_script, start_script, install_script) from example. - Update state persistence docs to reference module_directory.
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.
Description
Removes boundary logic and lifecycle hook variables from the
agentapimodule, and improves script sourcing to use configurable paths instead of hardcoded/tmp/locations.Boundary is a general network-isolation primitive not specific to agentapi. This PR strips out the embedded code as a prerequisite for extracting it into a standalone
coder/boundarymodule (#844). Lifecycle hooks (pre_install_script,install_script,post_install_script,start_script) are also removed — consumer modules are now responsible for placing their own start script at$module_path/scripts/agentapi-start.sh.Changes
Boundary removal:
enable_boundary,boundary_config_path,boundary_version,compile_boundary_from_source,use_boundary_directlyscripts/boundary.shcoder_env.boundary_configresourceREADME.mdLifecycle hook removal:
pre_install_script,install_script,post_install_script,start_scriptscripts/main.shpre-post-install-scriptstestScript sourcing improvements:
module_directoryvariable (default$HOME/.coder-modules/coder/agentapi)module_directoryinstead of/tmp/ARG_LIB_SCRIPT_PATHinstead of hardcoded/tmp/agentapi-lib.shType of Change
Module Information
Path:
registry/coder/modules/agentapiBreaking change: [x] Yes — removes boundary and lifecycle hook variables
Testing & Validation
bun test)bun fmt)Related Issues
Closes #852