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

Added separate methods for required path and body parameters and added Must/CanUseJson methods #666

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

andrewnester
Copy link
Contributor

Changes

In attempt to simplify code generation logic (databricks/cli#905) added separate methods for required path and body parameters and added Must/CanUseJson methods.

Tests

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

Copy link
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple small suggestions

// JSON input to set all required fields for request.
// If we can do so, it means we can ignore all positional arguments
// passed for a certaing command and only use JSON input passed via --json flag.
func (m *Method) CanSetRequiredFieldsFromJson() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we leave this here so that we don't break compilation of the new tool with older versions of the SDK (e.g. someone checked out an older version of the SDK and is doing local testing)? We can deprecate this with a message saying not to use this method. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mgyucht this is only for code generation and an SDK exposed method and it is not anymore anywhere (removed usage of it in CLI with this PR databricks/cli#905) so it should be safe to be removed

openapi/code/entity.go Outdated Show resolved Hide resolved
@andrewnester andrewnester added this pull request to the merge queue Oct 23, 2023
@andrewnester andrewnester removed this pull request from the merge queue due to a manual request Oct 23, 2023
openapi/code/entity.go Show resolved Hide resolved
openapi/code/entity.go Outdated Show resolved Hide resolved
openapi/code/entity.go Show resolved Hide resolved
openapi/code/method.go Outdated Show resolved Hide resolved
openapi/code/method.go Outdated Show resolved Hide resolved
Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2023

Codecov Report

Attention: 1027 lines in your changes are missing coverage. Please review.

Files Coverage Δ
openapi/code/package.go 58.20% <100.00%> (ø)
service/compute/spark_version.go 0.00% <ø> (ø)
service/iam/model.go 0.00% <ø> (ø)
listing/listing.go 94.66% <94.66%> (ø)
openapi/code/method.go 33.33% <0.00%> (-1.20%) ⬇️
openapi/code/entity.go 23.80% <0.00%> (-3.08%) ⬇️
service/billing/api.go 0.00% <0.00%> (ø)
service/jobs/api.go 0.00% <0.00%> (ø)
service/pipelines/api.go 0.00% <0.00%> (ø)
service/settings/api.go 0.00% <0.00%> (ø)
... and 7 more

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!.

…cks/databricks-sdk-go into improve-required-path-parameters
@andrewnester andrewnester requested a review from pietern October 24, 2023 09:47
openapi/code/entity.go Show resolved Hide resolved
@andrewnester andrewnester added this pull request to the merge queue Oct 24, 2023
Merged via the queue into main with commit 4338bd4 Oct 24, 2023
4 checks passed
@andrewnester andrewnester deleted the improve-required-path-parameters branch October 24, 2023 10:54
github-merge-queue bot pushed a commit to databricks/cli that referenced this pull request Oct 24, 2023
…arameters and JSON input (#905)

## Changes
Simplified code generation logic for handling path and request body
parameters and JSON input

Note: relies on these PRs: 
databricks/databricks-sdk-go#666
databricks/databricks-sdk-go#669
databricks/databricks-sdk-go#670
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.

4 participants