Commit 35b2d51
authored
Fix Rust widget renderer modal button initialization (#1924)
* Production release: Fix CX Collections export CSV error (#1911)
* Add Cargo caching and library linkage verification to CircleCI
- Add restore/save cache for Cargo target and registry directories
- Use Cargo.lock checksum for cache key to ensure proper invalidation
- Verify Rust library linkage with ldd before deploy
- Fail fast if library has unresolved dependencies
- Should significantly speed up Rust builds on subsequent runs
* Fix cx_collections export_csv 500 error
- Handle nil organization in User#cx_collections to prevent NoMethodError
- Add eager loading for service_provider.organization and cx_collection_details
- Add missing database indexes on cx_collections, cx_collection_details, cx_responses
Fixes the 'We're sorry, but something went wrong' error at:
/admin/cx_collections/export_csv
* Update schema.rb with new indexes for CircleCI
* Update schema version to include new migration
* Add tests for User#cx_collections method
* fix: use git URL for rust buildpack in production manifest
* fix: correct redis service name in production manifest
* Release: WidgetRenderer load fix (#1914)
* Add Cargo caching and library linkage verification to CircleCI
- Add restore/save cache for Cargo target and registry directories
- Use Cargo.lock checksum for cache key to ensure proper invalidation
- Verify Rust library linkage with ldd before deploy
- Fail fast if library has unresolved dependencies
- Should significantly speed up Rust builds on subsequent runs
* Fix cx_collections export_csv 500 error
- Handle nil organization in User#cx_collections to prevent NoMethodError
- Add eager loading for service_provider.organization and cx_collection_details
- Add missing database indexes on cx_collections, cx_collection_details, cx_responses
Fixes the 'We're sorry, but something went wrong' error at:
/admin/cx_collections/export_csv
* Update schema.rb with new indexes for CircleCI
* Update schema version to include new migration
* Add tests for User#cx_collections method
* Fix widget renderer load when native lib missing (#1913)
* Fix User#cx_collections specs for Service owner (#1915) (#1917)
* Release: set prod disk quota to 2G (#1919)
* Add Cargo caching and library linkage verification to CircleCI
- Add restore/save cache for Cargo target and registry directories
- Use Cargo.lock checksum for cache key to ensure proper invalidation
- Verify Rust library linkage with ldd before deploy
- Fail fast if library has unresolved dependencies
- Should significantly speed up Rust builds on subsequent runs
* Fix cx_collections export_csv 500 error
- Handle nil organization in User#cx_collections to prevent NoMethodError
- Add eager loading for service_provider.organization and cx_collection_details
- Add missing database indexes on cx_collections, cx_collection_details, cx_responses
Fixes the 'We're sorry, but something went wrong' error at:
/admin/cx_collections/export_csv
* Update schema.rb with new indexes for CircleCI
* Update schema version to include new migration
* Add tests for User#cx_collections method
* Fix widget renderer load when native lib missing (#1913)
* Fix User#cx_collections specs for Service owner (#1915)
* Fix production manifest for rust buildpack (#1918)
* fix: remove empty secret keys from manifest to prevent wiping env vars on deploy
Empty values in the manifest were overwriting secrets set via cf set-env.
Secrets should only be managed via cf set-env, not in the manifest.
* fix: Use fba-usa-modal class for USWDS Modal compatibility
* fix: Add CSS support to Rust widget renderer to fix modal positioning
* fix: Use parent_id instead of parent in Organization factory
* Increase Cloud Foundry start timeout to 180s and fix Sidekiq health check type
* Fix Sidekiq crash and optimize Rust build script
- Added rust-buildpack to Sidekiq deployment
- Updated build_widget_renderer.sh to handle workspace paths and avoid rebuilds
- Added rust-buildpack to touchpoints-demo manifest
* build(cf): simplify widget_renderer build script and ignore rules
Refactors the `.profile.d/build_widget_renderer.sh` script to remove complex logic for locating Rust dependencies, building from source, and checking library linkage. The script now focuses solely on setting `LD_LIBRARY_PATH` and ensuring the prebuilt `libwidget_renderer.so` is in the correct location.
Additionally, updates `.cfignore` to exclude the `target/` directory and specific release artifacts, while ensuring the root `libwidget_renderer.so` is preserved. This suggests a shift towards deploying a precompiled binary rather than building the Rust extension during the Cloud Foundry deployment process.
* Increase deployment timeout and add widget_renderer fallback to resolve startup crashes
* fix(widget_renderer): restore LoadError and adjust app timeout
- Re-enable raising `LoadError` in `widget_renderer.rb` when the native library is missing, removing the previous fallback log message. This ensures the application fails fast if the required extension is absent.
- Reduce application timeout from 600 to 180 seconds in `touchpoints.yml` to better align with platform constraints or performance expectations.
- Remove the hardcoded `WEB_CONCURRENCY: 1` environment variable from `touchpoints.yml`, allowing the buildpack or platform defaults to manage concurrency.
* ci: increase deployment wait time and enable static files in dev
- Increase the `max_wait` time in `.circleci/deploy.sh` from 600 to 800 seconds to prevent timeouts during longer deployment processes.
- Update `config/environments/development.rb` to conditionally enable the public file server based on the `RAILS_SERVE_STATIC_FILES` environment variable, aligning development behavior with other environments when needed.
* ci(deploy): increase timeouts and enable static file serving
- Increase Cloud Foundry push timeout from 180s to 600s in deployment scripts and `touchpoints.yml` to prevent timeouts during startup.
- Enable `RAILS_SERVE_STATIC_FILES` in production configuration and manifest to allow the application to serve precompiled assets directly.
- Update `deploy.sh` to accept a manifest path argument and refactor retry logic for better error handling.
* Decouple db:migrate from deploy: migrations must be run separately to avoid CF 180s timeout
* Add automated pre-deploy migrations via cf run-task to avoid 180s timeout during app start
* Set health check type to process for sidekiq worker before rolling deploy
* Fix sidekiq worker timeout: explicitly set to 180s before rolling deploy
* Fix flaky logo upload test: add wait time to prevent Selenium stale element race condition
* Fix cf set-health-check: use --invocation-timeout instead of --timeout
* Fix Rack::Attack test: create actual form fixture to avoid 404 responses
* Scale sidekiq worker to 1 instance during rolling deploy to avoid org memory quota exceeded
* Stop sidekiq worker before push to free memory for staging (avoids org quota exceeded)
* Fix cf run-task syntax: add --command flag for migrations
* Skip WidgetRenderer load during migrations - library not built in task droplet
* Fix Rack::Attack test: add valid submission params to avoid 400 errors
* Temporarily disable pre-deploy migrations to unblock deployment
* Fix widget_renderer initializer - use simpler skip detection logic
* Fix deployment: restore db:migrate in manifest and enable migrations in deploy script
* Revert migrations to start command - Rust library not available in cf tasks
* Build Rust library at runtime in .profile.d script
* Revert to working widget_renderer script that copies prebuilt library
* Keep prebuilt Rust library during deployment to ensure correct linking with CF Ruby installation
* Fix deploy-sidekiq.sh: remove explicit buildpack flags to avoid re-installing Rust
- Remove -b flags from cf push in deploy-sidekiq.sh
- Let CF auto-detect buildpacks from app metadata like deploy.sh does
- Prevents unnecessary reinstallation of Rust during staging
- Matches web deployment behavior for consistency
* Fix touchpoints.yml: comment out buildpacks to prevent Rust reinstallation
- Comment out explicit buildpacks in manifest
- Let CF auto-detect buildpacks from app metadata
- Prevents re-running supply phase (Rust installation) during deployment
- Rust library already built in CircleCI via bundle install (gem extensions)
- Matches deploy-sidekiq.sh approach for consistency
* Fix flaky timing test in submission_digest mailer spec
Use a single time_threshold let variable to ensure consistent timestamp
comparison instead of calling days_ago.days.ago multiple times which can
result in 1-second differences in CI environments.
* Fix custom-button-modal USWDS initialization
- Add try/catch error handling
- Add conditional checks for fbaUswds methods
- Initialize custom button element for custom-button-modal
- Prevents modal from appearing visible at page bottom
* Bump Cargo version to force Rust rebuild
* Bump widget_renderer version to force Cargo rebuild
* Force cargo clean before build to ensure recompilation
* Bump widget_renderer gem version to 0.1.2 to force rebuild
* Force Rust rebuild with BUILD_ID and version bump
* Bump widget_renderer to 0.1.2 to force CF to rebuild native extension
* Update Gemfile.lock for widget_renderer 0.1.2
* Add Rust library verification before CF push
* Prioritize workspace-level Rust library and bump to 0.1.3
* Invalidate CircleCI cargo cache to force fresh Rust build
* Fix Rust widget renderer modal button initialization
The Rust widget renderer was missing the USWDS Modal initialization
for the #fba-button element used in 'modal' delivery method forms.
This caused the toast/feedback button to not open the modal when clicked,
instead rendering the form inline at the bottom of the page.
Added initialization for #fba-button to match the ERB template behavior
in _fba.js.erb (lines 858-875).
Fixes Zendesk ticket #37620
* Fix breaking changes from PR review
1. Fix modal_class prefix logic: Now respects load_css setting
- When load_css=true: uses 'fba-usa-modal' prefix
- When load_css=false: uses 'usa-modal' (no prefix)
- Matches ERB template behavior in _fba.js.erb line 110
2. Fix CSS backtick escaping: Added escape for backticks in CSS
- Prevents JavaScript syntax errors when CSS contains backticks
- CSS is inserted into JS template literals using backticks
3. Remove expired certificate file: tmp_expired_login_gov_cert.pem
- Certificate expired Aug 2023
- Added *.pem to .gitignore to prevent future accidental commits1 parent bbcb0ac commit 35b2d51
29 files changed
Lines changed: 412 additions & 232 deletions
File tree
- .circleci
- .profile.d
- app/models
- config
- environments
- initializers
- ext/widget_renderer
- lib
- src
- spec
- features/admin
- mailers
- models
- requests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 44 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
105 | 121 | | |
106 | 122 | | |
107 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
108 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
109 | 142 | | |
110 | 143 | | |
111 | 144 | | |
| |||
120 | 153 | | |
121 | 154 | | |
122 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
123 | 162 | | |
124 | 163 | | |
125 | 164 | | |
| |||
132 | 171 | | |
133 | 172 | | |
134 | 173 | | |
| 174 | + | |
| 175 | + | |
135 | 176 | | |
136 | 177 | | |
137 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
90 | 146 | | |
91 | 147 | | |
92 | 148 | | |
| 149 | + | |
| 150 | + | |
93 | 151 | | |
94 | 152 | | |
95 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
96 | 171 | | |
97 | 172 | | |
98 | 173 | | |
| |||
104 | 179 | | |
105 | 180 | | |
106 | 181 | | |
107 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
108 | 195 | | |
109 | 196 | | |
110 | 197 | | |
111 | 198 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
120 | 206 | | |
121 | 207 | | |
122 | 208 | | |
| |||
132 | 218 | | |
133 | 219 | | |
134 | 220 | | |
135 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
136 | 224 | | |
137 | 225 | | |
138 | 226 | | |
| |||
144 | 232 | | |
145 | 233 | | |
146 | 234 | | |
147 | | - | |
| 235 | + | |
148 | 236 | | |
149 | 237 | | |
150 | 238 | | |
| |||
156 | 244 | | |
157 | 245 | | |
158 | 246 | | |
159 | | - | |
| 247 | + | |
160 | 248 | | |
161 | 249 | | |
162 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
0 commit comments