Skip to content

Allow loading of factories from namespaced extensions#207

Merged
elia merged 1 commit intosolidusio:masterfrom
forkata:add-support-for-namespaced-extensions
Jun 9, 2023
Merged

Allow loading of factories from namespaced extensions#207
elia merged 1 commit intosolidusio:masterfrom
forkata:add-support-for-namespaced-extensions

Conversation

@forkata
Copy link
Copy Markdown
Contributor

@forkata forkata commented May 10, 2023

Summary

The previous glob did not allow there to be more than one level of namespacing in the extension file structure when loading factories.
This change will support extensions that have their factories in a folder structure like lib/super_good/solidus_taxjar/testing_support/factories/*.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@mergify mergify Bot added the needs changelog label Needs a label to determine the type of change. label May 10, 2023
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 10, 2023

It looks like this PR is missing a label to determine the type of change it introduces. The maintainer should add one of the following labels:

  • bug for bugfixes.
  • enhancement for new features and improvements.
  • documentation for documentation changes.
  • security for security patches.
  • removed for feature removals.
  • infrastructure for internal changes that should not go in the changelog.

Additionally, the maintainer may also want to add one of the following:

  • breaking for breaking changes.
  • deprecated for feature deprecations.

Once the correct labels have been set, simply remove the needs changelog label label from this PR so I can merge it.

forkata added a commit to SuperGoodSoft/solidus_taxjar that referenced this pull request May 11, 2023
This change updates our extension to use the new method provided by
`solidus_dev_support` instead of manually requiring the files. This is
in line with how `FactoryBot` recommends factories are registered and
resolves an issue with our custom override for the `Spree::Address`
factory.

Currently the upstream version of `solidus_dev_support` does not handle
our use case of having a two folder deep namespace, so this change needs
to wait for that to be fixed. We have opened a PR upstream for that to
be changed - solidusio/solidus_dev_support#207

Co-authored-by: Nick Van Doorn <nick@super.gd>
@forkata
Copy link
Copy Markdown
Contributor Author

forkata commented May 12, 2023

This has to be rebased on #204 for tests to run, but that branch is currently failing CI.

forkata added a commit to SuperGoodSoft/solidus_taxjar that referenced this pull request May 19, 2023
This is a temporary fix until our PR to `solidus_dev_support` is merged
that allows us to have deeper namespacing of the extension folder
structure.

solidusio/solidus_dev_support#207

Co-authored-by: Nick Van Doorn <nick@super.gd>
forkata added a commit to SuperGoodSoft/solidus_taxjar that referenced this pull request May 19, 2023
This is a temporary fix until our PR to `solidus_dev_support` is merged
that allows us to have deeper namespacing of the extension folder
structure.

solidusio/solidus_dev_support#207

Co-authored-by: Nick Van Doorn <nick@super.gd>
The previous glob did not allow there to be more than one level of
namespacing in the extension file structure. This change will support
extensions that have their factories in folder like
`lib/super_good/solidus_taxjar/testing_support/factories/*`.

Co-authored-by: Nick Van Doorn <nick@super.gd>
@forkata forkata force-pushed the add-support-for-namespaced-extensions branch from 33b9dd8 to 3e6b7ca Compare May 23, 2023 18:56
forkata added a commit to SuperGoodSoft/solidus_taxjar that referenced this pull request May 24, 2023
This is a temporary fix until our PR to `solidus_dev_support` is merged
that allows us to have deeper namespacing of the extension folder
structure.

solidusio/solidus_dev_support#207

Co-authored-by: Nick Van Doorn <nick@super.gd>
@elia elia self-assigned this Jun 7, 2023
@elia
Copy link
Copy Markdown
Member

elia commented Jun 9, 2023

Thanks, good catch!

@elia elia merged commit 02838d0 into solidusio:master Jun 9, 2023
@forkata forkata deleted the add-support-for-namespaced-extensions branch June 9, 2023 18:29
forkata added a commit to SuperGoodSoft/solidus_taxjar that referenced this pull request Oct 17, 2023
This change updates our extension to use the new method provided by
`solidus_dev_support` instead of manually requiring the files. This is
in line with how `FactoryBot` recommends factories are registered and
resolves an issue with our custom override for the `Spree::Address`
factory.

Currently the upstream version of `solidus_dev_support` does not handle
our use case of having a two folder deep namespace, so this change needs
to wait for that to be fixed. We have opened a PR upstream for that to
be changed - solidusio/solidus_dev_support#207

Co-authored-by: Nick Van Doorn <nick@super.gd>
forkata added a commit to SuperGoodSoft/solidus_taxjar that referenced this pull request Oct 17, 2023
This change updates our extension to use the new method provided by
`solidus_dev_support` instead of manually requiring the files. This is
in line with how `FactoryBot` recommends factories are registered and
resolves an issue with our custom override for the `Spree::Address`
factory.

Currently the upstream version of `solidus_dev_support` does not handle
our use case of having a two folder deep namespace, so this change needs
to wait for that to be fixed. We have opened a PR upstream for that to
be changed - solidusio/solidus_dev_support#207

Co-authored-by: Nick Van Doorn <nick@super.gd>
forkata added a commit to SuperGoodSoft/solidus_taxjar that referenced this pull request Oct 31, 2023
This change updates our extension to use the new method provided by
`solidus_dev_support` instead of manually requiring the files. This is
in line with how `FactoryBot` recommends factories are registered and
resolves an issue with our custom override for the `Spree::Address`
factory.

Currently the upstream version of `solidus_dev_support` does not handle
our use case of having a two folder deep namespace, so this change needs
to wait for that to be fixed. We have opened a PR upstream for that to
be changed - solidusio/solidus_dev_support#207

Co-authored-by: Nick Van Doorn <nick@super.gd>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs changelog label Needs a label to determine the type of change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants