chore(coder-utils): centralize script paths under agent-scoped utils directory#872
Closed
chore(coder-utils): centralize script paths under agent-scoped utils directory#872
Conversation
Add test coverage for the new utils_script_path that nests scripts
under ${module_directory}/${agent_name}-utils/:
- test_scripts_nested_under_utils_directory: verifies mkdir, base64
write, and execution paths all use the utils subdirectory.
- test_utils_directory_uses_agent_name: verifies the directory name
includes agent_name to avoid collisions between modules sharing
the same module_directory.
Also fix mkdir in pre_install and install wrappers to create the
utils directory instead of only the module_directory parent. Without
this, base64 -d would fail at runtime because the intermediate
directory would not exist.
🤖 Generated with [Coder Agents](https://coder.com)
Member
So IMO adding I have an alternative proposal that instead places the scripts and logs in
|
Collaborator
Author
|
Closed in favour of #871 |
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
Moves lifecycle scripts from
${module_directory}/into${module_directory}/${agent_name}-utils/so multiple modules sharing the same base directory no longer collide on script filenames.Type of Change
Module Information
Path:
registry/coder/modules/coder-utilsBreaking change: [x] Yes (script paths change for existing consumers)
What changed
main.tfutils_script_pathlocal:${var.module_directory}/${var.agent_name}-utils.pre_install_path,install_path,post_install_path,start_pathnow nest underutils_script_path.mkdir -pin pre_install and install wrappers updated to create the utils directory (previously only createdmodule_directory, which would leave the new intermediate directory missing at runtime).main.tftest.hcltest_scripts_nested_under_utils_directory: verifies mkdir, base64 write targets, and execution paths all reference the${agent_name}-utils/subdirectory for all four script types.test_utils_directory_uses_agent_name: verifies a customagent_nameproduces a distinct utils directory, preventing collisions.Testing & Validation
terraform test: 17 passed, 0 failed)bun test: 5 passed, 0 failed)Related Issues
Closes #873
🤖 Generated with Coder Agents