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

API to refresh all catalogs #215

Merged
merged 1 commit into from
Mar 29, 2021
Merged

Conversation

sm43
Copy link
Member

@sm43 sm43 commented Mar 18, 2021

This adds an endpoint /catalog/refresh/all which will refresh all
catalogs in db. User will need to have catalog:refresh scope in token
to access the API.

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.

Closes #207

@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 18, 2021
@sm43 sm43 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 18, 2021
Base automatically changed from master to main March 18, 2021 16:08
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 19, 2021
@sm43 sm43 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 22, 2021
db := s.DB(ctx)

ctgs := []model.Catalog{}
if err := db.Model(&model.Catalog{}).Find(&ctgs).Error; err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Can't we use directly db.find since we don't want any specific fields from the tables ?

@@ -26,18 +26,21 @@ var _ = Service("catalog", func() {
Error("not-found", ErrorResult, "Resource Not Found Error")

Method("Refresh", func() {
Description("Refreshes Tekton Catalog")
Description("Refresh a Tekton Catalog by its name")
Copy link
Member

Choose a reason for hiding this comment

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

I think since we are having this for multicatalog support it should be as
Refresh a Catalog by it's name

@piyush-garg
Copy link
Contributor

If for a particular catalog we have

 /catalog/<catalog-name>/refresh

then for all catalogs, we can have

/catalog/refresh

It will also not break the old API. WDYT?

@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 22, 2021
@sm43
Copy link
Member Author

sm43 commented Mar 22, 2021

If for a particular catalog we have

 /catalog/<catalog-name>/refresh

then for all catalogs, we can have

/catalog/refresh

It will also not break the old API. WDYT?

yeah we can do that to avoid the breakage, /catalog/refresh/all which implies all catalog will be refreshed so added this 😄
/catalog/refresh doesn't say it will refresh all catalogs. and as it is internal so didn't think much of breakage

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 23, 2021
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 23, 2021
@sm43
Copy link
Member Author

sm43 commented Mar 24, 2021

API: /catalog/refresh

@sm43 sm43 force-pushed the refresh-all-catalogs branch 4 times, most recently from 979074c to 7632ba0 Compare March 24, 2021 13:46
@piyush-garg
Copy link
Contributor

/lgtm

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

/approve
/meow
/woof

@tekton-robot
Copy link

@PuneetPunamiya: dog image

In response to this:

/approve
/meow
/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
Copy link

@PuneetPunamiya: cat image

In response to this:

/approve
/meow
/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
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 Mar 26, 2021
@sm43
Copy link
Member Author

sm43 commented Mar 26, 2021

/test

@sm43
Copy link
Member Author

sm43 commented Mar 26, 2021

/retest

@sm43 sm43 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 26, 2021
This adds an endpoint /catalog/refresh which will refresh all
catalogs in db. User will need to have catalog:refresh scope in token
to access the API.

Signed-off-by: Shivam Mukhade <smukhade@redhat.com>
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 26, 2021
@sm43
Copy link
Member Author

sm43 commented Mar 28, 2021

/retest

@sm43 sm43 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 28, 2021
@pratap0007
Copy link
Contributor

/lgtm
/meow

@tekton-robot
Copy link

@pratap0007: cat image

In response to this:

/lgtm
/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 tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 29, 2021
@tekton-robot tekton-robot merged commit ccb54ad into tektoncd:main Mar 29, 2021
@sm43 sm43 deleted the refresh-all-catalogs 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.

Add an API to refresh all catalogs
5 participants