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

refactor(notifications): isolate endpoint service #19818

Merged
merged 2 commits into from
Oct 28, 2020

Conversation

GeorgeMac
Copy link
Contributor

@GeorgeMac GeorgeMac commented Oct 26, 2020

Closes #19799

This PR delivers a similar objective to #19804 in that it migrates a service behavior (notification endpoints) off of the *kv.Service and isolates it into its own package notification/endpoint/service.

A lot of this work has been delivered and validated in influx cloud. It is mostly a lift and drop of the implementation there, which in itself is a lift a drop of the existing *kv.Servive implementation minus interactions with User Resource Mappings.

This severs the dependency on user resource mapping service. This is further supporting the endeavor to stop using *kv.Service as a tenant service: #19783

Update:

I realize the new check service was never wired in either. As I have started to integrate parts of tenant in place of KV, checks service tests in kv started failing. We have had a checks service defined which was never installed in the launcher. So instead of fixing a deprecated service. This PR now also installs the checks package implementation instead. Which is already tested and works without URMs.

@GeorgeMac GeorgeMac force-pushed the gm/notification-endpoints-service branch from edf0d1b to 2f236de Compare October 26, 2020 11:03
Base automatically changed from gm/notification-rules-service to master October 27, 2020 11:45
@GeorgeMac GeorgeMac force-pushed the gm/notification-endpoints-service branch 2 times, most recently from cdb3750 to 927262a Compare October 27, 2020 12:07
@GeorgeMac GeorgeMac marked this pull request as ready for review October 27, 2020 12:07
@GeorgeMac GeorgeMac requested review from stuartcarnie, a team and aanthony1243 and removed request for stuartcarnie and a team October 27, 2020 12:07
@GeorgeMac GeorgeMac force-pushed the gm/notification-endpoints-service branch from 927262a to f0c3c82 Compare October 27, 2020 12:24
Following the ongoing effort to isolate behaviours into their own
packages and off of kv.Service, this change move the notification
endpoints service implementation into its own package. It removes the
endpoint behaviors from the kv service completely.
@GeorgeMac GeorgeMac force-pushed the gm/notification-endpoints-service branch from f0c3c82 to c94f478 Compare October 27, 2020 12:31
Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

Looks good so far, @GeorgeMac – as you mentioned in the PR description, this is largely a lift of source from cloud, so I didn't thoroughly review those additions. A do see a few check / notification tests are still failing, so I'll leave those with you. Once those are passing, it has the green light from me 🚦

@@ -367,10 +367,6 @@ func (tl *TestLauncher) BucketService(tb testing.TB) *http.BucketService {
return &http.BucketService{Client: tl.HTTPClient(tb)}
}

func (tl *TestLauncher) CheckService() influxdb.CheckService {
Copy link
Contributor Author

@GeorgeMac GeorgeMac Oct 28, 2020

Choose a reason for hiding this comment

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

Note for the reader:

You'll see this has moved up onto the Launcher for now. I have been moving more of these helpers to use the clients as opposed to in-process service implementations. I went to move this to the http.CheckService implementation. But half the methods don't actually match the influxdb.CheckService interface. They return their own local check API domain model and accept slightly different arguments.
I started down the path of fixing this client, but It started to get unwieldy. I still want to deliver that though as its own PR later. So I have made a note to create an issue and fix this.
Until then this just updates the launcher test suite to interface with the same check service installed within the launcher itself. So that consistency is at least achieved, even if it doesn't exercise the front door as we would like.

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

Really exciting progress, @GeorgeMac 💯

Particularly love this :)

image

@GeorgeMac GeorgeMac merged commit 78cafa8 into master Oct 28, 2020
@GeorgeMac GeorgeMac deleted the gm/notification-endpoints-service branch October 28, 2020 15:22
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.

Move Notification Endpoint service into own package
2 participants