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

Remove LookupResources v1 implementation #2099

Merged
merged 7 commits into from
Oct 28, 2024
Merged

Conversation

tstirrat15
Copy link
Contributor

Description

Now that v2 is on by default, this cleans up the old v1 implementation. It should also reduce our test times by getting rid of a branch of the consistency tests.

Changes

Will annotate.

Testing

See that everything goes green.

@tstirrat15 tstirrat15 requested a review from a team as a code owner October 23, 2024 19:12
@github-actions github-actions bot added area/CLI Affects the command line area/api v1 Affects the v1 API area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Oct 23, 2024
Copy link
Contributor Author

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

See comments

})
}
for _, chunkSize := range []uint16{5, 10} {
t.Run(fmt.Sprintf("chunk-size-%t", chunkSize), func(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is what should be reported here but I'm not 100% sure.

Comment on lines 401 to 410
if req.OptionalCursor != nil {
_, ok, err := cursor.GetCursorFlag(req.OptionalCursor, lrv2CursorFlag)
if err != nil {
return ps.rewriteError(resp.Context(), err)
}

if ok {
return ps.lookupResources2(req, resp)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I figured this was no longer necessary since the flag itself isn't really necessary anymore.

@@ -641,7 +641,6 @@ func TestLookupResources(t *testing.T) {
MaxPreconditionsCount: 1000,
StreamingAPITimeout: 30 * time.Second,
MaxRelationshipContextSize: 25000,
UseExperimentalLookupResources2: useV2,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a bunch of changes like this that are just propagating the option removal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran deadcode against the project and this file was called out as being entirely unused. I'm assuming that means it can be deleted.

@@ -393,158 +393,7 @@ func TranslateExpansionTree(node *core.RelationTupleTreeNode) *v1.PermissionRela
}
}

const lrv2CursorFlag = "lrv2"
Copy link
Member

Choose a reason for hiding this comment

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

keep the cursor flag; we might need it again in the future and we don't want to break existing cursors. we should just return an error if the cursor does not have it

Copy link
Member

Choose a reason for hiding this comment

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

I don't see this change reverted

@@ -158,7 +158,6 @@ func RegisterServeFlags(cmd *cobra.Command, config *server.Config) error {

experimentalFlags := nfs.FlagSet(BoldBlue("Experimental"))
// Flags for experimental features
experimentalFlags.BoolVar(&config.EnableExperimentalLookupResources, "enable-experimental-lookup-resources", true, "enables the experimental version of the lookup resources API")
Copy link
Member

Choose a reason for hiding this comment

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

don't remove, as it will break callers. Instead, deprecate it and if someone gives a value of false, issue a warning that the flag will be removed in the future

Copy link
Member

@josephschorr josephschorr left a comment

Choose a reason for hiding this comment

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

LGTM

@tstirrat15 tstirrat15 added this pull request to the merge queue Oct 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 28, 2024
@tstirrat15 tstirrat15 added this pull request to the merge queue Oct 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 28, 2024
@tstirrat15 tstirrat15 added this pull request to the merge queue Oct 28, 2024
Merged via the queue into main with commit 9692e58 Oct 28, 2024
22 checks passed
@tstirrat15 tstirrat15 deleted the remove-lookup-resources-v1 branch October 28, 2024 17:47
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/api v1 Affects the v1 API area/CLI Affects the command line area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants