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

Update extension for new Omnes event 🚌 #193

Merged
merged 5 commits into from
Sep 19, 2022

Conversation

forkata
Copy link
Collaborator

@forkata forkata commented Jun 24, 2022

What is the goal of this PR?

Get tests passing against Solidus master.
Update the way we use the Solidus event bus to be forwards compatible with the new Omens bus implementation that is now default in Solidus "=> 3.2.0.alpha" - solidusio/solidus#4342

Additional information on updating to the new event bus implementation - solidusio/solidus#4380

How do you manually test these changes?

  1. Test the reporting features against Solidus master
    • Create and ship an order and verify it is created as a transaction on TaxJar
    • Update an order (cancel an item) and confirm the original transaction is refunded on TaxJar and a replacement is created
  2. Run the same tests against Solidus 3.0

Merge Checklist

  • Run the manual tests
  • Update the changelog

@forkata forkata changed the title Update specs for backported event Update extension for new Omnes event bus Jun 24, 2022
@forkata forkata force-pushed the chore/get-on-the-new-bus branch from 6d7fe01 to ccafe94 Compare June 27, 2022 19:27
@forkata forkata force-pushed the chore/get-on-the-new-bus branch 2 times, most recently from 61e13a6 to e9cb906 Compare July 15, 2022 21:24
@forkata forkata changed the title Update extension for new Omnes event bus Update extension for new Omnes event 🚌 Jul 15, 2022
@forkata forkata marked this pull request as ready for review July 15, 2022 21:31
@forkata forkata marked this pull request as draft August 15, 2022 23:28
@forkata
Copy link
Collaborator Author

forkata commented Aug 15, 2022

Converting this to a draft as me and @Noah-Silvera discovered an issue with the shipment_shipped event not firing the event action. Additionally it looks like with the latest changes on Solidus master to remove solidus_frontend there are some issues with spinning up the sandbox and dummy apps, so the green checkmark here is stale and will disappear on a rebuild 😞

@forkata forkata force-pushed the chore/get-on-the-new-bus branch 2 times, most recently from 936116e to 25902c5 Compare August 25, 2022 21:25
@Noah-Silvera Noah-Silvera force-pushed the chore/get-on-the-new-bus branch 6 times, most recently from 5862053 to f0725ff Compare August 26, 2022 22:54
@Noah-Silvera Noah-Silvera force-pushed the chore/get-on-the-new-bus branch from f0725ff to 1b1e171 Compare September 12, 2022 17:45
@Noah-Silvera Noah-Silvera changed the base branch from master to update-solidus-dependencies-to-support-3.2 September 12, 2022 17:45
@forkata forkata force-pushed the chore/get-on-the-new-bus branch from 1b1e171 to 941a7fd Compare September 16, 2022 21:59
@forkata forkata marked this pull request as ready for review September 16, 2022 23:28
Base automatically changed from update-solidus-dependencies-to-support-3.2 to master September 19, 2022 17:56
forkata and others added 5 commits September 19, 2022 10:57
The specs here were specific to the legacy implementation of the event
system, and therefore no longer pass on the `master` branch of Solidus
where we now use a [new implementation of the event bus](solidusio/solidus#4342).
This change attempts to refactor the tests to focus on observing the
side-effects of the object under test which should be independent of the
underlying implementation.

This test is valuable regardless of what version of Solidus we are running
against as our extension relies on the event being published when a specific
action happens and that the payload contains the necessary object.

Co-authored-by: Andrew Stewart <andrew@super.gd>
This change attempts to introduce a backwards compatible way for
registering and publishing events on the new Omnes event bus introduced
in Solidus. A few of the issues this change resolves are
* auto-loading of subscribers is not a feature of the event bus anymore
  and we need to explicitly register subscribers with the event bus
* firing of events in tests was done in a manner not forward compatible
  with the new event bus, so we now leverage the compatibility layer
  provided by `solidus_support`
* custom events now need to be registered in an initializer and use symbol
  for the event name instead of strings
We are now using the compatibility layer for the event system which was
introduced in 0.9.0.
This change uses the compatibility layer provided by `solidus_support`
to fire the `shipment_shipped` event we have introduced in this
extension in a way that works with the new `Omnes` event bus. This will
ensure that this continues to work with versions of Solidus >= 3.2.0.

Co-authored-by: Noah Silvera <noah@super.gd>
Documents the fact that we now require a newer version of
`solidus_support` which in turn requires a newer Rails version.
@Noah-Silvera Noah-Silvera force-pushed the chore/get-on-the-new-bus branch from 941a7fd to 4de6296 Compare September 19, 2022 17:57
@Noah-Silvera Noah-Silvera merged commit 05674ef into master Sep 19, 2022
@Noah-Silvera Noah-Silvera deleted the chore/get-on-the-new-bus branch September 19, 2022 18:35
@forkata
Copy link
Collaborator Author

forkata commented Sep 21, 2022

@Noah-Silvera, @benjaminwil and I confirmed the issue with Solidus 3.2 is present upstream as well so not related to the changes merged here. I will work on manually setting up a working sandbox on that version of Solidus so we can verify the new behaviour introduced here.

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.

5 participants