| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* If we want to transform image on ActiveStorage, we should bundle
`mini_magick`.
* I've added comment block to default `Gemfile` to be easier to install this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* WIP: Add credentials using a generic EncryptedConfiguration class
This is sketch code so far.
* Flesh out EncryptedConfiguration and test it
* Better name
* Add command and generator for credentials
* Use the Pathnames
* Extract EncryptedFile from EncryptedConfiguration and add serializers
* Test EncryptedFile
* Extract serializer validation
* Stress the point about losing comments
* Allow encrypted configuration to be read without parsing for display
* Use credentials by default and base them on the master key
* Derive secret_key_base in test/dev, source it from credentials in other envs
And document the usage.
* Document the new credentials setup
* Stop generating the secrets.yml file now that we have credentials
* Document what we should have instead
Still need to make it happen, tho.
* [ci skip] Keep wording to `key base`; prefer defaults.
Usually we say we change defaults, not "spec" out a release.
Can't use backticks in our sdoc generated documentation either.
* Abstract away OpenSSL; prefer MessageEncryptor.
* Spare needless new when raising.
* Encrypted file test shouldn't depend on subclass.
* [ci skip] Some woordings.
* Ditch serializer future coding.
* I said flip it. Flip it good.
* [ci skip] Move require_master_key to the real production.rb.
* Add require_master_key to abort the boot process.
In case the master key is required in a certain environment
we should inspect that the key is there and abort if it isn't.
* Print missing key message and exit immediately.
Spares us a lengthy backtrace and prevents further execution.
I've verified the behavior in a test app, but couldn't figure the
test out as loading the app just exits immediately with:
```
/Users/kasperhansen/Documents/code/rails/activesupport/lib/active_support/testing/isolation.rb:23:in `load': marshal data too short (ArgumentError)
from /Users/kasperhansen/Documents/code/rails/activesupport/lib/active_support/testing/isolation.rb:23:in `run'
from /Users/kasperhansen/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:830:in `run_one_method'
from /Users/kasperhansen/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest/parallel.rb:32:in `block (2 levels) in start'
```
It's likely we need to capture and prevent the exit somehow.
Kernel.stub(:exit) didn't work. Leaving it for tomorrow.
* Fix require_master_key config test.
Loading the app would trigger the `exit 1` per require_master_key's
semantics, which then aborted the test.
Fork and wait for the child process to finish, then inspect the
exit status.
Also check we aborted because of a missing master key, so something
else didn't just abort the boot.
Much <3 to @tenderlove for the tip.
* Support reading/writing configs via methods.
* Skip needless deep symbolizing.
* Remove save; test config reader elsewhere.
* Move secret_key_base check to when we're reading it.
Otherwise we'll abort too soon since we don't assign the secret_key_base
to secrets anymore.
* Add missing string literal comments; require unneeded yaml require.
* ya ya ya, rubocop.
* Add master_key/credentials after bundle.
Then we can reuse the existing message on `rails new bc4`.
It'll look like:
```
Using web-console 3.5.1 from https://github.com/rails/web-console.git (at master@ce985eb)
Using rails 5.2.0.alpha from source at `/Users/kasperhansen/Documents/code/rails`
Using sass-rails 5.0.6
Bundle complete! 16 Gemfile dependencies, 72 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Adding config/master.key to store the master encryption key: 97070158c44b4675b876373a6bc9d5a0
Save this in a password manager your team can access.
If you lose the key, no one, including you, can access anything encrypted with it.
create config/master.key
```
And that'll be executed even if `--skip-bundle` was passed.
* Ensure test app has secret_key_base.
* Assign secret_key_base to app or omit.
* Merge noise
* Split options for dynamic delegation into its own method and use deep symbols to make it work
* Update error to point to credentials instead
* Appease Rubocop
* Validate secret_key_base when reading it.
Instead of relying on the validation in key_generator move that into
secret_key_base itself.
* Fix generator and secrets test.
Manually add config.read_encrypted_secrets since it's not there by default
anymore.
Move mentions of config/secrets.yml to config/credentials.yml.enc.
* Remove files I have no idea how they got here.
* [ci skip] swap secrets for credentials.
* [ci skip] And now, changelogs are coming.
|
| |
|
|
|
|
|
| |
Add SharedGeneratorTests#application_path
This method will help to DRY in files app_generator_test.rb, plugin_generator_test.rb
|
|
|
|
|
|
| |
Add missing backticks
Add missing *
Add missing .
|
| |
|
|\
| |
| |
| | |
Optimize indentation for generator actions
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | | |
yhirano55/skip_unused_components_when_running_rails_command_in_plugin
Skip unused components when running `bin/rails` in Rails plugin
|
| | | |
|
|\ \ \
| |_|/
|/| |
| | | |
Add git_source to Gemfile for plugin generator
|
| |/ |
|
|/ |
|
|\
| |
| | |
Deprecate support of older `config.ru`
|
| |
| |
| |
| |
| |
| |
| |
| | |
Since Rails 4.0, `config.ru` generated by default uses instances of
`Rails.application`. Therefore, I think that it is good to deprecate
the old behavior.
Related: #9669
|
|/
|
|
|
|
| |
Light grammar edits.
[ci skip]
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've used many development related performance tools, but the single most consistently helpful tool is `rack-mini-profiler`.
The tool provides a lightweight UI element for each page, that shows the server response time. When clicked it expands to show more detail:
![](https://www.dropbox.com/s/0aciw4mk8c059n0/Screenshot%202017-07-24%2010.24.24.png?dl=1)
This can be used to detect expensive queries, N+1 issues and general performance related problems.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in Rails 4.0, you could use `/dev/stdin` on both Linux and Mac, but with
the switch to Kernel.load in Rails 4.1, this broke on Linux (you get
a LoadError). Instead, explicitly detect `-` as meaning stdin, then
read from stdin explicitly, instead of performing file gymnastics. This
should now work on any platform uniformly.
Passing a script via stdin is useful when you're sshing to a server,
and the script you want to run is stored locally. You could theoretically
pass the entire script on the command line, but in reality you'll run
into problems with the command being too long.
|
|
|
|
|
|
| |
Bootsnap precomputes load path resolution and caches ruby ISeq
and YAML parsing/compilation, reducing application boot time by
approximately 50% on supported configurations.
|
|
|
|
|
|
|
|
|
| |
Running the `console` and `dbconsole` commands with a regular argument
as the environment's name automatically expand it to match an existing
environment (e.g. dev for development).
This feature wasn't available using the `--environment` (a.k.a `-e`)
option.
|
|
|
|
|
|
| |
People should rather rely on the `-e` or `--environment` options to
specify in which environment they want to work. This will allow us
to specify the connection to pick as a regular argument in the future.
|
|
|
|
|
|
|
|
|
|
|
| |
Since 0a4f6009, it's possible to specify a 3-level database
configuration to gather connections by environment.
The `dbconsole` command will try to look for a database configuration
which points to the current environment but with such flavour, the
environment key is flushed out so let's add the ability to specify
the connection and pick `primary` by default to be consistent with
Active Record.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, `app:update` generates all contents regardless of the
component using in application.
For example, even if not using Action Cable, `app:update` will generate
a contents related to Action Cable. This is a little inconvenient.
This PR checks the existence of the component and does not generate
unnecessary contents.
Can not check all options in this way. However, it will be able to
prevent the generation of unnecessary files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By making the Rails minitest behave like a standard minitest plugin
we're much more likely to not break when people use other minitest
plugins. Like minitest-focus and pride.
To do this, we need to behave like minitest: require files up front
and then perform the plugin behavior via the at_exit hook.
This also saves us a fair bit of wrangling with test file loading.
Finally, since the environment and warnings options have to be applied
as early as possible, and since minitest loads plugins at_exit, they
have to be moved to the test command.
* Don't expect the root method.
It's likely this worked because we eagerly loaded the Rails minitest plugin
and that somehow defined a root method on `Rails`.
* Assign a backtrace to failed exceptions.
Otherwise Minitest pukes when attempting to filter the backtrace (which
Rails' backtrace cleaner then removes).
Means the exception message test has to be revised too.
This is likely caused by the rails minitest plugin now being loaded for
these tests and assigning a default backtrace cleaner.
|
|
|
|
|
|
|
|
|
| |
Currently the environment file is not loaded in `dbconsole` command.
Therefore, for example, if use encrypted secrets values in database.yml,
`read_encrypted_secrets` will not be true, so the value can not be
used correctly.
Fixes #29717
|
|
|
|
|
|
|
|
|
|
|
| |
When secrets confirmed with the `secrets:edit` command, `secrets.yml.enc`
will change without updating the secrets.
Therefore, even if only want to check secrets, the difference will come
out. This is a little inconvenient.
In order to solve this problem, added the `secrets:show` command.
If just want to check secrets, no difference will occur use this command.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
If system test fails, it creates screenshot under `tmp/screenshots`.
https://github.com/rails/rails/blob/34fe2a4fc778d18b7fe6bdf3629c1481bee789b9/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L45
But currently, screenshot files is not cleared by `tmp:clear` task.
This patch make clears screenshot files with `tmp:clear` task as well
as other tmp files.
|
| |
|
|
|
|
|
|
|
|
|
| |
The `capify` command has been removed by Capistrano 3 and became to
`cap install`.
Therefore, the `capify!` method has no meaning in Capistrano 3.
I think that should deprecate.
Ref: https://github.com/capistrano/capistrano/commit/492793916acf32ffe1604daec6fd4892c8935018
|
|
|
|
| |
Fixes #28988
|
|
|
|
|
|
| |
* Remove trailing spaces.
* Add backticks around method and command.
* Fix indentation.
|
|
|
|
| |
environments
|
|
|
|
| |
The css selectors on the generated error pages are too broad (for example `text-align: center` on `body` and thus bleed out to the following pages (say, by pressing the back button) when using Turbolinks. This commit namespaces all the selectors.
|
|
|
|
|
|
| |
The `master` changelog refer back to the `5-1-stable` changelog as a
base. No need to duplicate backported entries in the changelogs on
`master`.
|
| |
|
|
|
|
|
|
| |
This is a follow up to a6d065e. When using `form_with` you must supply
field ids manually. Since the scaffold generator is using labels we
need to make sure that they are linked up properly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The entry for PR #25430 is currently present both in the CHANGELOG
for Rails 5.0 and for Rails 5.1:
https://github.com/rails/rails/blame/9d3a352777c2594123583b0bc02d0dd80f1e385b/railties/CHANGELOG.md#L61-L72
Since the PR was backported to 5-0-stable in #25499, I believe it
should be removed from the CHANGELOG of 5.1, otherwise it looks like
something changed from 5.0 to 5.1
|
|
|
|
|
|
| |
Occasionally we update the file generated by engine.
Therefore, I think that there is a task for updating as well as
application in the engine, it is convenient for updating.
|
|
|
|
| |
Was added in #25248 by @bluesh55
|
|
|
|
| |
[ci skip]
|
| |
|
|
|
|
|
|
|
|
|
|
| |
These tests may be expansive so let's only allow users to run them
through `bin/rails test:system` or by passing a path to the `test`
command.
The same applies for `bin/rake test`.
Refs #28109.
|
|
|
|
| |
Includes a script to ease an app's upgrade.
|
|
|
|
| |
Just dispatch to the command help itself for more info.
|
| |
|