Skip to content

Add a Rails app to the examples folder if and when possible. #144

Closed

Description

@kigster

Not sure if the rules can already be used on a Rails App, but I think that this should be ultimately a goal because so many huge monolithic applications can benefit from partial Bazel builds (that would likely be mostly running tests on sub-sections of the app that changed).

Perhaps leave this as a placeholder for now, or comment why this isn't a goal, or what do you think about Rails support down the road.

Activity

  1. p0deje commented on Jul 27, 2024

    @p0deje
    Member

    I think it would be great to have a Rails example, PRs are welcome!

  2. J-Swift commented on Aug 21, 2024

    @J-Swift

    I was just thinking through what it would mean to put a Rails app in bazel and landed here : D

    Agreed, Id love to see the intended way to split code to be more 'bazely' for a rails app.

  3. p0deje commented on Aug 21, 2024

    @p0deje
    Member

    @J-Swift I don't think there is that much to be done to make Rails work via Bazel. In fact, there should not be a big need to change the codebase structure in any way except for adding BUILD files in specific directories and making the dependencies more explicit.

  4. J-Swift commented on Aug 21, 2024

    @J-Swift

    I was thinking more about trying to actually leverage bazel in a rails app so you could eg slice up the test suite and not run the whole thing

  5. p0deje commented on Aug 21, 2024

    @p0deje
    Member

    I was thinking more about trying to actually leverage bazel in a rails app so you could eg slice up the test suite and not run the whole thing

    That's what I mean by "making the dependencies more explicit". For example, you can create separate targets for app/models/user.rb and test/models/user_test.rb. The latter would depend on the former. Now, whenever the model is changed, the bazel test ... would run the model test. But if the model was not changed, it would re-use the cached test result until one of the test target dependencies change.

  6. J-Swift commented on Aug 21, 2024

    @J-Swift

    I guess I just think rails apps typically are not operating with such explicit boundaries and so really the only way I imagined it being possible is if things were split into code modules (eg engines, or gems)

  7. p0deje commented on Aug 21, 2024

    @p0deje
    Member

    Nothing really stops you from doing the dependencies only with Bazel. In this case, during the test execution, Bazel will symlink dependencies into a test runfiles tree, allowing you to see when the boundaries are violated.

  8. J-Swift commented on Aug 21, 2024

    @J-Swift

    Ok interesting Ill have to test it out when I get time

  9. added theissue type on Mar 8, 2025
  10. self-assigned this
    on Sep 6, 2025
  11. p0deje commented on Sep 30, 2025

    @p0deje
    Member

    Added in #258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions