1. 19 10月, 2019 7 次提交
    • M
      Update rails server terminal output in Guides [ci skip] · 40372c59
      mikong 提交于
      40372c59
    • K
      Merge pull request #37508 from... · 23d89fce
      Kasper Timm Hansen 提交于
      Merge pull request #37508 from rmacklin/enforce-that-activestorage-compiled-bundle-is-in-sync-with-source-code
      
      Enforce that activestorage compiled JS is in sync with source code
      23d89fce
    • R
      Enforce that activestorage compiled JS is in sync with source code · 6b6e10d0
      Richard Macklin 提交于
      (Note: this is effectively the same change that we did for actioncable
      in fefc3041 applied to activestorage.)
      
      We have run into issues in the past where the activestorage compiled
      javascript bundle got out of sync with the source code. For example, in
      880f9779 the compiled bundle was
      modified in a way that was inconsistent with the results of running
      `yarn build` in the activestorage directory. This meant that running
      `yarn build` there would produce a dirty git status indicating changes
      to the compiled bundle, despite not having made any changes to the
      activestorage javascript source code. That particular inconsistency was
      fixed in 0e77706d. However, the same
      problem could reoccur.
      
      To address this, I've added a new test to enforce that activestorage's
      compiled javascript bundle is in sync with the source code. When the
      compiled bundle is in sync with the source code, the test will pass.
      However, if the two are not in sync, the test will fail. For example, if
      you were to apply the following patch (which only updates the source
      code):
      
      ```
      diff --git a/activestorage/app/javascript/activestorage/index.js b/activestorage/app/javascript/activestorage/index.js
      index a340008fb9..a05b7223a5 100644
      --- a/activestorage/app/javascript/activestorage/index.js
      +++ b/activestorage/app/javascript/activestorage/index.js
      @@ -8,4 +8,4 @@ function autostart() {
         }
       }
      
      -setTimeout(autostart, 1)
      +setTimeout(autostart, 2)
      ```
      the test would then fail. Thus, the activestorage test suite will now
      prevent "the compiled bundle is out of sync" issues going forward.
      6b6e10d0
    • K
    • R
      Enforce that actioncable compiled JS bundle is in sync with source code · fefc3041
      Richard Macklin 提交于
      We have run into issues in the past where the actioncable compiled
      javascript bundle got out of sync with the source code. For example, in
      30a0c7e0 only the compiled bundle was
      modified. This meant that anyone who ran `yarn build` in the actioncable
      directory would then see a dirty git status indicating changes to the
      compiled bundle, despite not having made any changes to the actioncable
      javascript source code. We fixed that particular inconsistency in
      a4c27588. However, the same problem
      could reoccur.
      
      To address this, I've added a new test to enforce that actioncable's
      compiled javascript bundle is in sync with the source code. When the
      compiled bundle is in sync with the source code, the test will pass:
      
          $ bundle exec ruby -Itest test/javascript_package_test.rb
          Run options: --seed 19308
      
          # Running:
      
          yarn run v1.12.3
          $ yarn lint && bundle exec rake assets:codegen
          $ eslint app/javascript
          $ rollup --config rollup.config.js
      
          app/javascript/action_cable/index.js → app/assets/javascripts/action_cable.js...
          created app/assets/javascripts/action_cable.js in 762ms
            Done in 6.35s.
          .
      
          Finished in 7.130345s, 0.1402 runs/s, 0.1402 assertions/s.
          1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
      
      However, if the two are not in sync, the test will fail. For example, if
      you were to apply the following patch (which only updates the source
      code):
      
      ```
      diff --git a/actioncable/app/javascript/action_cable/adapters.js b/actioncable/app/javascript/action_cable/adapters.js
      index 4de8131438..d38d9a6a0b 100644
      --- a/actioncable/app/javascript/action_cable/adapters.js
      +++ b/actioncable/app/javascript/action_cable/adapters.js
      @@ -1,4 +1,5 @@
       export default {
      +  foo: self.foo,
         logger: self.console,
         WebSocket: self.WebSocket
       }
      ```
      
      the test would then fail like this:
      
          $ bundle exec ruby -Itest test/javascript_package_test.rb
          Run options: --seed 26377
      
          # Running:
      
          yarn run v1.12.3
          $ yarn lint && bundle exec rake assets:codegen
          $ eslint app/javascript
          $ rollup --config rollup.config.js
      
          app/javascript/action_cable/index.js → app/assets/javascripts/action_cable.js...
          created app/assets/javascripts/action_cable.js in 776ms
            Done in 5.55s.
          F
      
          Failure:
          JavascriptPackageTest#test_compiled_code_is_in_sync_with_source_code [test/javascript_package_test.rb:16]:
          --- expected
          +++ actual
          @@ -3,6 +3,7 @@
           })(this, function(exports) {
             \"use strict\";
             var adapters = {
          +    foo: self.foo,
               logger: self.console,
               WebSocket: self.WebSocket
             };
      
          rails test test/javascript_package_test.rb:9
      
          Finished in 5.837403s, 0.1713 runs/s, 0.1713 assertions/s.
          1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
      
      Thus, the actioncable test suite will now prevent "the compiled bundle
      is out of sync" issues going forward.
      fefc3041
    • K
      37e87fd3
    • C
      Fix Messages::Metadata#fresh? to handle parse_json_times = true · 6e0aa188
      Christian Gregg 提交于
      When `ActiveSupport.parse_json_times` is `true`,
      `ActiveSupport::Messages::Medata.verify` will fail with a `TypeError` as
      it does not pass a `String` to `Time.iso8601` as is expected.
      
      This leads to hard-failure on retrieval of signed cookies with expiries.
      6e0aa188
  2. 18 10月, 2019 6 次提交
  3. 17 10月, 2019 10 次提交
  4. 16 10月, 2019 8 次提交
  5. 15 10月, 2019 9 次提交