A common pattern I have is that a coding agent changes a bunch of files - including, in some cases, ones under a custom resource processor. Maybe they've been loaded into IRIS, maybe not. Maybe they're static files and can't simply be imported and compiled (e.g., UI files in a web application or data / configuration as code).
I want a "sync" command that does an incremental load of changed files under all resource processors that support Sync. This is probably best represented as a new one-off lifecycle phase. To support this, we'd keep a table of file hashes - ignoring anything listed in patterns in files in the module root with names matching ..*ignore - that we can use as a comparison. When we sync, we'll look for changed file hashes, then call a Sync method that takes a list of filenames (relative to the module root) and calls it per resource processor.
"sync" accepts a package as an argument; if not provided, will sync all packages in development mode.
For safety, we'll skip deletions. (Could be convinced otherwise on this.)
If module.xml itself has changed, we'll load it first, attempt the sync, and note a big warning that module.xml has changed and a full reload may be necessary. (e.g., to pick up or other things.)
If files with resource processors that don't handle sync have changed, we'll warn on those too.
For classes/packages/etc. we'll want to compute/load/compile the full set across all resources, same as we do across classes/resources right now (but with a filtered list of things to compile). Or alternatively we could just load everything and tack on the "u" flag to skip up-to-date classes on compilation (which is the main speed bottleneck). There should be a method that resource processor classes can override to provide custom sync behavior, given an array of paths relative to the module root - I'm thinking particularly of ours for Tier 2 / element XML load here.
With this in place, an agent can be given instructions like:
- Make your changes to files on the filesystem
- Load them into IRIS with:
docker compose exec iris ipm sync
And the agent will see any errors (e.g., compilation or resource processor-specific) from that change.
We could also add an optional "-test" flag that runs unit tests added/modified in the sync.
This would also support the workflow of doing a sync/pull in source control then wanting that updated in a connected running environment without waiting for a full package load.
A common pattern I have is that a coding agent changes a bunch of files - including, in some cases, ones under a custom resource processor. Maybe they've been loaded into IRIS, maybe not. Maybe they're static files and can't simply be imported and compiled (e.g., UI files in a web application or data / configuration as code).
I want a "sync" command that does an incremental load of changed files under all resource processors that support Sync. This is probably best represented as a new one-off lifecycle phase. To support this, we'd keep a table of file hashes - ignoring anything listed in patterns in files in the module root with names matching ..*ignore - that we can use as a comparison. When we sync, we'll look for changed file hashes, then call a Sync method that takes a list of filenames (relative to the module root) and calls it per resource processor.
"sync" accepts a package as an argument; if not provided, will sync all packages in development mode.
For safety, we'll skip deletions. (Could be convinced otherwise on this.)
If module.xml itself has changed, we'll load it first, attempt the sync, and note a big warning that module.xml has changed and a full reload may be necessary. (e.g., to pick up or other things.)
If files with resource processors that don't handle sync have changed, we'll warn on those too.
For classes/packages/etc. we'll want to compute/load/compile the full set across all resources, same as we do across classes/resources right now (but with a filtered list of things to compile). Or alternatively we could just load everything and tack on the "u" flag to skip up-to-date classes on compilation (which is the main speed bottleneck). There should be a method that resource processor classes can override to provide custom sync behavior, given an array of paths relative to the module root - I'm thinking particularly of ours for Tier 2 / element XML load here.
With this in place, an agent can be given instructions like:
docker compose exec iris ipm syncAnd the agent will see any errors (e.g., compilation or resource processor-specific) from that change.
We could also add an optional "-test" flag that runs unit tests added/modified in the sync.
This would also support the workflow of doing a sync/pull in source control then wanting that updated in a connected running environment without waiting for a full package load.