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

fix(http/swagger): repair DBRPs type to match implementation #20705

Merged
merged 3 commits into from
Feb 9, 2021

Conversation

sranka
Copy link
Contributor

@sranka sranka commented Feb 5, 2021

This PR repairs swagger DBRPs type to match actual implementation in https://github.com/influxdata/influxdb/blob/master/dbrp/http_server_dbrp.go#L128

  • notificationEndpoints property a was copy-paste mistake, it is called content
  • links property removed, it is not returned by the API

This change is also required for InfluxDB client libraries that rely upon code generated from the swagger file.

  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Well-formatted commit messages
  • Rebased/mergeable
  • Tests pass
  • http/swagger.yml updated (if modified Go structs or API)
  • Feature flagged (if modified API)
  • Documentation updated or issue created (provide link to issue/pr)
  • Signed CLA (if not already signed)

@danxmoran danxmoran self-assigned this Feb 5, 2021
@danxmoran danxmoran self-requested a review February 5, 2021 13:48
@sranka sranka force-pushed the fix/swagger_dbrps_type branch from 61571b2 to f1299a4 Compare February 8, 2021 14:22
Copy link
Contributor

@danxmoran danxmoran left a comment

Choose a reason for hiding this comment

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

We normally consider the API spec to be the source of truth, and fix the implementation to match when the two don't align. Agreed on the need to rename the key in the DBRPs schema, but we'll need to coordinate with the Cloud team to make the same change there.

@@ -12036,12 +12036,10 @@ components:
- retention_policy
DBRPs:
properties:
notificationEndpoints:
content:
Copy link
Contributor

Choose a reason for hiding this comment

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

To match the convention of other schemas, I think this should be dbrps

Copy link
Contributor Author

@sranka sranka Feb 8, 2021

Choose a reason for hiding this comment

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

This is just a copy-paste error in the swagger file. The existing influx v1 auth command already uses the content property and it works fine in OSS and in the cloud, the client also uses https://github.com/influxdata/influxdb/blob/master/dbrp/http_server_dbrp.go#L128. IMHO it would be better to fix it to match the implementation state first and then possibly create a defect for a better name and links later as a second step if you want to. It does not create any regression and nobody has to look left and right to proceed, WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, with fresh eyes it sounds like a good idea to fix for now and then improve later 👍

type: array
items:
$ref: "#/components/schemas/DBRP"
links:
$ref: "#/components/schemas/Links"
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems standard in many other objects returned by the API, I think we should instead try to fix the implementation to fill it in.

@sranka sranka requested a review from danxmoran February 9, 2021 12:22
danxmoran
danxmoran previously approved these changes Feb 9, 2021
@danxmoran danxmoran dismissed their stale review February 9, 2021 15:53

Missed something

Copy link
Contributor

@danxmoran danxmoran left a comment

Choose a reason for hiding this comment

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

Can you add a line to CHANGELOG.md?

@sranka sranka requested a review from danxmoran February 9, 2021 15:58
Copy link
Contributor

@danxmoran danxmoran left a comment

Choose a reason for hiding this comment

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

Thanks!

@sranka sranka merged commit fae5c2c into master Feb 9, 2021
@sranka sranka deleted the fix/swagger_dbrps_type branch February 9, 2021 16:48
bednar added a commit to influxdata/influxdb-client-swift that referenced this pull request Feb 10, 2021
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.

2 participants