#Host resources by shykes · Pull Request ...

1 messages · Page 1 of 1 (latest)

lyric cloak
#

It's for function arguments that have the // +ignore pragma, so if you pass a directory through the CLI it filters it using those ignore patterns.

#

When the CLI tries to fetch the value from a flag for a function argument, it passes on the function argument's definition (introspection) in order to get those ignore patterns.

full bone
#

but does that mean the pre-call filtering (+ignore) only happens from the CLI? What about from SDKs?

#

in other words the engine doesn't enforce it?

lyric cloak
#

It happens in multiple places. I think from SDK it's been implemented as well (in the engine), but it brought an issue where directories from the CLI would be filtered twice, I don't remember if Tom worked around that, I'd have to check. The CLI has it too because it puts a Directory object in the argument for the query builder, which by then is agnostic to whether it was filtered or not.

full bone
#

So if I call a function manually, say with dagger query or dagger listen + curl, and I naively pass a directory as argument to a function. if that function has pre-call filtering specified, the filtering will not be applied? ie. the client is responsible for introspecting and enforcing pre-call filtering?

lyric cloak
#

It should get filtered in the engine, but you'll see a performance hit because I think the whole directory is going to be uploaded to the engine, but then filtered before getting saved as the argument value.

#

The CLI uses Host.directory, while the engine doesn't. It gets a normal Directory.

full bone
lyric cloak
#

The major filesync refactor came after, so I'm not sure if this could now be simplified or if the problem remains.

full bone
#

I see. Ok it's much clearer now, thanks

#

For my immediate task, I'll just add include / exclude arguments to HostResource.asDirectory, so that the CLI can pass them in

lyric cloak
#

Yep 👍

full bone
#

while I'm at it @lyric cloak , does this 👆 ring a bell? 😬

lyric cloak
#

No, not really 🙂