So coming from the thread in <#C01SPQQ2WK1|welcome...
# plugins
b
So coming from the thread in #welcome, here’s an example of something I struggled with when trying to write my first plugin: As part of my build process I’m going to need to create an ostree repository. That’s easy enough to do from the command line with
ostree init --repo=[repo path]
. Feels like this is a Target, so we look at how to make a Target and that’s all good, but then how do I get that Target to do anything? There’s not a lot of connective tissue described for that. Rules feel like they should act on Targets but don’t necessarily and so while I know how to describe the information required for a process, and the how to perform that process, the way that I get between those two isn’t clearly mapped out. There is information on Goals and how those are the entry point but it’s a bit buried and so it took me a bit of fumbling to work out that the reason I couldn’t work out how to actually get anything happening was because I hadn’t implemented a Goal yet. A worked example that started at a Goal, showed how that would discover Targets and then use the request/response mechanisms of Rules to achieve an outcome would be really helpful to be able to conceptualise the whole thing.
w
so: afaict, you most likely don’t want to create a `goal`: rather, you want your new logic to be used inside of some other
goal
, such as the
package
goal, or the
test
goal. it really depends what the … “goal” you are trying to accomplish is. if the point is to create a packaged artifact file in the filesystem, then you probably want to get hooked into
package
… if you’re trying to have the output consumed by Python code, you’d potentially want to do codegen to generate the public API to consume, etc