-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Add Active Storage to Rails #30020
Merged
Merged
Add Active Storage to Rails #30020
Changes from 250 commits
Commits
Show all changes
396 commits
Select commit
Hold shift + click to select a range
03120ec
Disk storage: ensure URLs end with the blob filename since some user …
jeremy 839834e
Merge pull request #22 from jeremy/disk-filename-url
dhh 8f125d5
Merge pull request #21 from jeremy/disk-binary-io
dhh 6116313
Mirror: explicit primary service and list of mirrors
jeremy e550339
Configure services that reference other services
jeremy f7f864c
Travis CI 💡
jeremy 1a17cfb
Service: clarify Service.build arguments
jeremy 4d292fc
Clarify how a service can build other composed services
jeremy f1489c2
Match new configurator needs
dhh 41afdb6
Merge pull request #26 from jeremy/service-configurator
dhh 01109dc
Use class methods scope now that we have multiple
dhh 8561d67
Symbolize all keys inside configuration nested hash
dixpac a1a0680
Ensure binary encoding for downloading
dhh d361bef
Example of keyfile specification
dhh 57fd9d2
Merge pull request #27 from dixpac/fix_configuration_keys_symbolization
dhh 4bfe7af
Instrument and log the services
dhh 5bb3f63
Test URL generation for S3 and Disk
dhh 7593b77
Proper logging is now in place
dhh b1cf901
Copypasta comments
dhh a19d943
Direct uploads for S3
dhh f2f5c79
Accept sgids for existing blobs created via direct upload as an attac…
dhh 18720bc
Add basic tests to the Configurator#build (#28)
dixpac bb2d7fc
Tests: Dir.mktmpdir neatly wraps up tmpdir + join
jeremy 4994e1a
Configurator tests: work against test-local config
jeremy 9cf3347
Scope aws-skd to version 2 (#34)
dixpac f66a690
Expose chunked downloads
georgeclaghorn 53d5384
Depend on Rails > 5.1
georgeclaghorn f28f4e9
Revert "Depend on Rails > 5.1"
georgeclaghorn 1966c18
Very incomplete first stab
dhh 6d39624
S3: slim down service implementation (#40)
jeremy 17906fd
Revert "S3: slim down service implementation (#40)" (#41)
dhh afb7047
Update GCSService#url
quartzmo c55af14
Merge pull request #42 from quartzmo/gcs-site-url
georgeclaghorn 2a738b3
Remove few ivars from gcs_service implementation
dixpac 50bec56
Merge pull request #43 from dixpac/small_gcs_service_refactoring
georgeclaghorn 14e6386
Fix regular expression on s3 test URL generation test (#44)
dixpac 6dcdc5c
Added rubocop / codeclimate config and fixed current offenses (#45)
cristianbica c49c56b
Revert back to the original implementaion with varaibles
dixpac 52cfe86
Merge pull request #51 from dixpac/restore_intermediate_variables
georgeclaghorn 62e5562
Don't fail on boot because of missing S3 keys when S3 is not used
ed977c3
Fail early if no storage service is specified
c178de5
Merge pull request #53 from colorfulfool/error-messages
georgeclaghorn a6df451
Depend on Rails >= 5.2.0.alpha
georgeclaghorn 315bd5c
Fixing logger to work with Rails 5.2.0.alpha
SGospodinov 2dba88c
Merge pull request #55 from SGospodinov/logger-for-5.2.0
georgeclaghorn a4e0e16
Put conditional back
georgeclaghorn 4dd44bc
Allow custom endpoints for S3.
seanhandley 147b409
Merge pull request #48 from seanhandley/hosted_s3
georgeclaghorn 6074771
Swap branches
georgeclaghorn 993283a
Fix a typo in S3Service
2cd1b88
Merge pull request #56 from colorfulfool/fix-s3-service
georgeclaghorn 2f15938
Fix S3 direct upload test
georgeclaghorn 94a450a
Splat options
georgeclaghorn be526d1
Add direct upload support to GCS service
michaelherold bb7b834
Remove unused require
georgeclaghorn c8ad7dc
Replace hard-coded S3 bucket name with configured bucket
jtperreault d0d4e33
Use descriptive new freeze_time helper
georgeclaghorn 32331b1
Accept S3 upload options (e.g. server_side_encryption)
baerjam c2a61cc
Merge branch 'master' into variants
dhh 710957b
Double confetti
dhh 66d94ed
Easier access to the variant of a blob
dhh 5dbe5ea
Follow AR like naming of factory method
dhh 76395e3
Do real transformations in a safe way
dhh f1523ab
Use a unique blob variant key for storage
dhh dda0130
Use the direct accessor
dhh 1a9026b
Extract routes.rb to engine location for auto configuration
dhh 1c85eec
Move controllers to default engine location for auto loading
dhh 6c2cef2
Fix-up variants controller
dhh af99968
Make processing an explicit step
dhh a968e3c
Consistent naming
dhh beb60b9
True is the same as no arguments
dhh 986a71d
Add instruction to install the gem from the master (#65)
dixpac cbe8931
Better naming
dhh 438d5cc
Accept that this is a full-Rails engine
dhh 9ac31a3
Mount routes on the engine
dhh 0c47740
Hacky way to mount routes for engine controller tests
dhh 7f41111
Extract variation value object
dhh c695263
Precise naming
dhh 67606dc
Over-indented
dhh 796f833
Fix and test VariantsController
dhh dd3eced
Proper require
dhh c231a73
Provide directed URL as well as resolving
dhh 39f9ef1
Actually we just want them mounted straight
dhh b6fd579
Fix parens after inline block
dhh 08d84e2
Extract test helper for image blob fixtures
dhh fa33ec9
Anemic intro
dhh e9cf92c
Test actual transformations
dhh f3b092a
Test actual transformation via controller too
dhh 2e9ff80
Quick example of variants
dhh 15cfac1
Merge branch 'master' into variants
dhh 6ac4fec
Mention need for mini_magick with variants
dhh f0d7ce9
Merge pull request #63 from rails/variants
dhh b44b0f2
Fix RuboCop offenses and warnings
koic d040749
Move all controller tests to controller/ dir
dixpac 3acf65f
Merge pull request #67 from dixpac/move_controller_tests
dhh 5fcaa19
Assume Rails is defined
dixpac 470ba69
Don't need to validate transformations actually
dhh d0a9174
Move storage_services.yml to config for consistency
dhh 5b7c31c
Unused, we can extract from it out-of-repo
dhh d50679f
Move models and jobs to the app setup
dhh e5f8872
Move model tests to models directory
dhh ca0b96d
Fix extension to run test automatically
dhh e0b89fa
No need for explicit requires any more
dhh da12346
Nix more needless requires
dhh 5ada431
Even more needless requires
dhh 9e81741
Disk controller must rely on key alone
dhh 8f20624
Switch to a single message verifier
dhh 46da4ee
Switch to simpler signed_id for blob rather than full GlobalID
dhh c285c68
Provide a BlobsController for stable blob URLs
dhh 347dc16
VerifiedKeyWithExpiration no longer needed
dhh 5889560
Update the README with more explicit expectation setting
dhh 4efbeae
Use parsed_body to auto parse the response as JSON.
kaspth 5963766
Explore regular polymorphic associations rather than record_gid
dhh 212f925
Collapse indeces per Jeremy.
kaspth a4f36f9
Fix attaching with standard Rails associations.
kaspth 15efa67
Specify verification purposes
dhh df69899
Merge branch 'master' of github.com:rails/activestorage
dhh 229394b
Merge branch 'master' into explore-polymorphism
dhh ac26aef
Require mini_magick when it's used
georgeclaghorn e16739d
Work-around until @response.parsed_body problem is solved
dhh eb9b019
Return to same level of abstraction
dhh 91d6c6e
Return to same level of abstraction
dhh c977eef
Work-around until @response.parsed_body problem is solved
dhh f96abd1
Merge branch 'master' into explore-polymorphism
dhh 68b5d27
Add and test preloading scope
dhh e16d0c9
No more GlobalID
dhh 2bbfaf0
Demonstrate preloading in example
dhh 54b17a1
Merge pull request #32 from rails/explore-polymorphism
dhh efa8779
Fix attaching
dhh f6ba62b
Schema out of date and now obvious
dhh cb2f7d4
Still need GlobalID for PurgeJob serialization
dhh 5944850
Tell service which content-type to use for the response
dhh 0906893
Don't annotate template class with :nodoc:
georgeclaghorn 2afe2a1
Temporarily skip variant tests pending a fix
georgeclaghorn d982aee
Skip controller test, too
georgeclaghorn d8aec0f
Refer to the yielded app
dhh b203288
Merge branch 'master' of github.com:rails/activestorage
dhh 69922fc
Everything under app/ is eager loaded, don't want that for service
dhh d0e90b4
Blob/Variant#url -> #service_url to emphasize this URL isn't to be pu…
dhh 52eed68
Verify direct upload checksums
georgeclaghorn 48d0427
Basic documentation for all the models
dhh d4f014b
Start on docs for lib
dhh 6de1c0b
Merge branch 'master' of github.com:rails/activestorage
dhh bb34580
Finish basic documentation for controllers
dhh 547737b
Basic documentation for job
dhh ef92cb0
Follow the same copyright format as the other Rails frameworks
dhh 0e9eb11
Add standard version setup
dhh 20effee
Models are autoloaded per engine standards
dhh 3eb8c89
Fix blob associations
dhh 87cb006
Trivial typo fix
92536c0
Document the rest of lib
dhh 3a5372d
Flesh out the README a bit more
dhh 6dd82b8
Did that
dhh 1907f46
Deep merge
georgeclaghorn 5492c4e
Add direct upload support to the disk service
georgeclaghorn 6ec6d22
Compare images by selected attributes (size, colorspace)
colorfulfool 0605ed9
Avoid creating unnecessary blobs
georgeclaghorn 7644a58
Check variant image properties directly
georgeclaghorn c68bdcd
Fix test failure in CI due to platform differences
georgeclaghorn 293db49
Fix broken links in README
e64e3f1
Introduce the Dummy. (#70)
dixpac a9091ea
Validate Content-Length
georgeclaghorn 64bbcaf
Use blob service URL methods
georgeclaghorn dc235c4
Separate show and direct upload tests
georgeclaghorn 6262891
Add JavaScript direct upload support (#81)
javan a0a23e9
Add JavaScript linting (#82)
javan b0b072f
Minor constructor signature tweaks
javan fd43876
Add npm package details
javan 696b8c6
Add a direct_upload: true option to file_field_tag and Form#file_field
dhh 801b4eb
Add Blob#type as a StringInquirer
dhh 1f150e0
Must always return the options even if they werent converted
dhh a91bb13
Convert type inquiry into root predicates for base types alone instead
dhh 39bfc83
Configure per-service request headers for direct uploads (#83)
javan 9da2c41
activestorage.js 0.1.1
javan 6c68524
Depend on Ruby >=2.2.2 (#85)
dixpac 3f4a721
Azure Storage support (#36)
dixpac 9330d01
Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce3…
rafaelfranca 4687c86
Include default storage configuration
dhh 4b5e042
Use standard Rails layout for gemspec
dhh 253757d
Initialize changelog
dhh 16d0024
Bring activestorage dependencies into the general Gemfile
dhh 17b2137
Require activestorage per default with asset pipeline
dhh 9e50295
No longer used
dhh 54663f5
Resolve gemspec typo
dhh 90a8e06
Use config/storage.yml as part of the skeleton and loading
dhh d24e72d
Load activestorage by default
dhh a1a363a
Follow form from actioncable
dhh 9d12683
Fix gitignore to be relative
dhh e814042
Create the skeleton directories needed and ignore accordingly
dhh bb69b3e
Directory and config installation now done by app_generator
dhh 5beb87c
Move to new storage.yml location
dhh ba12811
Move the direct_upload: true convenience option from the activestorag…
dhh a9cb196
Setup travis to be able to run CI tests against S3
dhh 8b20789
Let ActiveStorage tests pass only for Disk
claudiob 98bb99e
Don't depend on HTTParty
claudiob 7f54123
Merge pull request #30032 from claudiob/remove-httparty
guilleiguaran d66fade
Merge pull request #30030 from claudiob/only-disk
guilleiguaran 55e6104
Add Azure configuration to Active Storage template
211b397
Merge pull request #30034 from ffmike/patch-1
guilleiguaran e98eceb
Rely on top-level files
dhh 087e1e3
We moved to storage.yml
dhh 7ddec68
Add require
dhh c622e53
Drop README terms no longer relevant
dhh b807b5b
Cut down on installation advice
dhh 1ea49d6
Follow same format as action_cable
dhh 3e72354
Add the storage.yml file by default
dhh 3d3ec20
Prevent interpolation of ERB elements
dhh e473946
Merge branch 'master' into active-storage-import
dhh 13882d0
Remove circular dependency
dhh 4f8be04
Fix dummy app for inclusion in Rails
dhh ff3dad0
Skip if credentials aren't provided
dhh f927de6
Add Azure to readme
ytbryan 2a8fa2e
Merge pull request #30035 from ytbryan/patch-1
kamipo b334ac8
Add Azure to the available services list
4c3c418
Merge pull request #30040 from rbarysas/active-storage-import
kamipo c697422
Merge branch 'master' into active-storage-import
dhh 815d1ab
Fix `Style/StringLiterals` violations for Active Storage
kamipo 5aeac57
Merge pull request #30046 from kamipo/fix_string_literals_violations_…
rafaelfranca 8aa742f
Add Azure gems to README
0f2d3fb
Update README.md
d4f0b10
Use release azure-core gem
c5ae4e5
Tweak requires
053e556
Depend on offical azure-core
dixpac 9394451
Merge pull request #30053 from ffmike/patch-2
schneems 624b6c2
Can't initialize a message verifier without a key base
dhh 6b40fed
Generating the app is where the exception is now raised
dhh 9d636c9
Make Rubocop happier about ActiveStorage
claudiob da44e85
There is no reason to single line methods here
rafaelfranca 425aaab
Active Storage loads AR earlier to extend it so require env later
dhh a56b2a5
Including new default classes in loading test
dhh d84a126
Same issue from AR getting loaded earlier
dhh 422ec4c
Make sure Action View doesn't break with Active Storage
rafaelfranca f1648f6
Refactor convert_direct_upload_option_to_url
rafaelfranca 7a5a84b
Remove duplicated convert_direct_upload_option_to_url
rafaelfranca 5b49e22
Active Storage routes are now part of the default routes
dhh 6a36b6b
Merge branch 'active-storage-import' of github.com:rails/rails into a…
dhh f601a01
Do not eager load ActiveRecord::Base
rafaelfranca 5bfff1d
We need to require the top file before individual one
rafaelfranca 66e5bf9
Merge pull request #30061 from claudiob/ast-rubocop
rafaelfranca b76f4e4
Fix all rubocop violations
rafaelfranca 762c7da
Merge pull request #30041 from dixpac/change_azure_core_dependecy
rafaelfranca 77be872
Do not change the entire codebase style only because of active_storage
rafaelfranca 31f6100
Deterministic comparisons please
dhh 2194c27
Convert to strings so array can be sorted deterministically
dhh 787fe90
Include active_storage in all generated application.rb files
dhh 7103771
Do not call isolate_namespace on the application
rafaelfranca 62d3d12
Make sure the test fails if the code chages
rafaelfranca 12d944f
Add Active Storage to README and release (#30065)
claudiob b9f0eb2
Fix tests for AWS buckets that include a . (#30059)
claudiob 3179f08
Rename Azure to AzureStorage (#30057)
dixpac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"presets": [ | ||
["env", { "modules": false } ] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
engines: | ||
rubocop: | ||
enabled: true | ||
|
||
ratings: | ||
paths: | ||
- "**.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"extends": "eslint:recommended", | ||
"rules": { | ||
"semi": ["error", "never"], | ||
"quotes": ["error", "double"], | ||
"no-unused-vars": ["error", { "vars": "all", "args": "none" }] | ||
}, | ||
"plugins": [ | ||
"import" | ||
], | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.byebug_history | ||
node_modules | ||
test/dummy/db/*.sqlite3 | ||
test/dummy/db/*.sqlite3-journal | ||
test/dummy/log/*.log | ||
test/dummy/tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* Added to Rails. | ||
|
||
*DHH* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2017 David Heinemeier Hansson, Basecamp | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This file needs to require
"active_support/core_ext/hash/compact"
now.