-
Notifications
You must be signed in to change notification settings - Fork 42
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
Update OpenAPI spec to include Permissions OpenAPI Refactor #567
Conversation
service/iam/api.go
Outdated
// access for various users on different objects and endpoints. | ||
// access for various users on different objects and endpoints: | ||
// | ||
// * **[Cluster permissions](clusters)** — Manage which users can manage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run make doc
. this may break the https://pkg.go.dev/github.com/databricks/databricks-sdk-go docs, as it points to non-existing links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell, it is not possible to link to a service in our current OpenAPI model. I filed a ticket with @arusanov to support this. For now, I'm going to revert the links in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, also in the openapi spec. this just breaks the logical flow of code comments.
@@ -11,6 +11,9 @@ type CreateCustomAppIntegration struct { | |||
Name string `json:"name"` | |||
// List of oauth redirect urls | |||
RedirectUrls []string `json:"redirect_urls"` | |||
// OAuth scopes granted to the application. Supported scopes: all-apis, sql, | |||
// offline_access, openid, profile, email. | |||
Scopes []string `json:"scopes,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems unrelated, if you're only doing permissions change :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may have other OpenAPI changes in it as well, I just wanted to update ASAP to detect any potential issues.
service/pkg.go
Outdated
@@ -82,7 +82,7 @@ | |||
// | |||
// - [oauth2.OAuthEnrollmentAPI]: These APIs enable administrators to enroll OAuth for their accounts, which is required for adding/using any OAuth published/custom application integration. | |||
// | |||
// - [iam.PermissionsAPI]: Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints. | |||
// - [iam.PermissionsAPI]: Permissions API are used to create read, write, edit, update and manage access for various users on different objects and endpoints: * **[Cluster permissions](clusters)** — Manage which users can manage, restart, or attach to clusters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may break go pkg docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workspace_client.go
Outdated
// access for various users on different objects and endpoints. | ||
// access for various users on different objects and endpoints: | ||
// | ||
// * **[Cluster permissions](clusters)** — Manage which users can manage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have to use different syntax for cross-service referencing or links. See Deep linking: methods, classes, and external links
from http://go/openapi/spec.
can you also add a linter to prevent these from being added in universe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will add a linter there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed a ticket with @arusanov to add linting
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #567 +/- ##
==========================================
- Coverage 18.73% 17.97% -0.77%
==========================================
Files 85 85
Lines 9405 9805 +400
==========================================
Hits 1762 1762
- Misses 7489 7889 +400
Partials 154 154
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does godoc support bold highlighting? I don't think so... but if we want to roll it out ASAP, then just fix the sha file
.codegen/_openapi_sha
Outdated
universe:/Users/miles/universe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks very unintentional ;) i'd prefer if we remove the ability to put rfs into this file.
PS: I just associate refish
with "a fish named RE". Can we change that? =P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we could call it ref
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref is better :)
Bold does not seem to be supported. I filed a ticket to track better doc generation for our SDKs on the backlog. |
43476ea
to
f72b016
Compare
## Changes This includes a change to how we expose the permissions-related APIs, for example (for the `JobsService`): * `GetJobPermissionLevels` -> `GetPermissionLevels` * `GetJobPermissions` -> `GetPermissions` * `SetJobPermissions` -> `SetPermissions` * `UpdateJobPermissions` -> `UpdatePermissions` These were added in #567 and first released as part of v0.15.0. ## Tests - [x] `make test` passing - [x] `make fmt` applied - [x] relevant integration tests applied
Changes
Update the Go SDK to include the updated structures for the permissions APIs.
Tests
make test
passingmake fmt
applied