[RUN ALL RSPEC] [RUN AS-IF-FOSS] Pseudonymization of URLs - Frontend
What does this MR do?
Related to #338320 (closed) & related to Epic &6551 (closed) (with detailed discussion).
Snowplow events from the browser include the current page URL and referrer. This MR implements the replacement of identifiable data in these (group name, username, project name) with anonymized strings:
- https://gitlab.com/my-group/my-awesome-project/-/merge_requests/3/edit
+ https://gitlab.com/namespace:4/project:2/-/merge_requests/3/edit
Example payload (see url
, refr
)
{
"schema":"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
"data":[
{
"e":"pp",
"url":"https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68618",
"page":"Draft: \"Pseudonymization of URLs - Frontend\" · Merge requests · GitLab.org / GitLab · GitLab",
"refr":"https://gitlab.com/gitlab-org/gitlab/-/issues/338320",
"pp_mix":"0",
"pp_max":"0",
"pp_miy":"0",
"pp_may":"0",
"tv":"js-2.17.3",
"tna":"gl",
"aid":"gitlab",
"p":"web",
"tz":"America/Santiago",
"lang":"en-US",
"cs":"UTF-8",
"f_pdf":"1",
"f_qt":"0",
"f_realp":"0",
"f_wma":"0",
"f_dir":"0",
"f_fla":"0",
"f_java":"0",
"f_gears":"0",
"f_ag":"0",
"res":"...",
"cd":"30",
"cookie":"1",
"eid":"...",
"dtm":"1629780452177",
"cx":"...",
"vp":"...",
"ds":"...",
"vid":"1072",
"sid":"...",
"duid":"...",
"stm":"1629780452181"
}
]
}
Screencast
Pseudonymized URLs and referrer log while browsing through the site
How to setup and validate locally
- Follow the instructions in our docs to enable Snowplow locally, if you haven't done so.
- Turn on the
mask_page_urls
feature flag. - Browse through the site and trigger any Snowplow event (regular page views (entering the page) and page pings (regular activity in the page) are supported as well). For example, you can go to
http://127.0.0.1:3000/gitlab-org/gitlab-test/-/merge_requests
and browse the MRs from there. - Verify the Snowplow testing tool of your choice, no instance of
gitlab-org
(group/namespace) orgitlab-test
(project) should be found.
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.