studio-engine 0.69.2 → 0.69.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44c016968027b022962e8b79363c104b263e3ab48b8b0d8553bb502d3dfdc42a
4
- data.tar.gz: 5c06f265e369ac196c5a2a6ba23c93e060661cdb3cc7d5c4d5416e9c105f655f
3
+ metadata.gz: 5ade07348f1d55403ac332ea2a030b8af81ff8b9b8d4a49b637326eb40168847
4
+ data.tar.gz: e5ee5053749871945628e8f522fffee01569e0ae3052016b9388c79b98be59d4
5
5
  SHA512:
6
- metadata.gz: 2dec7eba2710e3fc6cfc17c10df0b93f9f028d15953491e15997c14ccbcaebf2c5b03e09c6e729904a087ad16262940316390c537a4314d5f3d1c449d8032e79
7
- data.tar.gz: 822ea41413bea1441fa4bbf76ae941653520dff81c690918568ee61de96e820fbbcec8bc860b5dc179f0fa4ef57c683d9905723bf8f7432cc2061eb40eab2fce
6
+ metadata.gz: baf91b4f29446f4cc53ef15890ba67e9691046c769af46ac3beec04f9ad530ad3f67ee9d4d686d85d37ed3b0f7e78c1e453eec0476e4146eaa97bbd8fdf4fd68
7
+ data.tar.gz: 5ae6368f5e8c1ba95081f8608acc3193e3b82436e42e6a2cef059a6e979fb1b025da56058f980bc544f7d0add642d2972d7aefcc5b37c1fda22ca65c71c269cf
data/lib/studio/s3.rb CHANGED
@@ -1,3 +1,9 @@
1
+ # The QA signal lives in EnvironmentBanner (pure Ruby, unit-tested). Required
2
+ # EXPLICITLY rather than leaned on: s3.rb is loadable on its own — the unit suite
3
+ # requires it directly without lib/studio.rb — so an implicit dependency here
4
+ # resolves in the app and raises NoMethodError in a test.
5
+ require_relative "environment_banner"
6
+
1
7
  module Studio
2
8
  module S3
3
9
  class Error < StandardError; end
@@ -100,7 +106,23 @@ module Studio
100
106
 
101
107
  private
102
108
 
109
+ # WHICH BUCKET HALF THIS APP OWNS. Rails.env alone cannot answer it: no QA app
110
+ # sets RAILS_ENV, so every QA app boots as `production` exactly like real
111
+ # production. QA_ENV is the signal that separates them, and it is the one
112
+ # config/storage.yml (Active Storage), Studio::EnvironmentBanner and
113
+ # turf-monster's AppFlags already read — so consulting it here makes BOTH S3
114
+ # writers agree instead of resolving different buckets from the same process.
115
+ #
116
+ # Before this, a QA app holding the DEV key was handed the PRODUCTION bucket:
117
+ # every write took an IAM AccessDenied (uncaught — the knowledge_docs
118
+ # controller rescues only NotConfigured/MissingTable), and a LIST returned
119
+ # production's confidential objects to a review environment.
120
+ #
121
+ # `Studio.qa_environment?` delegates to EnvironmentBanner.truthy?, so
122
+ # `QA_ENV=false` correctly reads as production rather than as mere presence.
103
123
  def environment
124
+ return "dev" if EnvironmentBanner.qa_environment?
125
+
104
126
  defined?(Rails) && Rails.env.production? ? "production" : "dev"
105
127
  end
106
128
  end
@@ -1,3 +1,3 @@
1
1
  module Studio
2
- VERSION = "0.69.2"
2
+ VERSION = "0.69.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: studio-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.69.2
4
+ version: 0.69.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McRitchie