-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: unify pipeline trigger chart endpoint with credit chart #228
feat: unify pipeline trigger chart endpoint with credit chart #228
Conversation
ed308ce
to
5751b66
Compare
5751b66
to
c58f6f2
Compare
QA$ curl 'localhost:8080/v1beta/metrics/vdp/pipeline/charts?namespaceId=jvallesm&start=2024-07-22T22:00:00.000Z&stop=2024-07-23T22:00:00.000Z&aggregationWindow=1h' \
-H 'Authorization: Bearer instill_sk_1Myb31r6YsjVt8In2zf8vRvq6wUpfvRq' | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 742 100 742 0 0 38601 0 --:--:-- --:--:-- --:--:-- 39052
{
"pipelineTriggerChartRecords": [
{
"timeBuckets": [
"2024-07-22T23:00:00Z",
"2024-07-23T00:00:00Z",
"2024-07-23T01:00:00Z",
"2024-07-23T02:00:00Z",
"2024-07-23T03:00:00Z",
"2024-07-23T04:00:00Z",
"2024-07-23T05:00:00Z",
"2024-07-23T06:00:00Z",
"2024-07-23T07:00:00Z",
"2024-07-23T08:00:00Z",
"2024-07-23T09:00:00Z",
"2024-07-23T10:00:00Z",
"2024-07-23T11:00:00Z",
"2024-07-23T12:00:00Z",
"2024-07-23T13:00:00Z",
"2024-07-23T14:00:00Z",
"2024-07-23T15:00:00Z",
"2024-07-23T16:00:00Z",
"2024-07-23T17:00:00Z",
"2024-07-23T18:00:00Z",
"2024-07-23T19:00:00Z",
"2024-07-23T20:00:00Z",
"2024-07-23T21:00:00Z",
"2024-07-23T22:00:00Z"
],
"triggerCounts": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
8,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"namespaceId": "jvallesm"
}
]
} |
QA$ curl 'localhost:8080/v1beta/metrics/vdp/pipeline/trigger-count?namespaceId=jvallesm&start=2024-07-22T22:00:00.000Z&stop=2024-07-25T22:00:00.000Z' \
-H 'Authorization: Bearer instill_sk_1Myb31r6YsjVt8In2zf8vRvq6wUpfvRq' | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 122 100 122 0 0 7058 0 --:--:-- --:--:-- --:--:-- 7176
{
"pipelineTriggerCounts": [
{
"triggerCount": 8,
"status": "STATUS_COMPLETED"
},
{
"triggerCount": 2,
"status": "STATUS_ERRORED"
}
]
} |
listOwners(ctx context.Context, ownerType string, pageSize int, pageToken string, filter filtering.Filter) ([]*datamodel.Owner, int64, string, error) | ||
createOwner(ctx context.Context, ownerType string, user *datamodel.Owner) error | ||
getOwner(ctx context.Context, ownerType string, id string, includeAvatar bool) (*datamodel.Owner, error) | ||
getOwnerByUID(ctx context.Context, ownerType string, uid uuid.UUID) (*datamodel.Owner, error) | ||
updateOwner(ctx context.Context, ownerType string, id string, user *datamodel.Owner) error | ||
deleteOwner(ctx context.Context, ownerType string, id string) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 @donch1989 if owner ID is unique perhaps we don't need the type checks in these methods and we can delegate on the service layer to check the authenticated user permissions to perform these actions.
@@ -250,12 +285,11 @@ func (r *repository) createOwner(ctx context.Context, ownerType string, owner *d | |||
return nil | |||
} | |||
|
|||
func (r *repository) getOwner(ctx context.Context, ownerType string, id string, includeAvatar bool) (*datamodel.Owner, error) { | |||
|
|||
func (r *repository) GetOwner(ctx context.Context, id string, includeAvatar bool) (*datamodel.Owner, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@donch1989 I mentioned this change in your PR yesterday, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we can expose it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🤖 I have created a release *beep* *boop* --- ## [0.19.0-beta](v0.18.1-beta...v0.19.0-beta) (2024-07-29) ### Features * add private endpoint `CheckNamespaceByUIDAdmin` ([#227](#227)) ([274d365](274d365)) * **mgmt:** add knowledge base acl model ([#226](#226)) ([b4b813e](b4b813e)) * unify pipeline trigger chart endpoint with credit chart ([#228](#228)) ([c2ccc17](c2ccc17)) * use explicit user_id and organization_id in request params ([#224](#224)) ([3388190](3388190)) ### Bug Fixes * restore pipeline dashboard enpoints ([#230](#230)) ([02e32df](02e32df)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Because
This commit