-
Notifications
You must be signed in to change notification settings - Fork 90
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
Move parts of the project over to rivershared
(monorepo alternative)
#429
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bgentry
approved these changes
Jul 7, 2024
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.
Nice, thanks for taking care of this!
As discussed over Slack, we've been having trouble wherein we often find ourselves needing pieces of the main River Go project over in other projects like River UI, and having to copy a bunch of stuff over. Here, we establish a new `rivershared` Go Module in the main River project, then move references to it from other main modules over to it. Basically my methodology for this one is that I'd been working on the plugin system, wanted to see if `startstop.Service` could be moved so we didn't have to duplicate it in `rivertype`, moved it to `rivershared`, then moved all of its dependencies over to `rivershared` as well. (Most of these dependencies come from `startstop`'s test suite.)
brandur
force-pushed
the
brandur-river-shared-2
branch
from
July 7, 2024 19:36
283d362
to
2ab7c13
Compare
Awesome. Alright let's give this a shot. |
brandur
added a commit
that referenced
this pull request
Jul 7, 2024
Here, follow up #429 to add a basic plugin system for River clients which allows a driver to add maintenance and non-maintenance services to a client before it starts up. The plugin interface is this: type Plugin interface { // MaintenanceServices returns additional maintenance services (will only // run on an elected leader) for a River client. MaintenanceServices() []startstop.Service // Services returns additional non-maintenance services (will run on all // clients) for a River client. Services() []startstop.Service } The change is fairly straightforward, and we make sure to bring in some test cases verifying the plugin services were indeed added correctly.
brandur
added a commit
that referenced
this pull request
Jul 7, 2024
Here, follow up #429 to add a basic plugin system for River clients which allows a driver to add maintenance and non-maintenance services to a client before it starts up. The plugin interface is implemented by the drivers themselves, and looks like this: type driverPlugin[TTx any] interface { // PluginInit initializes a plugin with an archetype and client. It's // invoked on Client.NewClient. PluginInit(archetype *baseservice.Archetype, client *Client[TTx]) // PluginMaintenanceServices returns additional maintenance services (will // only run on an elected leader) for a River client. PluginMaintenanceServices() []startstop.Service // PluginServices returns additional non-maintenance services (will run on // all clients) for a River client. PluginServices() []startstop.Service } The change is fairly straightforward, and we make sure to bring in some test cases verifying the plugin services were indeed added correctly.
brandur
added a commit
that referenced
this pull request
Jul 7, 2024
Here, follow up #429 to add a basic plugin system for River clients which allows a driver to add maintenance and non-maintenance services to a client before it starts up. The plugin interface is implemented by the drivers themselves, and looks like this: type driverPlugin[TTx any] interface { // PluginInit initializes a plugin with an archetype and client. It's // invoked on Client.NewClient. PluginInit(archetype *baseservice.Archetype, client *Client[TTx]) // PluginMaintenanceServices returns additional maintenance services (will // only run on an elected leader) for a River client. PluginMaintenanceServices() []startstop.Service // PluginServices returns additional non-maintenance services (will run on // all clients) for a River client. PluginServices() []startstop.Service } The change is fairly straightforward, and we make sure to bring in some test cases verifying the plugin services were indeed added correctly.
brandur
added a commit
that referenced
this pull request
Jul 7, 2024
Here, follow up #429 to add a basic plugin system for River clients which allows a driver to add maintenance and non-maintenance services to a client before it starts up. The plugin interface is implemented by the drivers themselves, and looks like this: type driverPlugin[TTx any] interface { // PluginInit initializes a plugin with an archetype and client. It's // invoked on Client.NewClient. PluginInit(archetype *baseservice.Archetype, client *Client[TTx]) // PluginMaintenanceServices returns additional maintenance services (will // only run on an elected leader) for a River client. PluginMaintenanceServices() []startstop.Service // PluginServices returns additional non-maintenance services (will run on // all clients) for a River client. PluginServices() []startstop.Service } The change is fairly straightforward, and we make sure to bring in some test cases verifying the plugin services were indeed added correctly.
brandur
added a commit
that referenced
this pull request
Jul 7, 2024
Here, follow up #429 to add a basic plugin system for River clients which allows a driver to add maintenance and non-maintenance services to a client before it starts up. The plugin interface is implemented by the drivers themselves, and looks like this: type driverPlugin[TTx any] interface { // PluginInit initializes a plugin with an archetype and client. It's // invoked on Client.NewClient. PluginInit(archetype *baseservice.Archetype, client *Client[TTx]) // PluginMaintenanceServices returns additional maintenance services (will // only run on an elected leader) for a River client. PluginMaintenanceServices() []startstop.Service // PluginServices returns additional non-maintenance services (will run on // all clients) for a River client. PluginServices() []startstop.Service } The change is fairly straightforward, and we make sure to bring in some test cases verifying the plugin services were indeed added correctly.
brandur
added a commit
that referenced
this pull request
Jul 7, 2024
Here, follow up #429 to add a basic plugin system for River clients which allows a driver to add maintenance and non-maintenance services to a client before it starts up. The plugin interface is implemented by the drivers themselves, and looks like this: type driverPlugin[TTx any] interface { // PluginInit initializes a plugin with an archetype and client. It's // invoked on Client.NewClient. PluginInit(archetype *baseservice.Archetype, client *Client[TTx]) // PluginMaintenanceServices returns additional maintenance services (will // only run on an elected leader) for a River client. PluginMaintenanceServices() []startstop.Service // PluginServices returns additional non-maintenance services (will run on // all clients) for a River client. PluginServices() []startstop.Service } The change is fairly straightforward, and we make sure to bring in some test cases verifying the plugin services were indeed added correctly.
brandur
added a commit
that referenced
this pull request
Jul 7, 2024
This is a follow up from #429 this morning. I moved `slogtest` and `startstoptest` over to the new `rivershared` module, but then forgot to remove the existing ones out of the main River module. Here, do that. All references have already been updated.
brandur
added a commit
that referenced
this pull request
Jul 8, 2024
Small change to follow up #429 that makes sure that we also update `rivershared`'s `go.mod` with changing internal package versions prior to release.
brandur
added a commit
that referenced
this pull request
Jul 8, 2024
This is a follow up from #429 this morning. I moved `slogtest` and `startstoptest` over to the new `rivershared` module, but then forgot to remove the existing ones out of the main River module. Here, do that. All references have already been updated.
brandur
added a commit
that referenced
this pull request
Jul 8, 2024
Small change to follow up #429 that makes sure that we also update `rivershared`'s `go.mod` with changing internal package versions prior to release.
brandur
added a commit
that referenced
this pull request
Jul 8, 2024
Here, follow up #429 to add a basic plugin system for River clients which allows a driver to add maintenance and non-maintenance services to a client before it starts up. The plugin interface is implemented by the drivers themselves, and looks like this: type driverPlugin[TTx any] interface { // PluginInit initializes a plugin with an archetype and client. It's // invoked on Client.NewClient. PluginInit(archetype *baseservice.Archetype, client *Client[TTx]) // PluginMaintenanceServices returns additional maintenance services (will // only run on an elected leader) for a River client. PluginMaintenanceServices() []startstop.Service // PluginServices returns additional non-maintenance services (will run on // all clients) for a River client. PluginServices() []startstop.Service } The change is fairly straightforward, and we make sure to bring in some test cases verifying the plugin services were indeed added correctly.
brandur
added a commit
that referenced
this pull request
Jul 8, 2024
Small change to follow up #429 that makes sure that we also update `rivershared`'s `go.mod` with changing internal package versions prior to release.
brandur
added a commit
that referenced
this pull request
Jul 8, 2024
Add basic plugin system for clients Here, follow up #429 to add a basic plugin system for River clients which allows a driver to add maintenance and non-maintenance services to a client before it starts up. The plugin interface is implemented by the drivers themselves, and looks like this: type driverPlugin[TTx any] interface { // PluginInit initializes a plugin with an archetype and client. It's // invoked on Client.NewClient. PluginInit(archetype *baseservice.Archetype, client *Client[TTx]) // PluginMaintenanceServices returns additional maintenance services (will // only run on an elected leader) for a River client. PluginMaintenanceServices() []startstop.Service // PluginServices returns additional non-maintenance services (will run on // all clients) for a River client. PluginServices() []startstop.Service } The change is fairly straightforward, and we make sure to bring in some test cases verifying the plugin services were indeed added correctly. --------- Co-authored-by: Blake Gentry <blakesgentry@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed over Slack, we've been having trouble wherein we often find
ourselves needing pieces of the main River Go project over in other
projects like River UI, and having to copy a bunch of stuff over.
Here, we establish a new
rivershared
Go Module in the main Riverproject, then move references to it from other main modules over to it.
Basically my methodology for this one is that I'd been working on the
plugin system, wanted to see if
startstop.Service
could be moved so wedidn't have to duplicate it in
rivertype
, moved it torivershared
,then moved all of its dependencies over to
rivershared
as well. (Mostof these dependencies come from
startstop
's test suite.)