canvas-lms/gems
Cody Cutrer 6d14259077 add frozen_string_literal comment to engines and gems
Change-Id: Ifb661509145c16937c9f1c28803687b7cec4b3a4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261815
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-03-30 18:14:15 +00:00
..
activesupport-suspend_callbacks add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
acts_as_list add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
adheres_to_policy add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
attachment_fu add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
autoextend add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
bookmarked_collection add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
broadcast_policy add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_breach_mitigation add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_cache add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_cassandra add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_color add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_crummy add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_dynamodb add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_errors add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_ext add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_http add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_i18nliner fix specs for gems/canvas_i18nliner 2021-03-10 21:06:57 +00:00
canvas_kaltura add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_mimetype_fu add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_panda_pub add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_partman add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_quiz_statistics add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_sanitize add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_security add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_slug add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_sort add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_stringex add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_text_helper add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_time add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
canvas_unzip add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
config_file add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
csv_diff add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
diigo add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
dr_diff add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
dynamic_settings add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
event_stream add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
google_drive add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
html_text_helper add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
i18n_extraction add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
i18n_tasks add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
incoming_mail_processor add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
json_token add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
linked_in add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
live_events add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
lti-advantage add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
lti_outbound add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
multipart add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
paginated_collection add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
plugins add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
request_context add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
rubocop-canvas add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
stringify_ids add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
tatl_tael add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
turnitin_api add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
twitter add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
utf8_cleaner add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
workflow add frozen_string_literal comment to engines and gems 2021-03-30 18:14:15 +00:00
README.md extract ConfigFile to gem 2021-02-23 21:18:20 +00:00
test_all_gems.sh Alpine canvas-lms based image 2020-07-15 17:21:56 +00:00

README.md

Gems

This folder is a place to extract modular functionality from canvas. Canvas's Gemfile arrangement is enabled to read gems from this path locally without installing from a remote source. This is valuable for a few reasons:

  • it prevents circular dependencies (bundler won't allow it)
  • modularized code cannot bind to specific domain concepts on canvas models
  • gems can have their specs run independently, without needing to load all of canvas, saving iteration time
  • it allows for eventual build optimization via only running specs for the transitive closure of parents depending on a gem where a change is.
  • it gives ENGINES extracted from canvas (see the "engines" directory) a place to reference code shared with canvas without it being packaged into the canvas monolith directly.

There are some tradeoffs:

  • spreads canvas over more subdirectories, giving some mental overhad to traversing the entire codebase.
  • modular tests necessarily don't test integration with canvas concepts, so solid integration tests in the app are still a requirement.
  • total SERIALIZED build time goes up because each gem loads it's specs in a new process rather than all running within an already booted canvas process.

[TODO] eventually write more on whether we feel like those tradeoffs are good ones, and what the best practices are to leverage this pattern for max-gain/min-pain.

Testing

To test all the gems:

cd gems
./test_all_gems.sh

To test an individual gem

Run ./test.sh inside the gem's folder. This is basically the same as:

cd gems/google_drive
bundle
rspec