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

Document 6.0.0 may break FactoryBot.lint #1523

Merged

Conversation

choznerol
Copy link
Contributor

@choznerol choznerol commented Dec 16, 2021

In a sufficiently large codebase, the automatic definition of traits for Active Record enum (#1380) may result in more combinations being checked by FactoryBot.lint. This breaking change may not be obvious because the first impression of the error messages may be "these factories were passing before the upgrade but now failing ?", while the truth is that they don't exist before the upgrade. It took me a while to realize this so I hope adding this note could help people be aware of this situation when upgrading.

NEWS.md Outdated
@@ -21,7 +21,7 @@
* Added: automatic definition of traits for Active Record enum attributes, enabled by default
(Note that this required changing where factory_bot constantizes the build
class, which may affect applications that were using abstract factories for
inheritance. See issue #1409.)
inheritance. See issue #1409.) (This may break `FactoryBot.lint` because there may be previously non-existing factory+trait combinations being defined and checked)

Choose a reason for hiding this comment

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

This should be wrapped to 80 chars to match the rest of this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have amended and push 710dd7a instead

@choznerol choznerol force-pushed the docs/6-0-0-breaks-FactoryBot-lint branch 2 times, most recently from 710dd7a to 37956ee Compare September 24, 2022 17:33
In a sufficiently large codebase, the automatic definition of traits for
Active Record enum may result in more combinations being checked by
`FactoryBot.lint`. This breaking change may not be obvious because the
first impression of the error messages may be "these factories were
passing before the upgrade but now failing ?", while the truth is that
they don't exist before the upgrade.
@mike-burns mike-burns force-pushed the docs/6-0-0-breaks-FactoryBot-lint branch from 37956ee to e17be4a Compare September 1, 2023 11:53
@mike-burns mike-burns self-requested a review as a code owner September 1, 2023 11:53
@mike-burns mike-burns merged commit e17be4a into thoughtbot:main Sep 1, 2023
57 checks passed
@mike-burns
Copy link
Contributor

Thanks!

@choznerol choznerol deleted the docs/6-0-0-breaks-FactoryBot-lint branch September 1, 2023 14:15
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.

4 participants