-
Notifications
You must be signed in to change notification settings - Fork 448
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
288 support wicked pdf #358
288 support wicked pdf #358
Conversation
@johannesengl thanks for the PR! I've marked it as ready for review. Would you be willing to resolve the merge conflicts? |
5c9b81b
to
1e72c73
Compare
- Defaults to true - This boolean will be used to determine whether to prepend the render monkey patch or not.
1e72c73
to
06fffc7
Compare
@joelhawksley Sure no problem. I just resolved the conflicts. When should I open a PR in draft mode and when should it be set to ready for review? The current PR introduces two new tests that are failing and I opened the PR so we could discuss how to solve this issue: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Might you add some README updates, including your name on the contributor list, along with a CHANGELOG entry?
When should I open a PR in draft mode and when should it be set to ready for review?
Once want the code reviewed 😄. I moved this to ready to review as I felt it was directionally correct ❤️
Disclaimer: This is totally not a big deal and I'm happy to stick with Joel's preference for this project. IMHO, the draft PR state indicates "not ready for merge" (which GitHub helpfully enforces!) but doesn't make a claim about whether it can/should be reviewed; since it's possible to explicitly request a review on a draft PR, that action is the indication that you'd like a review on the PR as it currently stands. With that interpretation, I consider clicking the "Ready for review" button to mean "Ready for review and potentially ready for merge". (All that button really does is take it out of the draft state, which allows the PR to be merged once the other required conditions (status checks/required reviews/no merge conflicts) are met.) There are times when I'll mark a PR as a draft even if CI has passed, it's been reviewed and approved, and I don't plan on making any further changes to the PR. I do that when I want to prevent it from being merged until something else is done - for example, the PR might not be truly shippable until another system/database/etc. has been updated. |
- Set default to true - Group with oter mattr_accessor - Add documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Can you add an entry to CHANGELOG and update the README to include your info?
Run test suit for RAILS_ENV=test_render_monkey_patch_enabled and test_render_monkey_patch_disabled. That way we are initializing the dummy app once with render_monkey_patch_enabled set to true and once set to false.
@joelhawksley Sure. Just updated the CHANGELOG and README: 685d402 |
I would love to discuss a bit more in detail how we would like to setup a second dummy app in our test suit. Do we want to have only one process running our test suite and then in the test_helper initialize two dummy apps? This approach fails at the point of initializing the second rails application. When executing Another option would be to invoke two rake tasks and have two folders for reach app including test files. I tried this approach and pushed it to this branch: The issue here is that we also have unexpected behavior when running tests and passing a specific path to a test file. Furthermore, the second run will override the first test coverage reports. Also happy to jump on a call to discuss this further. |
SimpleCov declares support for merging of coverage across test suites. Have we tried this setup: |
@johannesengl this is a tricky one! I paired with my colleague @seejohnrun on this, and he recommended that we look into using the Perhaps you could look into going that route? Let me know what you think. Just a note: I'm going to be away from my computer for the next week, so I'll plan to catch up on this PR on or around June 29th 😄 |
Executing simplecov in the rake task led to incorrect test coverage
@joelhawksley Welcome back. I hope you had a nice break :) Lets maybe align on what we want to archive and also rethink different options. Option always include render_component Option several rake tasks
Option Booting up new rails app based on abstract_unit.rb used in rails testing I was able to run the following test case in isolation successfully. When running the entire test suit other tests however failed.
I would love to maybe pair with someone on this to move this PR forward. |
I would support always providing |
I'm wary of going this route. I care a lot about the APIs we provide by default, and I'd much prefer that we use the Rails render call stack in 6.1.
This looks directionally correct. Let's pair on getting this resolved ❤️ |
Running the test suite two times with different environments has the following issues: Generates simplecov reports Cant pass TEST parameter to test rake task since one task hardcodes test_files
# Conflicts: # CHANGELOG.md # README.md # coverage/coverage.txt # test/view_component/integration_test.rb
5f0bb18
to
83b9d03
Compare
After having paired on the Option of booting up new rails app based on abstract_unit.rb with @joelhawksley we decided not to further pursue this direction but rather always include |
@johannesengl thank you SO much for your work on this PR! I look forward to your next PR :) |
@joelhawksley It was my pleasure. I really enjoyed the collaboration with you. Thanks for making this a great first open-source experience! :) |
Summary
This PR aims to solve conflicts with other gems also monkey-patching the
ActionView
andActionController
render
method by giving users an option config to disable the monkey patch and instead of using therender
method in view component templates to use therender_component
helper.In < Rails 6.1 the method
render_component
gets included inActionView
and users can render view components in the following way:The method
render_component
andrender_component_to_string
also get included inActionController
Related Issue
#288