breaking: Clean up deprecated functionality for v1#562
breaking: Clean up deprecated functionality for v1#562tstirrat15 wants to merge 1 commit intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #562 +/- ##
==========================================
+ Coverage 39.28% 41.92% +2.64%
==========================================
Files 37 37
Lines 5448 4718 -730
==========================================
- Hits 2140 1978 -162
+ Misses 3063 2482 -581
- Partials 245 258 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
54f4359 to
f54b029
Compare
| registerConsistencyFlags(checkCmd.Flags()) | ||
|
|
||
| permissionCmd.AddCommand(checkBulkCmd) | ||
| checkBulkCmd.Flags().String("revision", "", "optional revision at which to check") |
There was a problem hiding this comment.
this one wasn't marked as hidden, can we actually remove it?
i also see this
readCmd.Flags().String("revision", "", "optional revision at which to check")
_ = readCmd.Flags().MarkHidden("revision")There was a problem hiding this comment.
I would argue yes, as long as we document it
|
I wonder if we could take this PR as an opportunity to:
This would be in the name of consistency 😄 |
There was a problem hiding this comment.
I ran mage gen:docForPublish and inspected the docs at https://github.com/authzed/zed/blob/main/docs/zed.md. I saw this, can we update it?
Lines 97 to 101 in 57fdb03
f54b029 to
f3e2bb1
Compare
f3e2bb1 to
e5c14c4
Compare
|
|
||
| relCmd := commands.RegisterRelationshipCmd(rootCmd) | ||
|
|
||
| commands.RegisterWatchCmd(rootCmd) |
There was a problem hiding this comment.
This is one of the aliases that we removed.
| schemaCompileCmd := registerAdditionalSchemaCmds(schemaCmd) | ||
| registerPreviewCmd(rootCmd, schemaCompileCmd) |
There was a problem hiding this comment.
We no longer pass out the schemaCompileCmd as it's no longer needed as an arg to the preview command.
| schemaCmd := &cobra.Command{ | ||
| Use: "schema <subcommand>", | ||
| Short: "Manage schema for a permissions system", | ||
| Deprecated: "please use `zed schema compile`", | ||
| } |
There was a problem hiding this comment.
No longer any commands under this.
| schemaCmd.AddCommand(schemaCompileCmd) | ||
| schemaCompileCmd.Flags().String("out", "", "output filepath; omitting writes to stdout") | ||
|
|
||
| return schemaCompileCmd |
There was a problem hiding this comment.
See note about no longer passing things out of this command.
| // Deprecated (hidden) flag. | ||
| if revision := cobrautil.MustGetStringExpanded(cmd, "revision"); revision != "" { |
There was a problem hiding this comment.
This is now covered by the consistency option; we want to get rid of the old way of doing things.
| Short: "Check permissions in bulk exist for resource-permission-subject triplets", | ||
| Args: ValidationWrapper(cobra.MinimumNArgs(1)), | ||
| RunE: checkBulkCmdFunc, | ||
| Aliases: []string{"check-bulk", "bulk-check"}, |
There was a problem hiding this comment.
Adding aliases here.
| lookupCmd := &cobra.Command{ | ||
| Use: "lookup <type> <permission> <subject:id>", |
There was a problem hiding this comment.
No longer using a separate command for lookup. This is covered by lookup-resources.
|
|
||
| permissionCmd.AddCommand(expandCmd) | ||
| expandCmd.Flags().Bool("json", false, "output as JSON") | ||
| expandCmd.Flags().String("revision", "", "optional revision at which to check") |
| Args: ValidationWrapper(StdinOrExactArgs(3)), | ||
| ValidArgsFunction: GetArgs(ResourceID, Permission, SubjectTypeWithOptionalRelation), | ||
| RunE: writeRelationshipCmdFunc(v1.RelationshipUpdate_OPERATION_CREATE, os.Stdin), | ||
| Aliases: []string{"write"}, |
There was a problem hiding this comment.
Adding zed relationship write as an alias - this is what i always want to write.
Description
Part of getting a v1 of Zed out the door. We want to take the opportunity to get rid of some deprecated codepaths, which will keep complexity down in the long term.
Changes
zed preview schema compile- it's now justzed schema compilezed watch- it's now justzed relationship watchrevisionflag - use the other consistency flagszed permission lookup- it'szed permission lookup-resourcesestimated-countflag onbulk-delete- uselimitinsteadTesting
Review. See that tests still pass.