Staging release: Rust widget renderer
This pull request introduces several improvements to the Rust widget renderer integration, environment configuration, and build/deployment processes. The main goals are to ensure robust handling of the Rust extension across environments, improve boolean serialization for widget rendering, and allow more flexible configuration of asset and session domains. Additionally, it updates CI/CD workflows and removes an obsolete test file.
Widget Renderer Integration Improvements
- Updated the Rust extension loader to require
lib/widget_rendererinstead of the previous path, ensuring the correct file is loaded after build and runtime compilation. (config/initializers/widget_renderer.rb) [1] [2] - Improved the Ruby wrapper for the Rust extension to handle stale or incorrect
WidgetRenderermodule definitions, ensuring Rutie initializes the class properly. (ext/widget_renderer/lib/widget_renderer.rb) [1] [2] - Enhanced the Rust-side deserialization to treat missing or null booleans as
false, preventing errors from legacy or incomplete Rails data. (ext/widget_renderer/src/form_data.rs) [1] [2] - Updated the Rails model to consistently serialize booleans and question text for the Rust widget renderer, and to skip Rust rendering in test environments. (
app/models/form.rb) [1] [2]
Build and Deployment Process Updates
- Improved the build artifact handling in the GitHub workflow and CircleCI config, ensuring the correct shared library is found and copied regardless of target or environment. (
.github/workflows/build-widget.yml,.circleci/config.yml,.cfignore,.profile.d/build_widget_renderer.sh,ext/widget_renderer/extconf.rb) [1] [2] [3] [4] [5] [6] [7]
Environment and Configuration Flexibility
- Added support for overriding asset host and session cookie domain via environment variables, improving deployment flexibility across staging and production. (
config/environments/staging.rb,config/initializers/session_store.rb,touchpoints-staging.yml) [1] [2] [3] [4]
Testing and CI/CD Adjustments
- Removed an obsolete controller export spec to clean up the test suite. (
spec/controllers/admin/cx_collections_controller_export_spec.rb) - Improved feature spec reliability by using more robust selectors and waits. (
spec/features/admin/forms/form_permissions_spec.rb)
These changes collectively improve the reliability, maintainability, and deployment flexibility of the widget renderer integration and overall application.
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.