external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

feat: initial OpenAPI spec for webhook provider

Open lyda opened this issue 1 year ago • 17 comments

This provides the initial OpenAPI doc describing the webhook API as described in the code. Really need far better descriptions for each endpoint and for each element in the schemas.

The goal is to make it far easier to implement providers. I'm using a similar document here

Relates to #4138

Not a goal for this PR, but possibly for a future one is to generate the webhook client with oapi-codegen.

lyda avatar Jan 03 '24 09:01 lyda

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: lyda / name: Kevin Lyda (4a56946057417a0e0309ffdc96bec38a22026dcc, bdc6bd6ac89c860dca27925c4bd5342566d93307, 44055609d91aa03e049aebf889e79940b64dd04a, 2569f62a253329814b9100fb654da9f0e9fa0193, e060348e7e69914865593151417ec4f4f10708b1, 9b7f76cb47f0da291bc85d134722b312aafee46f)

Welcome @lyda!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Jan 03 '24 09:01 k8s-ci-robot

Hi @lyda. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jan 03 '24 09:01 k8s-ci-robot

\o many thanks for this PR !

Do you think you can add in this PR:

  1. a linter test, for instance with vacuum
  2. integrate this spec with unit test, to ensure real validation

mloiseleur avatar Jan 04 '24 07:01 mloiseleur

Didn't know vacuum - will definitely add that.

Ideas for the second one? I know prism can run in proxy mode to do this. Any other tools you can suggest?

On Thu 4 Jan 2024, 07:38 Michel Loiseleur, @.***> wrote:

\o many thanks for this PR !

Do you think you can add in this PR:

  1. a linter test, for instance with vacuum https://github.com/daveshanley/vacuum
  2. integrate this spec with unit test, to ensure real validation

— Reply to this email directly, view it on GitHub https://github.com/kubernetes-sigs/external-dns/pull/4148#issuecomment-1876620724, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFOLDHRJ5SVWAYNP7LLDYLYMZMAFAVCNFSM6AAAAABBLEMWMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZWGYZDANZSGQ . You are receiving this because you were mentioned.Message ID: @.***>

lyda avatar Jan 04 '24 12:01 lyda

I can suggest either https://github.com/getkin/kin-openapi or https://pb33f.io/libopenapi/. It may help also to serve the spec on a http path like /spec/openapi.yaml.

mloiseleur avatar Jan 04 '24 13:01 mloiseleur

Sorry, @mloiseleur can you confirm my descriptions? I've reviewed a few webook providers and think I have them. I'm still a little unclear what POST /adjustendpoints is for. And I think my description of POST /records is correct, but would appreciate a confirmation. Thanks!

BTW, I'm using this for a provider for my home lab and so far has worked well.

lyda avatar Jan 07 '24 16:01 lyda

OK, added the linter spec - I think correctly. Not used to github workflows as I've mainly used gitlab for the past decade.

Will look at the unit test changes but likely not till next weekend. Will also look at serving it.

lyda avatar Jan 07 '24 19:01 lyda

/ok-to-test

mloiseleur avatar Jan 08 '24 15:01 mloiseleur

Cool. I think I have a version that fixes the warnings. Will do it this evening.

lyda avatar Jan 08 '24 16:01 lyda

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from raffo. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Jan 20 '24 16:01 k8s-ci-robot

Hi,

I started to implement a provider from the openapi spec, and i found some few things.

  1. required fields are not declared
  2. in the structure Changes the first field is "create", but edns send "Create"

regards,

jobs62 avatar Feb 12 '24 15:02 jobs62

@lyda Would you please update this PR following @jobs62 feedback ?

mloiseleur avatar Mar 12 '24 15:03 mloiseleur

/retitle feat: initial OpenAPI spec for webhook provider

mloiseleur avatar Mar 12 '24 16:03 mloiseleur

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 09 '24 17:08 k8s-triage-robot

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Sep 04 '24 02:09 k8s-ci-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Oct 04 '24 03:10 k8s-triage-robot