Skip to content
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

Add update subpath #107

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Add update subpath #107

wants to merge 8 commits into from

Conversation

udnay
Copy link
Contributor

@udnay udnay commented Feb 24, 2025

Adding a subpath to object queries. This is similar to kuberentes' subpath construct for volume mounts where a subpath can be used to specify a particular directory within the volume to mount. The same idea applies here where a set subpath prefixes can be used to narrow down the query to rebuild or update just the objects in the selected subpath and not the whole project.

@udnay udnay requested review from airhorns and scott-rc February 24, 2025 02:23
@udnay udnay force-pushed the add-update-lens branch 4 times, most recently from e2e79fa to 833371b Compare February 24, 2025 13:19
Copy link
Collaborator

@scott-rc scott-rc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

subpathsPredicate := ""
if len(qb.objectQuery.Subpaths) > 0 {
subpathsPredicate = "AND o.path LIKE ALL(__subpaths__::text[])"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this option isn't mutually exclusive with ignores right -- you could use both at once? And we'll just let PG decide which conditions to use the index for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use both at once, ignoring a subset of the files under the subpaths. I initially wanted to use it like (haskell's lens)[https://github.com/ekmett/lens/wiki/Overview] functionality where the subpaths focus you on a specific set of the project and let you manipulate just that. With that in mind I thought keeping the ignores made sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants