Commit Graph

2357 Commits

Author SHA1 Message Date
James Shubin
d2cda4ca78 etcd: Disable the dynamic chooser
We're not using dynamic etcd right now, so disable this code and prevent
the race detector complaining.
2025-09-09 00:04:21 -04:00
James Shubin
2f860be5fe engine: graph: Lock around frequent read races
These are all "safe" in terms of not ever conflicting, but the golang
memory model weirdness requires an actual lock to avoid race detector
errors.
2025-09-09 00:04:21 -04:00
James Shubin
5692837175 lang: Add a simple test of a non-tree dag 2025-09-09 00:04:21 -04:00
James Shubin
04ff2a8c5c lang: ast: Turn this speculation flag into a const
Makes it easier to find when debugging.
2025-09-09 00:04:21 -04:00
James Shubin
166b463fa9 lang: funcs: structs: Update the graph shape docs 2025-09-09 00:04:21 -04:00
James Shubin
2e858ff447 test: Improve colon test comment
I use these patterns when early hacking, and it's good to have a test to
catch them all before I merge.
2025-09-09 00:04:21 -04:00
James Shubin
6fac46da7c misc: Improved stack filtering
Although this needs more debugging, I'm not sure how the format changed.
I guess this is part of the "API" that golang is allowed to break ;)
2025-09-09 00:04:21 -04:00
James Shubin
2b820da311 lang: ast: structs, funcs: structs: Exprif without a channel
This adds an improved "expr if" which only adds the active branch to the
graph and removes the "secret" channel.
2025-08-04 17:45:06 -04:00
James Shubin
86c6ee8dee lang: ast, funcs: Remove the secret channel from call
This removes the secret channel from the call function. Having it made
it more complicated to write new function engines, and it's not clear
why it was even needed in the first place. It seems that even the
current generation of function engines work just fine without it.

Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
2025-08-04 17:04:01 -04:00
James Shubin
0a76910902 lang: core: Skip broken test
I expect this will be deprecated soon, let's see.
2025-08-04 17:04:01 -04:00
James Shubin
138ff8a895 lang: funcs: structs: Fix typos 2025-07-17 01:47:55 -04:00
James Shubin
8edb8e2a7b lang: interfaces: Add new helpers for dealing with args 2025-07-17 01:47:55 -04:00
James Shubin
bdf5209f68 util: errwrap: Add unwrapping for context removal
It's common in many concurrent engines to have a situation where we
collect errors on shutdown. Errors can either because a context closed,
or because some engine error happened. The latter, can also cause the
former, leading to a list of returned errors. In these scenarios, we
want to filter out all the secondary context errors, unless that's all
that's there. This provides a helper function to do so.
2025-07-16 23:48:37 -04:00
James Shubin
299b49bb17 util: errwrap: Add a function for joining
This is like the Append function but for a list.
2025-07-16 23:48:37 -04:00
James Shubin
71e4282d3f lang: interfaces: Add args to struct helper
We should consider if it's possible to avoid all of this transforming
entirely, but at least for now, do it all in one place by having an
available helper.
2025-07-13 03:18:23 -04:00
James Shubin
984aa0f5fc lang: Rename the vertex names
Make it a bit more obvious what the generated nodes are for.
2025-07-13 03:18:23 -04:00
James Shubin
737d1c9004 lang: interfaces: Table can be a standalone type
We'd like to have some useful helpers defined on it, like Copy.
2025-07-13 03:18:23 -04:00
James Shubin
d113fcb6d7 lang: ast, interfaces, interpret: Table should be a well-known type
We use this in enough places, that it's nice to have it as a well-known
alias.
2025-07-13 03:18:23 -04:00
James Shubin
73e641120f pgraph: Improve time complexity of IncomingGraphVertices
This goes from O(n^2) to O(n) when map lookup is O(1). I never really
focused on much optimizing, but I noticed this one in passing.
2025-07-13 03:18:22 -04:00
James Shubin
f7e446ef6f lang: core: example: nested: We don't use the func suffix anymore
There are only functions, no need to add suffixes to file names.
2025-07-13 03:18:22 -04:00
James Shubin
21917864db lang: core, funcs: Remove facts API
This started because it was possible, not because it was very useful.
The overhead of using the full function API, is lessened by the function
API helpers, and the upcoming improvements in the function API.

It's much easier to have one fewer API's to manage and so on.

It's also a stark reminder of how weak tools like "puppet" are which
only really have data collection systems that don't take arguments.
2025-07-13 03:15:53 -04:00
James Shubin
c49d469dcd engine: resources: Work around trailing slash issue in home dir
If the user is logged in, and we try to change from /home/james to
/home/james/ we'll get the error:

usermod: user james is currently used by process ????

and furthermore, it makes no sense to try and make this change since the
usermod function won't do anything if you run:

usermod --gid james --groups wheel --home /home/james/ james

when /etc/passwd has /home/james as the string.
2025-06-25 06:05:28 -04:00
James Shubin
0a79daf277 pgraph: Print cycles on error
I'm a terrible algorithmist, so who knows if this is correct, but it
seems to work in my cursory testing.
2025-06-25 06:05:28 -04:00
James Shubin
a4ed647d02 modules: purpleidea: Add more packages 2025-06-25 06:05:28 -04:00
James Shubin
79c199975d modules: purpleidea: Add another useful helper package 2025-06-25 06:05:11 -04:00
James Shubin
50b4a2a4f7 lang: ast: Make error message clearer 2025-06-25 04:50:47 -04:00
James Shubin
f778008929 modules: misc: Key generation should support other types
I think these short keys are sketchy, but what do I know.
2025-06-25 04:50:47 -04:00
James Shubin
54380a2a1f modules: cups: Add more edges
Useful for performance reasons until we make autoedges blazing fast.
2025-06-25 04:50:47 -04:00
James Shubin
a5fc1256e2 lang: core: embedded: provisioner: Encrypt the filesystem
The provisioner should be able to encrypt things. We should use an empty
passphrase so that the choosing of the actual passphrase can be done at
first boot.
2025-06-23 19:53:52 -04:00
James Shubin
0b2236962c lang: core: embedded: provisioner: Separate home is rare
Maybe one day we want this off to prevent storage issues, but not today.
2025-06-12 18:17:33 -04:00
James Shubin
ee7ad7cbbe lang: core: embedded: provisioner: Skip ignore if no drives available
Small bug for certain setups.
2025-06-12 18:11:14 -04:00
James Shubin
7ba4c4960b modules: meta: Wrong interface for the loc network
Copy pasta bug!
2025-06-08 21:27:04 -04:00
James Shubin
777ea6115b lang: core: embedded: provisioner: Support exec handoff
Could be used for any tool, but mgmt is an obvious possibility.

I should check this code more, but it's roughly right and I'm sure it
will get refactored more when I build opt-in provisioning and so on.
2025-06-08 21:16:54 -04:00
James Shubin
582cea31b0 modules: Get rid of unnecessary printing 2025-06-08 04:33:35 -04:00
James Shubin
c107240098 modules: shorewall: Add manual edges for performance
If you don't want to use auto-edges, then this still works.
2025-06-08 04:30:39 -04:00
James Shubin
6265a330bf modules: misc: The COPR setup must be non-interactive 2025-06-08 04:21:58 -04:00
James Shubin
cfcb35456f modules: misc: Use a template for network
Just a bug, now fixed.
2025-06-08 04:21:27 -04:00
James Shubin
1ef7c370e7 etcd, engine: Fix typos 2025-06-08 03:36:11 -04:00
James Shubin
f22ec07ed3 lang: Improve logging of startup information
Graph size and build time are both helpful.
2025-06-08 03:36:11 -04:00
James Shubin
f594799a7f etcd: ssh: Improve the authentication for ssh etcd world
This was rather tricky, but I think I've learned a lot more about how
SSH actually works. We now only offer up to the server what we can
actually support, which lets us actually get back a host key we have a
chance of actually authenticating against.

Needed a new version of the ssh code and had to mess with go mod
garbage.
2025-06-08 03:07:59 -04:00
James Shubin
1ccec72a7c cli, etcd, lib, setup: Support ssh hostkey logic
This makes it easy to pass in the expected key so that we never have to
guess and risk MITM attacks.
2025-06-07 17:55:41 -04:00
James Shubin
55eeb50fb4 lang: Refactor all the highlight helping together
Keep this cleaner and add a bit more.
2025-06-07 17:52:15 -04:00
James Shubin
2b7e9c3200 engine, integration, setup: Seeds should be called properly 2025-06-07 17:52:15 -04:00
James Shubin
25263fe9ea cli: Allow multiples of these args
We forgot the flag that lets the CLI parser actually let us use
multiples.
2025-06-06 23:53:42 -04:00
James Shubin
1df28c1d00 lang: ast, funcs: Start plumbing through the textarea
We need to get these everywhere and this is a start.
2025-06-06 03:11:06 -04:00
James Shubin
32e91dc7de lang: interpolate: Add temporary textarea info to interpolation
We should really be doing the math to find out how far along the string
each token really is, but that's complicated and tedious, especially
with the simplification passes, so let's skip that for now and just show
the whole thing.
2025-06-06 03:11:06 -04:00
James Shubin
c2c6cb5b6a lang: interfaces: Subtle fixes in textarea
Turns out we need a lot more tests to make this work easier.
2025-06-06 03:11:06 -04:00
James Shubin
58461323b9 lang: parser: Try to add the end values in parser
Not sure if this is right, but it's a start.
2025-06-06 03:11:06 -04:00
James Shubin
cdc6743d83 lang: ast, interfaces, interpolate: Remove the legacy pos
This ports things to the new textarea. We need to plumb through things a
lot more, especially the string interpolation math to get the right
offsets everywhere, but that's coming.
2025-06-06 02:37:43 -04:00
James Shubin
86dfa5844a lang: ast: Add missing initialization calls
Not sure how we forgot these before.
2025-06-06 02:35:20 -04:00