This repository was archived by the owner on May 18, 2026. It is now read-only.
Replies: 2 comments 4 replies
-
|
🤔 Hmmm... On the structures themselves, particularly Is it worth spiking this out on a branch to get a feel for it? Maybe for file.link and directory.copy? |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Leaving this rough mind dump here, needs structure and thought on more: use serde::{Deserialize, Serialize};
//
// Actions aren't really too smart. They're primarily compositions of base actions,
// lets think of them as Atoms. Creating a file, changing the attributions, permissions,
// Making an HTTP call, running a command, script, etc ... POSIX?
//
// So instead of allowing each of the contributors that brings a new Action to manually
// handle all these common Atoms, we should provide the bedrock / substrate.
//
// Should we rename Actions to Molecules?
//
// The current changeset proposal would be one or more Atoms.
// Actions would emit Atoms that can be played or reverted.
// This will also make testing easier, as we can verify that the Actions emit
// the correct set of atoms.
//
pub trait Atom {
fn apply(); // Apply new to old
fn revert(); // Revert new to old
fn diff(); // Print a string that describes what it will do. Show old and new values
}
pub struct FileAtom {
filename: String,
}
pub struct FileCreate {
file: FileAtom,
}
pub struct FileSetContents {
file: FileAtom,
contents: String,
}
pub struct FileAppendContents {
file: FileAtom,
contents: String,
}
pub struct FileOwner {
file: FileAtom,
owner: String,
}
pub struct FileGroup {
file: FileAtom,
group: String,
}
pub struct FilePermissions {
file: FileAtom,
chmod: u32,
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Comtrya is a pretty simple task-runner right now. It uses the
queryfunction to determine if an action actually needs to run, though it's usage is sparse atm.We'd like to provide a better
--dry-runthat didn't just show what manifests will run, but which manifests need to run to get the system into the desired state.This discussion is around an enhancement proposal for actions to support ChangeSets.
I'm proposing that we modify the Action trait to force all Actions to implement the following:
In-order to minimise the changes to the codebase upfront, we'll provide a default implementation that says that changes are required.
Beta Was this translation helpful? Give feedback.
All reactions