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

Update OpenAPI spec to include Permissions OpenAPI Refactor #567

Merged
merged 2 commits into from
Aug 4, 2023

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Aug 1, 2023

Changes

Update the Go SDK to include the updated structures for the permissions APIs.

Tests

  • make test passing
  • make fmt applied
  • relevant integration tests applied

@nfx nfx self-requested a review August 2, 2023 15:41
examples/test.go Outdated Show resolved Hide resolved
// 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,
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2023-08-03 at 13 21 23
No links to break if there are no links :)
Any prior art w.r.t. links within the REST API docs?

Copy link
Contributor Author

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

Copy link
Contributor

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"`
Copy link
Contributor

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 :)

Copy link
Contributor Author

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.
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2023-08-03 at 13 23 36
Looks bad.

// 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,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2023-08-03 at 13 28 53
That style of link also does not seem to be handled appropriately?

Copy link
Contributor Author

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-commenter
Copy link

codecov-commenter commented Aug 3, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.77% ⚠️

Comparison is base (da7424a) 18.73% compared to head (a5645f2) 17.97%.
Report is 2 commits behind head on main.

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              
Files Changed Coverage Δ
service/compute/api.go 12.65% <0.00%> (-0.64%) ⬇️
service/compute/impl.go 10.74% <0.00%> (-3.11%) ⬇️
service/compute/model.go 0.00% <0.00%> (ø)
service/iam/api.go 0.00% <0.00%> (ø)
service/iam/impl.go 0.00% <0.00%> (ø)
service/iam/model.go 0.00% <0.00%> (ø)
service/jobs/api.go 0.00% <0.00%> (ø)
service/jobs/impl.go 0.00% <0.00%> (ø)
service/jobs/model.go 0.00% <0.00%> (ø)
service/ml/api.go 0.00% <0.00%> (ø)
... and 15 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@nfx nfx left a 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

universe:/Users/miles/universe
Copy link
Contributor

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

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 suppose we could call it ref?

Copy link
Contributor

Choose a reason for hiding this comment

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

ref is better :)

@mgyucht
Copy link
Contributor Author

mgyucht commented Aug 3, 2023

Bold does not seem to be supported. I filed a ticket to track better doc generation for our SDKs on the backlog.

@mgyucht mgyucht requested a review from nfx August 4, 2023 09:04
@mgyucht mgyucht enabled auto-merge (squash) August 4, 2023 09:04
@mgyucht mgyucht merged commit ffc82a1 into main Aug 4, 2023
3 checks passed
@nfx nfx deleted the update-openapi-permissions branch August 4, 2023 13:52
@pietern pietern mentioned this pull request Sep 4, 2023
3 tasks
github-merge-queue bot pushed a commit that referenced this pull request Sep 4, 2023
## 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
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