diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-01 21:08:38 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-01 21:08:38 +0000 |
commit | f8975b16d11afde69e398a8c607a27e0c05b48f9 (patch) | |
tree | b55c272e69d7df57cd426a2e471b64c007980eff /app/experiments | |
parent | ed323a3c6fcc2927e217b72121875abd448c2785 (diff) | |
download | gitlab-ce-f8975b16d11afde69e398a8c607a27e0c05b48f9.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/experiments')
3 files changed, 15 insertions, 21 deletions
diff --git a/app/experiments/application_experiment.rb b/app/experiments/application_experiment.rb index c777fdc63a1..4ebf4a80498 100644 --- a/app/experiments/application_experiment.rb +++ b/app/experiments/application_experiment.rb @@ -32,17 +32,6 @@ class ApplicationExperiment < Gitlab::Experiment # rubocop:disable Gitlab/Namesp Experiment.add_subject(name, variant: variant || :control, subject: subject) end - def track(action, **event_args) - return unless should_track? # don't track events for excluded contexts - - # track the event, and mix in the experiment signature data - Gitlab::Tracking.event(name, action.to_s, **event_args.merge( - context: (event_args[:context] || []) << SnowplowTracker::SelfDescribingJson.new( - 'iglu:com.gitlab/gitlab_experiment/jsonschema/1-0-0', signature - ) - )) - end - def record! @record = true end diff --git a/app/experiments/new_project_readme_content_experiment.rb b/app/experiments/new_project_readme_content_experiment.rb index 01a965d7d51..f86803db093 100644 --- a/app/experiments/new_project_readme_content_experiment.rb +++ b/app/experiments/new_project_readme_content_experiment.rb @@ -2,6 +2,7 @@ class NewProjectReadmeContentExperiment < ApplicationExperiment # rubocop:disable Gitlab/NamespacedClass TEMPLATE_PATH = Rails.root.join('app', 'experiments', 'templates', 'new_project_readme_content') + include Rails.application.routes.url_helpers def run_with(project, variant: nil) @project = project @@ -17,6 +18,10 @@ class NewProjectReadmeContentExperiment < ApplicationExperiment # rubocop:disabl template('readme_advanced.md') end + def redirect(to_url) + experiment_redirect_url(self, to_url) + end + private def template(name) diff --git a/app/experiments/templates/new_project_readme_content/readme_advanced.md.tt b/app/experiments/templates/new_project_readme_content/readme_advanced.md.tt index baf827cd13b..70a32ba6f03 100644 --- a/app/experiments/templates/new_project_readme_content/readme_advanced.md.tt +++ b/app/experiments/templates/new_project_readme_content/readme_advanced.md.tt @@ -11,8 +11,8 @@ Already a pro? Just edit this README.md and make it your own. Want to make it ea ## Add your files -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: +- [ ] [Create](<%= redirect("https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file") %>) or [upload](<%= redirect("https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file") %>) files +- [ ] [Add files using the command line](<%= redirect("https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line") %>) or push an existing Git repository with the following command: ``` cd existing_repo @@ -23,27 +23,27 @@ git push -uf origin <%= @project.default_branch_or_main %> ## Integrate with your tools -- [ ] [Set up project integrations](https://docs.gitlab.com/ee/user/project/integrations/) +- [ ] [Set up project integrations](<%= redirect("https://docs.gitlab.com/ee/user/project/integrations/") %>) ## Collaborate with your team -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) +- [ ] [Invite team members and collaborators](<%= redirect("https://docs.gitlab.com/ee/user/project/members/") %>) +- [ ] [Create a new merge request](<%= redirect("https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html") %>) +- [ ] [Automatically close issues from merge requests](<%= redirect("https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically") %>) +- [ ] [Automatically merge when pipeline succeeds](<%= redirect("https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html") %>) ## Test and Deploy Use the built-in continuous integration in GitLab. -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) +- [ ] [Get started with GitLab CI/CD](<%= redirect("https://docs.gitlab.com/ee/ci/quick_start/index.html") %>) +- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](<%= redirect("https://docs.gitlab.com/ee/user/application_security/sast/") %>) *** # Editing this README -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. +When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](<%= redirect("https://www.makeareadme.com/") %>) for this template. ## Suggestions for a good README Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. |