Skip to content

Add ADR 0015: switch to factory_bot; supersede ADR 0002#5120

Merged
philippthun merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:adr-factory-bot
Jun 11, 2026
Merged

Add ADR 0015: switch to factory_bot; supersede ADR 0002#5120
philippthun merged 1 commit into
cloudfoundry:mainfrom
sap-contributions:adr-factory-bot

Conversation

@philippthun

@philippthun philippthun commented May 23, 2026

Copy link
Copy Markdown
Member

ADR 0002 (2019) chose to keep machinist after a partial factory_bot migration hit friction with Sequel's mutual-foreign-key pattern.

The blocker described there is solvable in factory_bot using a global to_create with save+refresh and after(:create) callbacks with transient flags. machinist 1.0.6 has had no upstream activity since 2013, and 2.0 is not a viable upgrade (no Sequel adapter, no Sham, non-persisting make).

Mark ADR 0002 as superseded and add ADR 0015 documenting the new decision and the patterns that made it work.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@philippthun philippthun marked this pull request as ready for review May 23, 2026 00:17
@philippthun

Copy link
Copy Markdown
Member Author

Actual migration in #5121.

sethboyles
sethboyles previously approved these changes Jun 9, 2026
factory definitions under `spec/support/factory_definitions/`.

The conversion is done as one change. There is no extended period in which
both libraries coexist in the codebase.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe it should be briefly mentioned why we do a big bang migration and not an incremental one.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've removed that sentence. The ADR should document the goal / the desired end state - if done incrementally or as a big bang migration is an independent decision.

ADR 0002 (2019) chose to keep machinist after a partial factory_bot
migration hit friction with Sequel's mutual-foreign-key pattern.

The blocker described there is solvable in factory_bot using a global
to_create with save+refresh and after(:create) callbacks with transient
flags. machinist 1.0.6 has had no upstream activity since 2013, and 2.0
is not a viable upgrade (no Sequel adapter, no Sham, non-persisting
make).

Mark ADR 0002 as superseded and add ADR 0015 documenting the new
decision and the patterns that made it work.
@philippthun philippthun merged commit 0a3a400 into cloudfoundry:main Jun 11, 2026
5 checks passed
ari-wg-gitbot added a commit to cloudfoundry/capi-release that referenced this pull request Jun 11, 2026
Changes in cloud_controller_ng:

- Add ADR 0015: switch to factory_bot; supersede ADR 0002
    PR: cloudfoundry/cloud_controller_ng#5120
    Author: Philipp Thun <philipp.thun@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants