argo-cd
argo-cd copied to clipboard
feat(appset): implement ListResourceEvents for ApplicationSet
Part of the effort to add support for ApplicationSets in the UI, adds a ListResourceEvents endpoint to list the events on an Application, similar to the ListResourcesEvents on the Application. I kept the ListResourcesEvents name for consistency, even though the only resource is the ApplicationSet in this case.
Closes #15753
Checklist:
- [x] 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.
- [x] The title of the PR states what changed and the related issues number (used for the release note).
- [x] The title of the PR conforms to the Toolchain Guide
- [x] I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
- [x] I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them. (Part of another PR)
- [x] Does this PR require documentation updates?
- [x] I've updated documentation as required by this PR.
- [x] Optional. My organization is added to USERS.md.
- [x] I have signed off all my commits as required by DCO
- [x] I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
- [x] My build is green (troubleshooting builds).
- [x] My new feature complies with the feature status guidelines.
- [x] I have added a brief description of why this PR is necessary and/or what this PR solves.
Codecov Report
Attention: Patch coverage is 66.66667%
with 9 lines
in your changes are missing coverage. Please review.
Project coverage is 49.26%. Comparing base (
f87897c
) to head (2018f46
). Report is 18 commits behind head on master.
:exclamation: Current head 2018f46 differs from pull request most recent head 6292aeb. Consider uploading reports for the commit 6292aeb to get more accurate results
Files | Patch % | Lines |
---|---|---|
server/applicationset/applicationset.go | 66.66% | 6 Missing and 3 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #15754 +/- ##
==========================================
- Coverage 49.73% 49.26% -0.48%
==========================================
Files 274 274
Lines 48948 48197 -751
==========================================
- Hits 24343 23742 -601
+ Misses 22230 22105 -125
+ Partials 2375 2350 -25
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@alexymantha I have merged your code into mine to test end to end - and now the new API on the backend side gets invoked without any changes in the client side! There are no events for my AppSet, how can I make events get created so that I can test how it looks?
@reggie-k That's great! For the events, I did my testing by manually creating them for the AppSet using something like this:
kubectl apply -f - <<EOF
apiVersion: v1
kind: Event
metadata:
name: test-appset-event
namespace: argocd
type: Warning
message: 'This is a test event'
reason: 'TestingEvents'
involvedObject:
kind: ApplicationSet
name: <NAME>
namespace: argocd
uid: <UID>
EOF
You can also try to make operations on ArgoCD to trigger an event, but I found it was easier to just create them manually for testing.
Thank you @alexymantha for the event manifest. @alexymantha @crenshaw-dev Manual end to end tests on this PR, using the UI, passed, for both returning no events and for returning the actual events for the AppSet. If no comments from other perspectives and if no additional end to end testing required, this PR can be merged.