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

Refactors API Service for API versioning #174

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

sm43
Copy link
Member

@sm43 sm43 commented Jan 21, 2021

Signed-off-by: Shivam Mukhade [email protected]

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 21, 2021
@sm43
Copy link
Member Author

sm43 commented Feb 8, 2021

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 8, 2021
@sm43 sm43 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 10, 2021

# For each new version, doc has to be copied
COPY gen/http/openapi3.yaml /app/gen/http/openapi3.yaml
COPY v1/gen/http/openapi3.yaml /app/v1/gen/http/openapi3.yaml
Copy link
Member

Choose a reason for hiding this comment

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

So according to api policy will we make change here if further we have v2 and so on or keep this as well ??

Copy link
Member Author

Choose a reason for hiding this comment

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

for each new version, we need to copy the doc.. if we are deprecating a version then we will remove that doc

NotFoundError = fmt.Errorf("resource not found")
)

//Query resources based on name, kind, tags.
Copy link
Member

Choose a reason for hiding this comment

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

nit: Can we please add a space after //

Description("The resource service provides details about all kind of resources")

HTTP(func() {
Path("/v1")
Copy link
Member

Choose a reason for hiding this comment

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

Just a thought is it possible to define the path somewhere so that we won't have to write the whole code again instead just take the path and rest all api design take it from generalized directory (this implies mostly when api's are not removed)

Copy link
Member Author

Choose a reason for hiding this comment

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

define the path somewhere where? 😄

Copy link
Member

Choose a reason for hiding this comment

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

What I meant was the same thing we have done by creating a shared directory, not sure will that work or not just asking

Copy link
Member Author

Choose a reason for hiding this comment

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

I think for the design we can't do that we define the URL inside the service even if we share a service can't override any values

Copy link
Member Author

Choose a reason for hiding this comment

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

this is fine I guess easy to maintain

})

HTTP(func() {
GET("/categories")
GET("/v1/categories")
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be breaking change now as we already published

Copy link
Member Author

Choose a reason for hiding this comment

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

added back.. API will be removed in the next release and be internal to hub

This refactors API service code to maintain seperate directory for each
user facing APIs.

Signed-off-by: Shivam Mukhade <[email protected]>
@piyush-garg
Copy link
Contributor

/lgtm

Later, we may work on generalizing the API layer also like DB layer between multiple version services

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2021
@PuneetPunamiya
Copy link
Member

/lgtm
/approve
/meow

@tekton-robot
Copy link

@PuneetPunamiya: cat image

In response to this:

/lgtm
/approve
/meow

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.

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: PuneetPunamiya

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

The pull request process is described 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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 22, 2021
@PuneetPunamiya
Copy link
Member

/woof

@tekton-robot
Copy link

@PuneetPunamiya: dog image

In response to this:

/woof

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.

@tekton-robot tekton-robot merged commit 2a987f9 into tektoncd:master Feb 22, 2021
@sm43 sm43 deleted the versioning-refactor branch April 15, 2021 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants