Upgrade snowplow-tracker to ~> 0.8.0 for Ruby 3.0+ compatibility
The snowplow-tracker gem is used for event tracking across the app.
The current version of this gem, 0.6.1, has specs failing on our ruby3 branch, eg in the specs below. There are likely to be more, wherever we use Event Tracking:
- rspec spec/features/projects/new_project_spec.rb
- spec/features/groups/import_export/connect_instance_spec.rb
- spec/features/groups/import_export/import_file_spec.rb
- spec/features/groups/import_export/migration_history_spec.rb
the following error is raised:
1.2) Failure/Error: raise JSConsoleError, message
JSConsoleError:
Unexpected browser console output:
security - Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'interest-cohort'.
webpack-internal:///1WDD 550:21 "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled."
webpack-internal:///AjYE 18 Refused to connect to 'ws://gdk.test:3808/ws' because it violates the following Content Security Policy directive: "connect-src 'self' ws://localhost localhost https://cdn.cookielaw.org https://*.onetrust.com *.google-analytics.com *.analytics.google.com *.googletagmanager.com".
webpack-internal:///1WDD 560:22 "[webpack-dev-server]" Event
https://localhost/com.snowplowanalytics.snowplow/tp2 - Failed to load resource: net::ERR_CONNECTION_REFUSED
security - Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'interest-cohort'.
webpack-internal:///1WDD 550:21 "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled."
webpack-internal:///AjYE 18 Refused to connect to 'ws://gdk.test:3808/ws' because it violates the following Content Security Policy directive: "connect-src 'self' ws://localhost localhost".
The snowplow-tracker docs say ~> 0.8.0 is compatible with ruby 3.0+.
Upgrading to 0.8.0 resolves the security - Error with Permissions-Policy header error, however, at minimum:
- the
Gitlab::Tracking::Destinations::Snowplowclass requires fixing as method arguments when creating anemitterand atrackerhave changed. -
spec/support/helpers/stub_snowplow.rbneeds updating for the same reason. - the JS_CONSOLE_FILTER constant in
spec/support/capybara.rbneeds updating to filter out newly phrased error messages.
Edited by Carla Drago