feat: directory support, map[string]yaml var type, migration#1685
Merged
DavSanchez merged 12 commits intomainfrom Oct 2, 2025
Merged
feat: directory support, map[string]yaml var type, migration#1685DavSanchez merged 12 commits intomainfrom
DavSanchez merged 12 commits intomainfrom
Conversation
6c430ae to
d2d9d49
Compare
fded70a to
ffc1b8f
Compare
5 tasks
ffc1b8f to
f251eb1
Compare
agent-control/src/sub_agent/on_host/command/filesystem_entries.rs
Outdated
Show resolved
Hide resolved
agent-control/src/agent_type/runtime_config/on_host/filesystem.rs
Outdated
Show resolved
Hide resolved
agent-control/src/agent_type/runtime_config/on_host/filesystem.rs
Outdated
Show resolved
Hide resolved
agent-control/src/agent_type/runtime_config/on_host/filesystem.rs
Outdated
Show resolved
Hide resolved
Contributor
gsanchezgavier
left a comment
There was a problem hiding this comment.
Awesome! I like how you resolve it !
agent-control/agent-type-registry/newrelic/com.newrelic.infrastructure-0.1.0.yaml
Show resolved
Hide resolved
agent-control/agent-type-registry/newrelic/com.newrelic.infrastructure-0.1.0.yaml
Outdated
Show resolved
Hide resolved
agent-control/src/agent_type/runtime_config/on_host/filesystem.rs
Outdated
Show resolved
Hide resolved
agent-control/src/agent_type/runtime_config/on_host/filesystem.rs
Outdated
Show resolved
Hide resolved
* fix: use `relative_path` for file entry info * docs: type * feat: extend filesystem to fully support directories * feat: a specific dir for each filesystem entity (files, dirs) * test: templating * test: move test-only impls to test module * test: templating * test: proper yaml rendering * docs: detail how this module works * feat: SafePath -> PathBuf * feat(rendering): generate writable file list * feat: rendering filesystem entry list * style: rename path field * test: rendering expected file entries * test(integration): fix filesystem ops
54861bc to
3ad1536
Compare
3ad1536 to
8383858
Compare
The function `FileSystem::rendered` was public before, which could cause access to the internal `HashMap<PathBuf, String>`. If bound as mutable, it could be modified to write to unintended locations. Now the creation of `RenderedFileSystemEntries` is safer and doesn't provide visibility to the paths, only to write.
e5b3861 to
e2792a5
Compare
| path.components().try_for_each(|comp| match comp { | ||
| Component::Normal(_) | Component::CurDir => Ok(()), | ||
| // Disallow other non-supported variants like roots or prefixes | ||
| Component::ParentDir | Component::RootDir | Component::Prefix(_) => Err(format!( |
Contributor
There was a problem hiding this comment.
cool is this also checking for ~ for instance?
Contributor
Author
There was a problem hiding this comment.
Not exactly. Since ~ is a shell expansion if it's passed via the shell the character would be translated into the $HOME dir before reaching this. If somehow the literal character ~ reaches this point then a file or directory with that name will be created (from a SafePath("~")). It's not an error.
danielorihuela
previously approved these changes
Sep 26, 2025
1e8eb6a
gsanchezgavier
approved these changes
Oct 1, 2025
Contributor
|
@DavSanchez What about updating docs? In this PR or another? |
Contributor
Author
Another, after I get rid of the deprecated variable types ( |
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.
What this PR does / why we need it
This PR enhances the recently added support for filesystem operations for on-host by:
map[string]yaml(d8374ee).filesystemdefinition on the agent type mimicking a directory structure with its own ways of templating and finally emitting a list of files with their contents, to be created when spawning a sub-agent, seefilesystem.rsmodule documentation for details! (d2d9d49)Which issue this PR fixes
Special notes for your reviewer
Sadly I still need to perform changes to the migration program and the changes are not straightforward. I'll follow the same principle as in #1640, probably continuing from there as well and merging it here as a single commit so you can review easily.
Also, commit a689506 adds trace logs with the paths to the files AC will create. If you see any risk on this (security, style, etc) let me know and I can just remove it.
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
docsis aligned with the change. PENDING, BUT YOU CAN START REVIEWING!CONTRIBUTING.md.log level guidelines.