Skip to content

Merge DummyResource and Dev namespaces#12157

Merged
andreslucena merged 19 commits intodevelopfrom
fix/decidim-dev-autoload
Dec 13, 2023
Merged

Merge DummyResource and Dev namespaces#12157
andreslucena merged 19 commits intodevelopfrom
fix/decidim-dev-autoload

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu commented Dec 12, 2023

🎩 What? Why?

While working to release metaDecidim, we have noticed there are some issues with the factoryBot DummyResource, which was fixed by #12123. While upgrading another application to Decidim 0.28, i have started to see there are a lot of errors like the one in the below image (the same error fixed by #12123). Upon investigation, i have noticed the 2 applications had the rails config "config.load_defaults" different. MetaDecidim used config.load_defaults 5.1, the faulty application used config.load_defaults 6.1.

In order to validate my assumption, i have changed the same config in MetaDecidim, and started to see the same error. I have changed the MetaDecidim gem source to my decidim local folder, and i have started working on the fix. When the implementation was finished, the MetaDecidim test suite was successful.

image

📌 Related Issues

Link your PR to an issue

Testing

  1. Download Metadecidim and install decidim-0.28.rc4
  2. Run test suite and see is successful
  3. Change config.load_defaults 6.1 in config/application.rb, repeat step 2
  4. See the testsuite is failing
  5. Apply patch
  6. Repeat step 3
  7. See test suite is successful

♥️ Thank you!

@alecslupu alecslupu added the type: fix PRs that implement a fix for a bug label Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2023
github-actions[bot]
github-actions bot previously approved these changes Dec 13, 2023
@alecslupu alecslupu marked this pull request as ready for review December 13, 2023 07:41
@alecslupu alecslupu requested a review from a team December 13, 2023 07:49
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

I tried it with the metadecidim app locally by changing the config.load_defaults in config/application.rb and everything runs well as is 👏🏽 👏🏽

I've also checked that we've migrated all to the namespace. Things that I've checked:

  • "module DummyResources"
  • "Decidim::DummyResources"
  • the directory name dummy_resources. The only I could find makes sense (decidim-dev/app/views/decidim/dev/dummy_resources, but that's because we have a dummy_resources_controller.rb)

I found a few details and we're good to go

Comment thread decidim-dev/lib/decidim/dev/test/rspec_support/component.rb
Comment thread decidim-dev/app/models/decidim/dev/coauthorable_dummy_resource.rb Outdated
Comment thread decidim-dev/lib/decidim/dev.rb Outdated
@andreslucena
Copy link
Copy Markdown
Member

Upon investigation, i have noticed the 2 applications had the rails config "config.load_defaults" different. MetaDecidim used config.load_defaults 5.1, the faulty application used config.load_defaults 6.1.

To understand better whats exactly happening here, is this a change between versions on the rails autoloader (with the zeitweirk introduction), right?

@alecslupu
Copy link
Copy Markdown
Contributor Author

To understand better whats exactly happening here, is this a change between versions on the rails autoloader (with the zeitweirk introduction), right?
As far i could understand it, yes. As Zeitwerk has became default in rails 6.

github-actions[bot]
github-actions bot previously approved these changes Dec 13, 2023
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

👍🏽

@andreslucena andreslucena merged commit 2b1d5d1 into develop Dec 13, 2023
@andreslucena andreslucena deleted the fix/decidim-dev-autoload branch December 13, 2023 11:01
@alecslupu alecslupu added release: v0.28 Issues or PRs that need to be tackled for v0.28 no-backport Pull Requests that should not be backported labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-backport Pull Requests that should not be backported release: v0.28 Issues or PRs that need to be tackled for v0.28 type: fix PRs that implement a fix for a bug

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants