-
-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PoC for metadata-based invalidation #20914
Conversation
7c27fce
to
039e2dc
Compare
039e2dc
to
781a945
Compare
EDITED: Solved it. The issue was getting the return type on the intinsic's type stubs wrong. |
93f8b59
to
8c7a360
Compare
The intrinsic has been reworked and split out to #20996. This PR remains a proof of concept so I can still explore the best DX for metadata-based invalidation. |
8c7a360
to
c73d889
Compare
c73d889
to
7e00bf5
Compare
We've just branched for 2.22, so merging this pull request now will come out in 2.23, please move the release notes updates to |
) Add a new `path_metadata_request` intrinsic rule to allow rule code to request metadata about paths in the filesystem. The intended uses are to support: - Some form of metadata-based invalidation for `adhoc_tool` and `shell_command` targets, as explored in the proof of concept in #20914. (This PR in fact is split out from that other PR.) - Future potential work to avoid indefinite negative caching of PATH-style lookups (which is a problem of the existing BinaryPath lookups) by switching to direct monitoring of system-level paths. This API would likely be extended to that use case. (But I am not yet committing to any particular solution. Still, some form of metadata API will be useful.) Metadata is represented by the `PathMetadata` dataclass. `PathMetadataRequest` and `PathMetadataResult` are the input/output types, respectively, for the intrinsic. Note: `NodeKey::fs_path_to_watch` is introduced to allow `NodeKey::PathMetadata` to watch the parent directory even though `fs_subject` remains its configured path. This is necessary because the watch code will error with "file not found" if the path to be watched does not exist. The solution is to watch the parent directory and wait for creation / removal events related to the `fs_subject`.
Closing since this work was landed via other PRs. |
This PR is a proof of concept for invalidating
adhoc_tool
andshell_command
targets based on the metadata (and not just the content) of the files in the repository.The PR adds:
adhoc_tool
andshell_command
target types via a newinvalidation_globs
field.Naming and API design subject to change.