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

feat: add notifications API #10279

Merged
merged 8 commits into from Aug 25, 2022
Merged

feat: add notifications API #10279

merged 8 commits into from Aug 25, 2022

Conversation

aborilov
Copy link
Contributor

@aborilov aborilov commented Aug 11, 2022

we allow listing triggers, templates, and services

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

we allow to list triggers, templates and services

Signed-off-by: Pavel <aborilov@gmail.com>
@aborilov aborilov changed the title add notifications API feat: add notifications API Aug 11, 2022
@crenshaw-dev
Copy link
Collaborator

@aborilov is there an issue and/or proposal I can look at to read up on this change?

@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #10279 (136462f) into master (a23bfc3) will not change coverage.
The diff coverage is 53.94%.

@@           Coverage Diff           @@
##           master   #10279   +/-   ##
=======================================
  Coverage   45.76%   45.76%           
=======================================
  Files         233      234    +1     
  Lines       28401    28460   +59     
=======================================
+ Hits        12998    13025   +27     
- Misses      13629    13658   +29     
- Partials     1774     1777    +3     
Impacted Files Coverage Δ
cmd/argocd/commands/admin/notifications.go 0.00% <0.00%> (ø)
pkg/apiclient/apiclient.go 0.94% <0.00%> (-0.03%) ⬇️
server/notification/notification.go 56.00% <56.00%> (ø)
server/server.go 52.49% <100.00%> (+0.95%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Pavel <aborilov@gmail.com>
for some reason notification configmap has old data, trying to fix with
the sleep

Signed-off-by: Pavel <aborilov@gmail.com>
@alexmt
Copy link
Collaborator

alexmt commented Aug 12, 2022

@crenshaw-dev created the issue: #10310

I think it deserves a proposal. Initially it looked like a small UI enhancement, however we are introducing a new notifications endpoint so it makes sense to discuss it first.

Signed-off-by: Pavel <aborilov@gmail.com>
@aborilov aborilov force-pushed the notifications branch 2 times, most recently from 3a08e16 to 08d7670 Compare August 18, 2022 14:24
Comment on lines 11 to 25
message Triggers {
repeated string triggers = 1;
}

message TriggersListRequest {}

message Services {
repeated string services = 1;
}

message ServicesListRequest {}

message Templates {
repeated string templates = 1;
}
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if if it's short sighted for this API to return []string or if it would be better to return []struct{name:string}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just in case? if we need something later?
what it can be for example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can always provide more info in

/api/v1/notifications/triggers/name`

endpoint
@jessesuen

Copy link
Member

Choose a reason for hiding this comment

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

For example, I believe some notifications allow for inputs from user. In addition to name, the API might provide metadata to prompt the UI to show the additional options for input (e.g. description or input name).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jessesuen done, pls check

Signed-off-by: Pavel <aborilov@gmail.com>
@aborilov aborilov force-pushed the notifications branch 2 times, most recently from d025b47 to e67b71d Compare August 24, 2022 18:38
to be able easily extend API in the future return list of
trigger/template/service as list of structs

Signed-off-by: Pavel <aborilov@gmail.com>
Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

LGTM!

@alexmt alexmt merged commit 37ad433 into argoproj:master Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants