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

Adds API policy doc #210

Merged
merged 1 commit into from
Mar 15, 2021
Merged

Adds API policy doc #210

merged 1 commit into from
Mar 15, 2021

Conversation

sm43
Copy link
Member

@sm43 sm43 commented Mar 5, 2021

Signed-off-by: Shivam Mukhade smukhade@redhat.com

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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 5, 2021
Copy link
Member

@vinamra28 vinamra28 left a comment

Choose a reason for hiding this comment

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

can we have removal section as well so that users can come to know that after how much time the APIs are going to be removed after being deprecated?

docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
docs/API_POLICY.md Outdated Show resolved Hide resolved
Copy link
Member

@PuneetPunamiya PuneetPunamiya left a comment

Choose a reason for hiding this comment

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

Thanks for this 🤙
I just had one more question that is adding new field to the API will not bump the version of the API but removing any field would bump the version, why ? Because not sure if adding a new field might break the users usage as well

@sm43
Copy link
Member Author

sm43 commented Mar 10, 2021

Thanks for this
I just had one more question that is adding new field to the API will not bump the version of the API but removing any field would bump the version, why ? Because not sure if adding a new field might break the users usage as well

yes adding a new field won't break the API, removing does.


#### Additive changes

- Additive changes are changes that are added to the APIs and do not cause problems for existing users of the API.
Copy link
Member

Choose a reason for hiding this comment

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

Additive changes are changes that are added to the APIs in a backward compatible way and thus, do not cause problems for existing users of the API.

#### Additive changes

- Additive changes are changes that are added to the APIs and do not cause problems for existing users of the API.
- If the current version of API is `/v1` then any new addition for eg. adding new field in response of a API will not affect existing users of v1 version of that API.
Copy link
Member

Choose a reason for hiding this comment

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

"in response" — you mean in the response of the HTTP request right ?
We should also state that adding a new field as part of the request payload is possible, as long as it is done in a backward compatible way, meaning it has a default value and can be omitted safely.

Copy link
Member Author

Choose a reason for hiding this comment

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

yup will add the 2nd point

- Breaking changes are those when users have to change their implementation as per the changes in API. for eg. removal of a field from response, removing an API, removing a query param of an API.
- These changes will be introduced as a new version of the APIs.
- If current version of APIs is `/v1` and an API is going to be removed then all other APIs will be moved to `/v2`.
Users of v1 will be able to use old versioned APIs for 9 months then they will be removed.
Copy link
Member

Choose a reason for hiding this comment

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

Are we saying that one a v2 of an API is out, 9 months after, v1 gets removed ?
(note : we should probably use "at least 9 month" 😝 )

Copy link
Member Author

Choose a reason for hiding this comment

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

yup once v2 is out v1 will get removed after 9 months.

Copy link
Member Author

Choose a reason for hiding this comment

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

but let's say there is some breaking change in one of the API in v1 so increment the version to v2 so all other v1 APIs would also be incremented or just the one?

Copy link
Member Author

Choose a reason for hiding this comment

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

my understanding was we increment all the APIs to v2 and then after 9 months remove all the v1 APIs

Copy link
Member

Choose a reason for hiding this comment

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

yeah, it is probably better to bump the API version for all at the same time.

- `/v1/resource/<catalog>/<kind>/<name>/<version>`
- `/v1/resource/<id>/versions`
- `/v1/resource/version/<versionID>`
- `/v1/schema/swagger.json`
Copy link
Member

Choose a reason for hiding this comment

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

Is this an API or just a file 😉

Copy link
Member Author

Choose a reason for hiding this comment

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

it is an API that returns a file on the server 😄

This adds document which proposes a policy regarding making updates to the APIs of this repo.
Signed-off-by: Shivam Mukhade <smukhade@redhat.com>
@PuneetPunamiya
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 11, 2021
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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 Mar 15, 2021
@tekton-robot tekton-robot merged commit a667b06 into tektoncd:master Mar 15, 2021
@sm43 sm43 deleted the api-policy 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants