diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /qa | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) | |
download | gitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'qa')
151 files changed, 4470 insertions, 1393 deletions
diff --git a/qa/Dockerfile b/qa/Dockerfile index 71fc615ac13..8e79d0a7bad 100644 --- a/qa/Dockerfile +++ b/qa/Dockerfile @@ -1,7 +1,7 @@ ARG DOCKER_VERSION=20.10.14 ARG CHROME_VERSION=106 ARG QA_BUILD_TARGET=ee -ARG RUBY_VERSION=2.7 +ARG RUBY_VERSION=3.0 FROM registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23 AS foss LABEL maintainer="GitLab Quality Department <quality@gitlab.com>" diff --git a/qa/Gemfile b/qa/Gemfile index 224fced35dc..53dc071b766 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' -gem 'gitlab-qa', '~> 8', '>= 8.14.0', require: 'gitlab/qa' +gem 'gitlab-qa', '~> 8', '>= 8.15.1', require: 'gitlab/qa' gem 'activesupport', '~> 6.1.4.7' # This should stay in sync with the root's Gemfile gem 'allure-rspec', '~> 2.20.0' gem 'capybara', '~> 3.38.0' @@ -14,18 +14,18 @@ gem 'airborne', '~> 0.3.7', require: false # airborne is messing with rspec sand gem 'rest-client', '~> 2.1.0' gem 'rspec-retry', '~> 0.6.2', require: 'rspec/retry' gem 'rspec_junit_formatter', '~> 0.6.0' -gem 'faker', '~> 3.0' +gem 'faker', '~> 3.1' gem 'knapsack', '~> 4.0' -gem 'parallel_tests', '~> 4.0' +gem 'parallel_tests', '~> 4.1' gem 'rotp', '~> 6.2.2' gem 'parallel', '~> 1.22', '>= 1.22.1' gem 'rainbow', '~> 3.1.1' -gem 'rspec-parameterized', '~> 0.5.2' +gem 'rspec-parameterized', '~> 1.0.0' gem 'octokit', '~> 6.0.1' gem "faraday-retry", "~> 2.0" gem 'webdrivers', '~> 5.2' gem 'zeitwerk', '~> 2.6', '>= 2.6.6' -gem 'influxdb-client', '~> 2.8' +gem 'influxdb-client', '~> 2.9' gem 'terminal-table', '~> 3.0.2', require: false gem 'slack-notifier', '~> 2.4', require: false gem 'fog-google', '~> 1.19', require: false @@ -38,7 +38,7 @@ gem 'chemlab', '~> 0.10' gem 'chemlab-library-www-gitlab-com', '~> 0.1', '>= 0.1.1' # dependencies for jenkins client -gem 'nokogiri', '~> 1.13', '>= 1.13.10' +gem 'nokogiri', '~> 1.14' gem 'deprecation_toolkit', '~> 2.0.1', require: false diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock index 243389e6e4a..577b641685a 100644 --- a/qa/Gemfile.lock +++ b/qa/Gemfile.lock @@ -25,7 +25,8 @@ GEM rspec-expectations (~> 3.12) uuid (>= 2.3, < 3) ast (2.4.2) - binding_ninja (0.2.3) + binding_of_caller (1.0.0) + debug_inspector (>= 0.0.1) builder (3.2.4) byebug (11.1.3) capybara (3.38.0) @@ -54,6 +55,7 @@ GEM confiner (0.4.0) gitlab (>= 4.17) zeitwerk (>= 2.5, < 3) + debug_inspector (1.1.0) declarative (0.0.20) deprecation_toolkit (2.0.1) activesupport (>= 5.2) @@ -61,7 +63,7 @@ GEM domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) excon (0.92.4) - faker (3.0.0) + faker (3.1.0) i18n (>= 1.8.11, < 2) faraday (2.5.2) faraday-net_http (>= 2.0, < 3.1) @@ -100,7 +102,7 @@ GEM gitlab (4.18.0) httparty (~> 0.18) terminal-table (>= 1.5.1) - gitlab-qa (8.14.0) + gitlab-qa (8.15.1) activesupport (~> 6.1) gitlab (~> 4.18.0) http (~> 5.0) @@ -140,7 +142,7 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - http (5.1.0) + http (5.1.1) addressable (~> 2.8) http-cookie (~> 1.0) http-form_data (~> 2.2) @@ -173,12 +175,12 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2022.0105) mini_mime (1.1.0) - mini_portile2 (2.8.0) + mini_portile2 (2.8.1) minitest (5.16.3) multi_json (1.15.0) multi_xml (0.6.0) netrc (0.11.0) - nokogiri (1.13.10) + nokogiri (1.14.0) mini_portile2 (~> 2.8.0) racc (~> 1.4) octokit (6.0.1) @@ -187,9 +189,9 @@ GEM oj (3.13.23) os (1.1.4) parallel (1.22.1) - parallel_tests (4.0.0) + parallel_tests (4.1.0) parallel - parser (3.1.2.1) + parser (3.1.3.0) ast (~> 2.4.1) proc_to_ast (0.1.0) coderay @@ -202,7 +204,7 @@ GEM byebug (~> 11.0) pry (>= 0.13, < 0.15) public_suffix (5.0.0) - racc (1.6.1) + racc (1.6.2) rack (2.2.3.1) rack-test (1.1.0) rack (>= 1.0, < 3) @@ -234,12 +236,17 @@ GEM rspec-mocks (3.12.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-parameterized (0.5.2) - binding_ninja (>= 0.2.3) + rspec-parameterized (1.0.0) + rspec-parameterized-core (< 2) + rspec-parameterized-table_syntax (< 2) + rspec-parameterized-core (1.0.0) parser proc_to_ast rspec (>= 2.13, < 4) unparser + rspec-parameterized-table_syntax (1.0.0) + binding_of_caller + rspec-parameterized-core (< 2) rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.12.0) @@ -306,24 +313,24 @@ DEPENDENCIES chemlab-library-www-gitlab-com (~> 0.1, >= 0.1.1) confiner (~> 0.4) deprecation_toolkit (~> 2.0.1) - faker (~> 3.0) + faker (~> 3.1) faraday-retry (~> 2.0) fog-core (= 2.1.0) fog-google (~> 1.19) - gitlab-qa (~> 8, >= 8.14.0) - influxdb-client (~> 2.8) + gitlab-qa (~> 8, >= 8.15.1) + influxdb-client (~> 2.9) knapsack (~> 4.0) - nokogiri (~> 1.13, >= 1.13.10) + nokogiri (~> 1.14) octokit (~> 6.0.1) parallel (~> 1.22, >= 1.22.1) - parallel_tests (~> 4.0) + parallel_tests (~> 4.1) pry-byebug (~> 3.10.1) rainbow (~> 3.1.1) rake (~> 13, >= 13.0.6) rest-client (~> 2.1.0) rotp (~> 6.2.2) rspec (~> 3.12) - rspec-parameterized (~> 0.5.2) + rspec-parameterized (~> 1.0.0) rspec-retry (~> 0.6.2) rspec_junit_formatter (~> 0.6.0) ruby-debug-ide (~> 0.7.3) diff --git a/qa/README.md b/qa/README.md index 4e2d688aa54..e6520867642 100644 --- a/qa/README.md +++ b/qa/README.md @@ -90,7 +90,13 @@ bundle exec bin/qa Test::Instance::All {GDK IP ADDRESS} #### Run the end-to-end tests on GitLab in Docker -1. [GitLab can be installed in Docker](https://docs.gitlab.com/ee/install/docker.html). You can use the following command to start an instance that you can visit at `http://127.0.0.1`: +GitLab can be [installed in Docker](https://docs.gitlab.com/ee/install/docker.html). + +See the section above for situations that might require adjustment to the commands below or to the configuration of the GitLab instance. [You can find more information in the documentation](https://docs.gitlab.com/ee/install/docker.html). + +##### On a Unix like operating system + +1. Use the following command to start an instance that you can visit at `http://127.0.0.1`: ``` docker run \ @@ -102,28 +108,53 @@ bundle exec bin/qa Test::Instance::All {GDK IP ADDRESS} gitlab/gitlab-ee:nightly ``` - Notes: - - If you are on a Mac with [Apple Silicon](https://support.apple.com/en-us/HT211814), you will also need to add: `--platform=linux/amd64` - - If you are on Windows, please be aware that [Docker Desktop must be set to use Linux containers](https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-10-linux#run-your-first-linux-container). + Note: If you are on a Mac with [Apple Silicon](https://support.apple.com/en-us/HT211814), you will also need to add: `--platform=linux/amd64` - -2. Navigate to the QA folder and run the following commands. +2. Once GitLab is up and accessible on `http://127.0.0.1`, in another shell tab, navigate to the `qa` directory of the checkout of the GitLab repository on your computer and run the following commands. ```bash - cd gitlab/qa bundle install export WEBDRIVER_HEADLESS=false export GITLAB_INITIAL_ROOT_PASSWORD=5iveL\!fe export QA_GITLAB_URL="http://127.0.0.1" ``` -3. Most tests that do not require special setup could then be run with the following command. +3. Most tests that do not require special setup could then be run with the following command. We will run `log_in_spec.rb` in this example. ```bash - bundle exec rspec <path/to/spec.rb> + bundle exec rspec ./qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb ``` -- Note: See the section above for situations that might require adjustment to the commands or to the configuration of the GitLab instance. [You can find more information in the documentation](https://docs.gitlab.com/ee/install/docker.html). +##### On a Windows PC + +1. If you don't already have these, install: + * [Google Chrome](https://www.google.com/chrome/) + * [Docker Desktop](https://docs.docker.com/desktop/install/windows-install/) + * [Git](https://git-scm.com/download/win) + * [Ruby](https://rubyinstaller.org/downloads/). Please refer to the [`.ruby-version` file](../.ruby-version) for the exact version of Ruby to install. + + Note: Please be aware that [Docker Desktop must be set to use Linux containers](https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-10-linux#run-your-first-linux-container). + +2. Use the following command to start an instance that you can visit at `http://127.0.0.1`. You might need to grant admin rights if asked: + + ``` + docker run --hostname 127.0.0.1 --publish 80:80 --publish 22:22 --name gitlab --shm-size 256m --env GITLAB_OMNIBUS_CONFIG="gitlab_rails['initial_root_password']='5iveL\!fe';" gitlab/gitlab-ee:nightly + ``` + +3. Once GitLab is up and accessible on `http://127.0.0.1`, in another command prompt window, navigate to the `qa` directory of the checkout of the GitLab repository on your computer and run the following commands. + + ```bash + bundle install + set WEBDRIVER_HEADLESS=false + set GITLAB_INITIAL_ROOT_PASSWORD=5iveL\!fe + set QA_GITLAB_URL=http://127.0.0.1 + ``` + +4. Most tests that do not require special setup could then be run with the following command. We will run `log_in_spec.rb` in this example. + + ```bash + bundle exec rspec .\qa\specs\features\browser_ui\1_manage\login\log_in_spec.rb + ``` #### Running EE tests diff --git a/qa/lib/gitlab/page/group/settings/usage_quotas.rb b/qa/lib/gitlab/page/group/settings/usage_quotas.rb index 04aa1b779ce..62f55aea2cc 100644 --- a/qa/lib/gitlab/page/group/settings/usage_quotas.rb +++ b/qa/lib/gitlab/page/group/settings/usage_quotas.rb @@ -75,6 +75,12 @@ module Gitlab purchased_usage_total.to_f end end + + def additional_ci_minutes_added? + # When opening the Usage quotas page, Seats quota tab is opened briefly even when url is to a different tab + ::QA::Support::WaitForRequests.wait_for_requests + additional_ci_minutes? + end end end end diff --git a/qa/qa/fixtures/mocks/import/github.yml b/qa/qa/fixtures/mocks/import/github.yml new file mode 100644 index 00000000000..9cabdee1025 --- /dev/null +++ b/qa/qa/fixtures/mocks/import/github.yml @@ -0,0 +1,2743 @@ +# Proxy mock definition, useful for recording all interaction with github +# +# - request: +# method: "GET" +# headers: +# Host: "api.github.com" +# proxy: +# host: "https://api.github.com" +# follow_redirect: true +# keep_host: true + +- request: + path: /rate_limit + method: GET + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + { + "rate": { + "limit": 5000, + "remaining": 5000, + "reset": 1988388445, + "used": 0 + }, + "resources": { + "actions_runner_registration": { + "limit": 10000, + "remaining": 10000, + "reset": 1988388445, + "used": 0 + }, + "code_scanning_upload": { + "limit": 1000, + "remaining": 1000, + "reset": 1988388445, + "used": 0 + }, + "core": { + "limit": 5000, + "remaining": 5000, + "reset": 1988388445, + "used": 0 + }, + "dependency_snapshots": { + "limit": 100, + "remaining": 100, + "reset": 1988388445, + "used": 0 + }, + "graphql": { + "limit": 5000, + "remaining": 5000, + "reset": 1988388445, + "used": 0 + }, + "integration_manifest": { + "limit": 5000, + "remaining": 5000, + "reset": 1988388445, + "used": 0 + }, + "scim": { + "limit": 15000, + "remaining": 15000, + "reset": 1988388445, + "used": 0 + }, + "search": { + "limit": 30, + "remaining": 30, + "reset": 1988388445, + "used": 0 + }, + "source_import": { + "limit": 100, + "remaining": 100, + "reset": 1988388445, + "used": 0 + } + } + } + +- request: + path: /user/repos + method: GET + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "allow_forking": true, + "archive_url": "https://api.github.com/repos/gitlab-qa-github/import-test/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/gitlab-qa-github/import-test/assignees{/user}", + "blobs_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches{/branch}", + "clone_url": "https://github.com/gitlab-qa-github/import-test.git", + "collaborators_url": "https://api.github.com/repos/gitlab-qa-github/import-test/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/comments{/number}", + "commits_url": "https://api.github.com/repos/gitlab-qa-github/import-test/commits{/sha}", + "compare_url": "https://api.github.com/repos/gitlab-qa-github/import-test/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/gitlab-qa-github/import-test/contents/{+path}", + "contributors_url": "https://api.github.com/repos/gitlab-qa-github/import-test/contributors", + "created_at": "2022-03-07T07:53:43Z", + "default_branch": "main", + "deployments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/deployments", + "description": "Project for github import test", + "disabled": false, + "downloads_url": "https://api.github.com/repos/gitlab-qa-github/import-test/downloads", + "events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/events", + "fork": false, + "forks": 0, + "forks_count": 0, + "forks_url": "https://api.github.com/repos/gitlab-qa-github/import-test/forks", + "full_name": "gitlab-qa-github/import-test", + "git_commits_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/tags{/sha}", + "git_url": "git://github.com/gitlab-qa-github/import-test.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": true, + "has_pages": false, + "has_projects": true, + "has_wiki": true, + "homepage": null, + "hooks_url": "https://api.github.com/repos/gitlab-qa-github/import-test/hooks", + "html_url": "https://github.com/gitlab-qa-github/import-test", + "id": 466994992, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events{/number}", + "issues_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues{/number}", + "keys_url": "https://api.github.com/repos/gitlab-qa-github/import-test/keys{/key_id}", + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels{/name}", + "language": null, + "languages_url": "https://api.github.com/repos/gitlab-qa-github/import-test/languages", + "license": { + "key": "mit", + "name": "MIT License", + "node_id": "MDc6TGljZW5zZTEz", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit" + }, + "merges_url": "https://api.github.com/repos/gitlab-qa-github/import-test/merges", + "milestones_url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones{/number}", + "mirror_url": null, + "name": "import-test", + "node_id": "R_kgDOG9XHMA", + "notifications_url": "https://api.github.com/repos/gitlab-qa-github/import-test/notifications{?since,all,participating}", + "open_issues": 2, + "open_issues_count": 2, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "permissions": { + "admin": true, + "maintain": true, + "pull": true, + "push": true, + "triage": true + }, + "private": false, + "pulls_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls{/number}", + "pushed_at": "2022-10-24T08:06:37Z", + "releases_url": "https://api.github.com/repos/gitlab-qa-github/import-test/releases{/id}", + "size": 4, + "ssh_url": "git@github.com:gitlab-qa-github/import-test.git", + "stargazers_count": 0, + "stargazers_url": "https://api.github.com/repos/gitlab-qa-github/import-test/stargazers", + "statuses_url": "https://api.github.com/repos/gitlab-qa-github/import-test/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/gitlab-qa-github/import-test/subscribers", + "subscription_url": "https://api.github.com/repos/gitlab-qa-github/import-test/subscription", + "svn_url": "https://github.com/gitlab-qa-github/import-test", + "tags_url": "https://api.github.com/repos/gitlab-qa-github/import-test/tags", + "teams_url": "https://api.github.com/repos/gitlab-qa-github/import-test/teams", + "topics": [], + "trees_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/trees{/sha}", + "updated_at": "2022-07-07T10:11:28Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test", + "visibility": "public", + "watchers": 0, + "watchers_count": 0, + "web_commit_signoff_required": false + } + ] + +- request: + path: + matcher: ShouldMatch + value: (\/repositories\/466994992$|\/repos\/gitlab-qa-github\/import-test$) + method: GET + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + { + "allow_forking": true, + "archive_url": "https://api.github.com/repos/gitlab-qa-github/import-test/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/gitlab-qa-github/import-test/assignees{/user}", + "blobs_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches{/branch}", + "clone_url": "https://github.com/gitlab-qa-github/import-test.git", + "collaborators_url": "https://api.github.com/repos/gitlab-qa-github/import-test/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/comments{/number}", + "commits_url": "https://api.github.com/repos/gitlab-qa-github/import-test/commits{/sha}", + "compare_url": "https://api.github.com/repos/gitlab-qa-github/import-test/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/gitlab-qa-github/import-test/contents/{+path}", + "contributors_url": "https://api.github.com/repos/gitlab-qa-github/import-test/contributors", + "created_at": "2022-03-07T07:53:43Z", + "default_branch": "main", + "deployments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/deployments", + "description": "Project for github import test", + "disabled": false, + "downloads_url": "https://api.github.com/repos/gitlab-qa-github/import-test/downloads", + "events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/events", + "fork": false, + "forks": 0, + "forks_count": 0, + "forks_url": "https://api.github.com/repos/gitlab-qa-github/import-test/forks", + "full_name": "gitlab-qa-github/import-test", + "git_commits_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/tags{/sha}", + "git_url": "git://github.com/gitlab-qa-github/import-test.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": true, + "has_pages": false, + "has_projects": true, + "has_wiki": true, + "homepage": null, + "hooks_url": "https://api.github.com/repos/gitlab-qa-github/import-test/hooks", + "html_url": "https://github.com/gitlab-qa-github/import-test", + "id": 466994992, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events{/number}", + "issues_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues{/number}", + "keys_url": "https://api.github.com/repos/gitlab-qa-github/import-test/keys{/key_id}", + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels{/name}", + "language": null, + "languages_url": "https://api.github.com/repos/gitlab-qa-github/import-test/languages", + "license": { + "key": "mit", + "name": "MIT License", + "node_id": "MDc6TGljZW5zZTEz", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit" + }, + "merges_url": "https://api.github.com/repos/gitlab-qa-github/import-test/merges", + "milestones_url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones{/number}", + "mirror_url": null, + "name": "import-test", + "network_count": 0, + "node_id": "R_kgDOG9XHMA", + "notifications_url": "https://api.github.com/repos/gitlab-qa-github/import-test/notifications{?since,all,participating}", + "open_issues": 2, + "open_issues_count": 2, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "permissions": { + "admin": false, + "maintain": false, + "pull": true, + "push": false, + "triage": false + }, + "private": false, + "pulls_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls{/number}", + "pushed_at": "2022-10-24T08:06:37Z", + "releases_url": "https://api.github.com/repos/gitlab-qa-github/import-test/releases{/id}", + "size": 4, + "ssh_url": "git@github.com:gitlab-qa-github/import-test.git", + "stargazers_count": 0, + "stargazers_url": "https://api.github.com/repos/gitlab-qa-github/import-test/stargazers", + "statuses_url": "https://api.github.com/repos/gitlab-qa-github/import-test/statuses/{sha}", + "subscribers_count": 1, + "subscribers_url": "https://api.github.com/repos/gitlab-qa-github/import-test/subscribers", + "subscription_url": "https://api.github.com/repos/gitlab-qa-github/import-test/subscription", + "svn_url": "https://github.com/gitlab-qa-github/import-test", + "tags_url": "https://api.github.com/repos/gitlab-qa-github/import-test/tags", + "teams_url": "https://api.github.com/repos/gitlab-qa-github/import-test/teams", + "temp_clone_token": "", + "topics": [], + "trees_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/trees{/sha}", + "updated_at": "2022-07-07T10:11:28Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test", + "visibility": "public", + "watchers": 0, + "watchers_count": 0, + "web_commit_signoff_required": false + } + +- request: + path: /repos/gitlab-qa-github/import-test/issues + method: GET + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "active_lock_reason": null, + "assignee": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "assignees": [ + { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + ], + "author_association": "OWNER", + "body": "Test pull request body", + "closed_at": null, + "comments": 1, + "comments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/comments", + "created_at": "2022-03-07T07:58:10Z", + "draft": false, + "events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/events", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2", + "id": 1161030385, + "labels": [ + { + "color": "0075ca", + "default": true, + "description": "Improvements or additions to documentation", + "id": 3902072341, + "name": "documentation", + "node_id": "LA_kwDOG9XHMM7olOYV", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/documentation" + } + ], + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/labels{/name}", + "locked": false, + "milestone": { + "closed_at": null, + "closed_issues": 0, + "created_at": "2022-03-07T07:54:43Z", + "creator": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "description": null, + "due_on": null, + "html_url": "https://github.com/gitlab-qa-github/import-test/milestone/1", + "id": 7741550, + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1/labels", + "node_id": "MI_kwDOG9XHMM4AdiBu", + "number": 1, + "open_issues": 2, + "state": "open", + "title": "0.0.1", + "updated_at": "2022-07-07T10:01:32Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1" + }, + "node_id": "PR_kwDOG9XHMM40Bfnz", + "number": 2, + "performed_via_github_app": null, + "pull_request": { + "diff_url": "https://github.com/gitlab-qa-github/import-test/pull/2.diff", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2", + "merged_at": null, + "patch_url": "https://github.com/gitlab-qa-github/import-test/pull/2.patch", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2" + }, + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/reactions" + }, + "repository_url": "https://api.github.com/repos/gitlab-qa-github/import-test", + "state": "open", + "state_reason": null, + "timeline_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/timeline", + "title": "Test pull request", + "updated_at": "2022-12-27T09:57:21Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/labels + method: GET + query_params: + per_page: '100' + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "color": "d73a4a", + "default": true, + "description": "Something isn't working", + "id": 3902072340, + "name": "bug", + "node_id": "LA_kwDOG9XHMM7olOYU", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/bug" + }, + { + "color": "0075ca", + "default": true, + "description": "Improvements or additions to documentation", + "id": 3902072341, + "name": "documentation", + "node_id": "LA_kwDOG9XHMM7olOYV", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/documentation" + }, + { + "color": "cfd3d7", + "default": true, + "description": "This issue or pull request already exists", + "id": 3902072342, + "name": "duplicate", + "node_id": "LA_kwDOG9XHMM7olOYW", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/duplicate" + }, + { + "color": "a2eeef", + "default": true, + "description": "New feature or request", + "id": 3902072343, + "name": "enhancement", + "node_id": "LA_kwDOG9XHMM7olOYX", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/enhancement" + }, + { + "color": "7057ff", + "default": true, + "description": "Good for newcomers", + "id": 3902072345, + "name": "good first issue", + "node_id": "LA_kwDOG9XHMM7olOYZ", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/good%20first%20issue" + }, + { + "color": "008672", + "default": true, + "description": "Extra attention is needed", + "id": 3902072344, + "name": "help wanted", + "node_id": "LA_kwDOG9XHMM7olOYY", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/help%20wanted" + }, + { + "color": "e4e669", + "default": true, + "description": "This doesn't seem right", + "id": 3902072346, + "name": "invalid", + "node_id": "LA_kwDOG9XHMM7olOYa", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/invalid" + }, + { + "color": "d876e3", + "default": true, + "description": "Further information is requested", + "id": 3902072347, + "name": "question", + "node_id": "LA_kwDOG9XHMM7olOYb", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/question" + }, + { + "color": "ffffff", + "default": true, + "description": "This will not be worked on", + "id": 3902072348, + "name": "wontfix", + "node_id": "LA_kwDOG9XHMM7olOYc", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/wontfix" + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/milestones + method: GET + query_params: + per_page: '100' + state: all + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "closed_at": null, + "closed_issues": 0, + "created_at": "2022-03-07T07:54:43Z", + "creator": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "description": null, + "due_on": null, + "html_url": "https://github.com/gitlab-qa-github/import-test/milestone/1", + "id": 7741550, + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1/labels", + "node_id": "MI_kwDOG9XHMM4AdiBu", + "number": 1, + "open_issues": 2, + "state": "open", + "title": "0.0.1", + "updated_at": "2022-07-07T10:01:32Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1" + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/releases + method: GET + query_params: + per_page: '100' + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "assets": [], + "assets_url": "https://api.github.com/repos/gitlab-qa-github/import-test/releases/61117625/assets", + "author": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "body": "Initial release", + "created_at": "2022-03-07T07:59:22Z", + "draft": false, + "html_url": "https://github.com/gitlab-qa-github/import-test/releases/tag/0.0.1", + "id": 61117625, + "name": "0.0.1", + "node_id": "RE_kwDOG9XHMM4DpJS5", + "prerelease": false, + "published_at": "2022-03-07T08:02:09Z", + "tag_name": "0.0.1", + "tarball_url": "https://api.github.com/repos/gitlab-qa-github/import-test/tarball/0.0.1", + "target_commitish": "main", + "upload_url": "https://uploads.github.com/repos/gitlab-qa-github/import-test/releases/61117625/assets{?name,label}", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/releases/61117625", + "zipball_url": "https://api.github.com/repos/gitlab-qa-github/import-test/zipball/0.0.1" + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/pulls + method: GET + query_params: + per_page: '100' + sort: created + state: all + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "_links": { + "comments": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/comments" + }, + "commits": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2/commits" + }, + "html": { + "href": "https://github.com/gitlab-qa-github/import-test/pull/2" + }, + "issue": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2" + }, + "review_comment": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/comments{/number}" + }, + "review_comments": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2/comments" + }, + "self": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2" + }, + "statuses": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/statuses/05938cc9b0773f49bf800ceabcaa01b389a5d943" + } + }, + "active_lock_reason": null, + "assignee": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "assignees": [ + { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + ], + "author_association": "OWNER", + "auto_merge": null, + "base": { + "label": "gitlab-qa-github:main", + "ref": "main", + "repo": { + "allow_forking": true, + "archive_url": "https://api.github.com/repos/gitlab-qa-github/import-test/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/gitlab-qa-github/import-test/assignees{/user}", + "blobs_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches{/branch}", + "clone_url": "https://github.com/gitlab-qa-github/import-test.git", + "collaborators_url": "https://api.github.com/repos/gitlab-qa-github/import-test/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/comments{/number}", + "commits_url": "https://api.github.com/repos/gitlab-qa-github/import-test/commits{/sha}", + "compare_url": "https://api.github.com/repos/gitlab-qa-github/import-test/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/gitlab-qa-github/import-test/contents/{+path}", + "contributors_url": "https://api.github.com/repos/gitlab-qa-github/import-test/contributors", + "created_at": "2022-03-07T07:53:43Z", + "default_branch": "main", + "deployments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/deployments", + "description": "Project for github import test", + "disabled": false, + "downloads_url": "https://api.github.com/repos/gitlab-qa-github/import-test/downloads", + "events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/events", + "fork": false, + "forks": 0, + "forks_count": 0, + "forks_url": "https://api.github.com/repos/gitlab-qa-github/import-test/forks", + "full_name": "gitlab-qa-github/import-test", + "git_commits_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/tags{/sha}", + "git_url": "git://github.com/gitlab-qa-github/import-test.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": true, + "has_pages": false, + "has_projects": true, + "has_wiki": true, + "homepage": null, + "hooks_url": "https://api.github.com/repos/gitlab-qa-github/import-test/hooks", + "html_url": "https://github.com/gitlab-qa-github/import-test", + "id": 466994992, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events{/number}", + "issues_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues{/number}", + "keys_url": "https://api.github.com/repos/gitlab-qa-github/import-test/keys{/key_id}", + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels{/name}", + "language": null, + "languages_url": "https://api.github.com/repos/gitlab-qa-github/import-test/languages", + "license": { + "key": "mit", + "name": "MIT License", + "node_id": "MDc6TGljZW5zZTEz", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit" + }, + "merges_url": "https://api.github.com/repos/gitlab-qa-github/import-test/merges", + "milestones_url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones{/number}", + "mirror_url": null, + "name": "import-test", + "node_id": "R_kgDOG9XHMA", + "notifications_url": "https://api.github.com/repos/gitlab-qa-github/import-test/notifications{?since,all,participating}", + "open_issues": 2, + "open_issues_count": 2, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls{/number}", + "pushed_at": "2022-10-24T08:06:37Z", + "releases_url": "https://api.github.com/repos/gitlab-qa-github/import-test/releases{/id}", + "size": 4, + "ssh_url": "git@github.com:gitlab-qa-github/import-test.git", + "stargazers_count": 0, + "stargazers_url": "https://api.github.com/repos/gitlab-qa-github/import-test/stargazers", + "statuses_url": "https://api.github.com/repos/gitlab-qa-github/import-test/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/gitlab-qa-github/import-test/subscribers", + "subscription_url": "https://api.github.com/repos/gitlab-qa-github/import-test/subscription", + "svn_url": "https://github.com/gitlab-qa-github/import-test", + "tags_url": "https://api.github.com/repos/gitlab-qa-github/import-test/tags", + "teams_url": "https://api.github.com/repos/gitlab-qa-github/import-test/teams", + "topics": [], + "trees_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/trees{/sha}", + "updated_at": "2022-07-07T10:11:28Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test", + "visibility": "public", + "watchers": 0, + "watchers_count": 0, + "web_commit_signoff_required": false + }, + "sha": "61ae9e670fdcd0a35e37a7faf7489969564accc1", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + }, + "body": "Test pull request body", + "closed_at": null, + "comments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/comments", + "commits_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2/commits", + "created_at": "2022-03-07T07:58:10Z", + "diff_url": "https://github.com/gitlab-qa-github/import-test/pull/2.diff", + "draft": false, + "head": { + "label": "gitlab-qa-github:gitlab-qa-github-patch-1", + "ref": "gitlab-qa-github-patch-1", + "repo": { + "allow_forking": true, + "archive_url": "https://api.github.com/repos/gitlab-qa-github/import-test/{archive_format}{/ref}", + "archived": false, + "assignees_url": "https://api.github.com/repos/gitlab-qa-github/import-test/assignees{/user}", + "blobs_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/blobs{/sha}", + "branches_url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches{/branch}", + "clone_url": "https://github.com/gitlab-qa-github/import-test.git", + "collaborators_url": "https://api.github.com/repos/gitlab-qa-github/import-test/collaborators{/collaborator}", + "comments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/comments{/number}", + "commits_url": "https://api.github.com/repos/gitlab-qa-github/import-test/commits{/sha}", + "compare_url": "https://api.github.com/repos/gitlab-qa-github/import-test/compare/{base}...{head}", + "contents_url": "https://api.github.com/repos/gitlab-qa-github/import-test/contents/{+path}", + "contributors_url": "https://api.github.com/repos/gitlab-qa-github/import-test/contributors", + "created_at": "2022-03-07T07:53:43Z", + "default_branch": "main", + "deployments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/deployments", + "description": "Project for github import test", + "disabled": false, + "downloads_url": "https://api.github.com/repos/gitlab-qa-github/import-test/downloads", + "events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/events", + "fork": false, + "forks": 0, + "forks_count": 0, + "forks_url": "https://api.github.com/repos/gitlab-qa-github/import-test/forks", + "full_name": "gitlab-qa-github/import-test", + "git_commits_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/commits{/sha}", + "git_refs_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/refs{/sha}", + "git_tags_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/tags{/sha}", + "git_url": "git://github.com/gitlab-qa-github/import-test.git", + "has_discussions": false, + "has_downloads": true, + "has_issues": true, + "has_pages": false, + "has_projects": true, + "has_wiki": true, + "homepage": null, + "hooks_url": "https://api.github.com/repos/gitlab-qa-github/import-test/hooks", + "html_url": "https://github.com/gitlab-qa-github/import-test", + "id": 466994992, + "is_template": false, + "issue_comment_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments{/number}", + "issue_events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events{/number}", + "issues_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues{/number}", + "keys_url": "https://api.github.com/repos/gitlab-qa-github/import-test/keys{/key_id}", + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels{/name}", + "language": null, + "languages_url": "https://api.github.com/repos/gitlab-qa-github/import-test/languages", + "license": { + "key": "mit", + "name": "MIT License", + "node_id": "MDc6TGljZW5zZTEz", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit" + }, + "merges_url": "https://api.github.com/repos/gitlab-qa-github/import-test/merges", + "milestones_url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones{/number}", + "mirror_url": null, + "name": "import-test", + "node_id": "R_kgDOG9XHMA", + "notifications_url": "https://api.github.com/repos/gitlab-qa-github/import-test/notifications{?since,all,participating}", + "open_issues": 2, + "open_issues_count": 2, + "owner": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "private": false, + "pulls_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls{/number}", + "pushed_at": "2022-10-24T08:06:37Z", + "releases_url": "https://api.github.com/repos/gitlab-qa-github/import-test/releases{/id}", + "size": 4, + "ssh_url": "git@github.com:gitlab-qa-github/import-test.git", + "stargazers_count": 0, + "stargazers_url": "https://api.github.com/repos/gitlab-qa-github/import-test/stargazers", + "statuses_url": "https://api.github.com/repos/gitlab-qa-github/import-test/statuses/{sha}", + "subscribers_url": "https://api.github.com/repos/gitlab-qa-github/import-test/subscribers", + "subscription_url": "https://api.github.com/repos/gitlab-qa-github/import-test/subscription", + "svn_url": "https://github.com/gitlab-qa-github/import-test", + "tags_url": "https://api.github.com/repos/gitlab-qa-github/import-test/tags", + "teams_url": "https://api.github.com/repos/gitlab-qa-github/import-test/teams", + "topics": [], + "trees_url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/trees{/sha}", + "updated_at": "2022-07-07T10:11:28Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test", + "visibility": "public", + "watchers": 0, + "watchers_count": 0, + "web_commit_signoff_required": false + }, + "sha": "05938cc9b0773f49bf800ceabcaa01b389a5d943", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + }, + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2", + "id": 872806899, + "issue_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2", + "labels": [ + { + "color": "0075ca", + "default": true, + "description": "Improvements or additions to documentation", + "id": 3902072341, + "name": "documentation", + "node_id": "LA_kwDOG9XHMM7olOYV", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/documentation" + } + ], + "locked": false, + "merge_commit_sha": "e95005795a22f9bbf04a6398bdeed206f4e5d26d", + "merged_at": null, + "milestone": { + "closed_at": null, + "closed_issues": 0, + "created_at": "2022-03-07T07:54:43Z", + "creator": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "description": null, + "due_on": null, + "html_url": "https://github.com/gitlab-qa-github/import-test/milestone/1", + "id": 7741550, + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1/labels", + "node_id": "MI_kwDOG9XHMM4AdiBu", + "number": 1, + "open_issues": 2, + "state": "open", + "title": "0.0.1", + "updated_at": "2022-07-07T10:01:32Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1" + }, + "node_id": "PR_kwDOG9XHMM40Bfnz", + "number": 2, + "patch_url": "https://github.com/gitlab-qa-github/import-test/pull/2.patch", + "requested_reviewers": [], + "requested_teams": [], + "review_comment_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/comments{/number}", + "review_comments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2/comments", + "state": "open", + "statuses_url": "https://api.github.com/repos/gitlab-qa-github/import-test/statuses/05938cc9b0773f49bf800ceabcaa01b389a5d943", + "title": "Test pull request", + "updated_at": "2022-12-27T09:57:21Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/pulls/2/requested_reviewers + method: GET + query_params: + per_page: '100' + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + { + "teams": [], + "users": [] + } + +- request: + path: /repos/gitlab-qa-github/import-test/pulls/2/reviews + method: GET + query_params: + per_page: '100' + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "_links": { + "html": { + "href": "https://github.com/gitlab-qa-github/import-test/pull/2#pullrequestreview-901341181" + }, + "pull_request": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2" + } + }, + "author_association": "OWNER", + "body": "Good but needs some improvement", + "commit_id": "05938cc9b0773f49bf800ceabcaa01b389a5d943", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2#pullrequestreview-901341181", + "id": 901341181, + "node_id": "PRR_kwDOG9XHMM41uV_9", + "pull_request_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2", + "state": "COMMENTED", + "submitted_at": "2022-03-07T08:01:18Z", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + }, + { + "_links": { + "html": { + "href": "https://github.com/gitlab-qa-github/import-test/pull/2#pullrequestreview-1230532237" + }, + "pull_request": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2" + } + }, + "author_association": "COLLABORATOR", + "body": "", + "commit_id": "05938cc9b0773f49bf800ceabcaa01b389a5d943", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2#pullrequestreview-1230532237", + "id": 1230532237, + "node_id": "PRR_kwDOG9XHMM5JWG6N", + "pull_request_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2", + "state": "APPROVED", + "submitted_at": "2022-12-27T09:57:21Z", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/40021320?v=4", + "events_url": "https://api.github.com/users/gitlab-qa/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa/followers", + "following_url": "https://api.github.com/users/gitlab-qa/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa", + "id": 40021320, + "login": "gitlab-qa", + "node_id": "MDQ6VXNlcjQwMDIxMzIw", + "organizations_url": "https://api.github.com/users/gitlab-qa/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa" + } + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/issues + method: GET + query_params: + per_page: '100' + sort: created + state: all + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "active_lock_reason": null, + "assignee": null, + "assignees": [], + "author_association": "OWNER", + "body": "Test issue description", + "closed_at": null, + "comments": 2, + "comments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1/comments", + "created_at": "2022-03-07T07:54:52Z", + "events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1/events", + "html_url": "https://github.com/gitlab-qa-github/import-test/issues/1", + "id": 1161027859, + "labels": [ + { + "color": "008672", + "default": true, + "description": "Extra attention is needed", + "id": 3902072344, + "name": "help wanted", + "node_id": "LA_kwDOG9XHMM7olOYY", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/help%20wanted" + }, + { + "color": "7057ff", + "default": true, + "description": "Good for newcomers", + "id": 3902072345, + "name": "good first issue", + "node_id": "LA_kwDOG9XHMM7olOYZ", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/good%20first%20issue" + }, + { + "color": "d876e3", + "default": true, + "description": "Further information is requested", + "id": 3902072347, + "name": "question", + "node_id": "LA_kwDOG9XHMM7olOYb", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/question" + } + ], + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1/labels{/name}", + "locked": false, + "milestone": { + "closed_at": null, + "closed_issues": 0, + "created_at": "2022-03-07T07:54:43Z", + "creator": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "description": null, + "due_on": null, + "html_url": "https://github.com/gitlab-qa-github/import-test/milestone/1", + "id": 7741550, + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1/labels", + "node_id": "MI_kwDOG9XHMM4AdiBu", + "number": 1, + "open_issues": 2, + "state": "open", + "title": "0.0.1", + "updated_at": "2022-07-07T10:01:32Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1" + }, + "node_id": "I_kwDOG9XHMM5FM-ET", + "number": 1, + "performed_via_github_app": null, + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1/reactions" + }, + "repository_url": "https://api.github.com/repos/gitlab-qa-github/import-test", + "state": "open", + "state_reason": "reopened", + "timeline_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1/timeline", + "title": "Test issue", + "updated_at": "2022-07-07T10:01:32Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + }, + { + "active_lock_reason": null, + "assignee": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "assignees": [ + { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + ], + "author_association": "OWNER", + "body": "Test pull request body", + "closed_at": null, + "comments": 1, + "comments_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/comments", + "created_at": "2022-03-07T07:58:10Z", + "draft": false, + "events_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/events", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2", + "id": 1161030385, + "labels": [ + { + "color": "0075ca", + "default": true, + "description": "Improvements or additions to documentation", + "id": 3902072341, + "name": "documentation", + "node_id": "LA_kwDOG9XHMM7olOYV", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/labels/documentation" + } + ], + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/labels{/name}", + "locked": false, + "milestone": { + "closed_at": null, + "closed_issues": 0, + "created_at": "2022-03-07T07:54:43Z", + "creator": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "description": null, + "due_on": null, + "html_url": "https://github.com/gitlab-qa-github/import-test/milestone/1", + "id": 7741550, + "labels_url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1/labels", + "node_id": "MI_kwDOG9XHMM4AdiBu", + "number": 1, + "open_issues": 2, + "state": "open", + "title": "0.0.1", + "updated_at": "2022-07-07T10:01:32Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/milestones/1" + }, + "node_id": "PR_kwDOG9XHMM40Bfnz", + "number": 2, + "performed_via_github_app": null, + "pull_request": { + "diff_url": "https://github.com/gitlab-qa-github/import-test/pull/2.diff", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2", + "merged_at": null, + "patch_url": "https://github.com/gitlab-qa-github/import-test/pull/2.patch", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2" + }, + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/reactions" + }, + "repository_url": "https://api.github.com/repos/gitlab-qa-github/import-test", + "state": "open", + "state_reason": null, + "timeline_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2/timeline", + "title": "Test pull request", + "updated_at": "2022-12-27T09:57:21Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/pulls/2/comments + method: GET + query_params: + per_page: '100' + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "_links": { + "html": { + "href": "https://github.com/gitlab-qa-github/import-test/pull/2#discussion_r820456469" + }, + "pull_request": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2" + }, + "self": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/comments/820456469" + } + }, + "author_association": "OWNER", + "body": "```suggestion\r\nProject for GitHub import test to GitLab\r\n```", + "commit_id": "05938cc9b0773f49bf800ceabcaa01b389a5d943", + "created_at": "2022-03-07T08:00:45Z", + "diff_hunk": "@@ -1,2 +1,3 @@\n # import-test\n-Project for github import test\n+Project for github import test to GitLab", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2#discussion_r820456469", + "id": 820456469, + "line": 2, + "node_id": "PRRC_kwDOG9XHMM4w5ywV", + "original_commit_id": "05938cc9b0773f49bf800ceabcaa01b389a5d943", + "original_line": 2, + "original_position": 3, + "original_start_line": null, + "path": "README.md", + "position": 3, + "pull_request_review_id": 901341181, + "pull_request_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2", + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/comments/820456469/reactions" + }, + "side": "RIGHT", + "start_line": null, + "start_side": null, + "updated_at": "2022-03-07T08:01:18Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/comments/820456469", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/issues/1/timeline + method: GET + query_params: + per_page: '100' + sort: created + state: all + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-03-07T07:54:52Z", + "event": "labeled", + "id": 6192721273, + "label": { + "color": "d876e3", + "name": "question" + }, + "node_id": "LE_lADOG9XHMM5FM-ETzwAAAAFxHW15", + "performed_via_github_app": null, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/6192721273" + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-03-07T07:54:52Z", + "event": "milestoned", + "id": 6192721279, + "milestone": { + "title": "0.0.1" + }, + "node_id": "MIE_lADOG9XHMM5FM-ETzwAAAAFxHW1_", + "performed_via_github_app": null, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/6192721279" + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-03-07T08:07:17Z", + "event": "labeled", + "id": 6192790994, + "label": { + "color": "7057ff", + "name": "good first issue" + }, + "node_id": "LE_lADOG9XHMM5FM-ETzwAAAAFxHn3S", + "performed_via_github_app": null, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/6192790994" + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-03-07T08:07:17Z", + "event": "labeled", + "id": 6192790996, + "label": { + "color": "008672", + "name": "help wanted" + }, + "node_id": "LE_lADOG9XHMM5FM-ETzwAAAAFxHn3U", + "performed_via_github_app": null, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/6192790996" + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "author_association": "OWNER", + "body": "Some test comment", + "created_at": "2022-03-07T08:07:40Z", + "event": "commented", + "html_url": "https://github.com/gitlab-qa-github/import-test/issues/1#issuecomment-1060295687", + "id": 1060295687, + "issue_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1", + "node_id": "IC_kwDOG9XHMM4_MtQH", + "performed_via_github_app": null, + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060295687/reactions" + }, + "updated_at": "2022-03-07T08:07:47Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060295687", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "author_association": "OWNER", + "body": "Another test comment", + "created_at": "2022-03-07T08:27:03Z", + "event": "commented", + "html_url": "https://github.com/gitlab-qa-github/import-test/issues/1#issuecomment-1060321905", + "id": 1060321905, + "issue_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1", + "node_id": "IC_kwDOG9XHMM4_Mzpx", + "performed_via_github_app": null, + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060321905/reactions" + }, + "updated_at": "2022-03-07T08:27:03Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060321905", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-07-07T10:01:27Z", + "event": "closed", + "id": 6950161456, + "node_id": "CE_lADOG9XHMM5FM-ETzwAAAAGeQwww", + "performed_via_github_app": null, + "state_reason": "not_planned", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/6950161456" + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-07-07T10:01:32Z", + "event": "reopened", + "id": 6950162104, + "node_id": "REE_lADOG9XHMM5FM-ETzwAAAAGeQw64", + "performed_via_github_app": null, + "state_reason": "reopened", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/6950162104" + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/issues/2/timeline + method: GET + query_params: + per_page: '100' + sort: created + state: all + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "author": { + "date": "2022-03-07T07:57:19Z", + "email": "59606922+gitlab-qa-github@users.noreply.github.com", + "name": "gitlab-qa-github" + }, + "committer": { + "date": "2022-03-07T07:57:19Z", + "email": "noreply@github.com", + "name": "GitHub" + }, + "event": "committed", + "html_url": "https://github.com/gitlab-qa-github/import-test/commit/05938cc9b0773f49bf800ceabcaa01b389a5d943", + "message": "Improve README", + "node_id": "C_kwDOG9XHMNoAKDA1OTM4Y2M5YjA3NzNmNDliZjgwMGNlYWJjYWEwMWIzODlhNWQ5NDM", + "parents": [ + { + "html_url": "https://github.com/gitlab-qa-github/import-test/commit/61ae9e670fdcd0a35e37a7faf7489969564accc1", + "sha": "61ae9e670fdcd0a35e37a7faf7489969564accc1", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/commits/61ae9e670fdcd0a35e37a7faf7489969564accc1" + } + ], + "sha": "05938cc9b0773f49bf800ceabcaa01b389a5d943", + "tree": { + "sha": "5eba7be6baa4c1e14b89c377d25dba1d6f8fc3fc", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/trees/5eba7be6baa4c1e14b89c377d25dba1d6f8fc3fc" + }, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/git/commits/05938cc9b0773f49bf800ceabcaa01b389a5d943", + "verification": { + "payload": "tree 5eba7be6baa4c1e14b89c377d25dba1d6f8fc3fc\nparent 61ae9e670fdcd0a35e37a7faf7489969564accc1\nauthor gitlab-qa-github <59606922+gitlab-qa-github@users.noreply.github.com> 1646639839 +0100\ncommitter GitHub <noreply@github.com> 1646639839 +0100\n\nImprove README", + "reason": "valid", + "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJiJbrfCRBK7hj4Ov3rIwAAxZ4IAD3lRpLwlbBH/0nBd9cwXwLT\nd3mVtAz5irpSaeXZtaXSn46IpmA+JeBbwglEOp/GDQWs+6aYauiwFBmW2bPwJ1B8\nBxl+5ypTWd7azTuLsXHOjE+3j+DpfVgvkEYcwiwQ02suZ/Jt1FxyLdKZ95/DvP+w\nmZWWL8FhXPxaV1Z2b0tozmx2KpNkKFfplgq54BBIWn3S2fQ/qsr0ypyJUaFOQdbY\nx0m5adwXJ1oN9RGIskQ3402PfW3g6y/4d7fSugMcAVpJOyLu6VRJuXLcfzBLlZj8\n55wDqeDy1WN7tyPDxC7Ds6UHw7GbgPArFieSLiO9UXNO/jPY7S1Xr98kFhynsHI=\n=kU7W\n-----END PGP SIGNATURE-----\n", + "verified": true + } + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-03-07T07:58:10Z", + "event": "labeled", + "id": 6192737366, + "label": { + "color": "0075ca", + "name": "documentation" + }, + "node_id": "LE_lADOG9XHMM5FM-rxzwAAAAFxHaxW", + "performed_via_github_app": null, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/6192737366" + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-03-07T07:58:10Z", + "event": "milestoned", + "id": 6192737375, + "milestone": { + "title": "0.0.1" + }, + "node_id": "MIE_lADOG9XHMM5FM-rxzwAAAAFxHaxf", + "performed_via_github_app": null, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/6192737375" + }, + { + "_links": { + "html": { + "href": "https://github.com/gitlab-qa-github/import-test/pull/2#pullrequestreview-901341181" + }, + "pull_request": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2" + } + }, + "author_association": "OWNER", + "body": "Good but needs some improvement", + "commit_id": "05938cc9b0773f49bf800ceabcaa01b389a5d943", + "event": "reviewed", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2#pullrequestreview-901341181", + "id": 901341181, + "node_id": "PRR_kwDOG9XHMM41uV_9", + "pull_request_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2", + "state": "commented", + "submitted_at": "2022-03-07T08:01:18Z", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "author_association": "OWNER", + "body": "Some test PR comment", + "created_at": "2022-03-07T08:27:17Z", + "event": "commented", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2#issuecomment-1060322120", + "id": 1060322120, + "issue_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2", + "node_id": "IC_kwDOG9XHMM4_MztI", + "performed_via_github_app": null, + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060322120/reactions" + }, + "updated_at": "2022-03-07T08:27:17Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060322120", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "assignee": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-12-27T06:17:51Z", + "event": "assigned", + "id": 8113792800, + "node_id": "AE_lADOG9XHMM5FM-rxzwAAAAHjnqcg", + "performed_via_github_app": null, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/8113792800" + }, + { + "actor": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "commit_id": null, + "commit_url": null, + "created_at": "2022-12-27T06:25:33Z", + "event": "review_requested", + "id": 8113816458, + "node_id": "RRE_lADOG9XHMM5FM-rxzwAAAAHjnwOK", + "performed_via_github_app": null, + "requested_reviewer": { + "avatar_url": "https://avatars.githubusercontent.com/u/40021320?v=4", + "events_url": "https://api.github.com/users/gitlab-qa/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa/followers", + "following_url": "https://api.github.com/users/gitlab-qa/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa", + "id": 40021320, + "login": "gitlab-qa", + "node_id": "MDQ6VXNlcjQwMDIxMzIw", + "organizations_url": "https://api.github.com/users/gitlab-qa/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa" + }, + "review_requester": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + }, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/events/8113816458" + }, + { + "_links": { + "html": { + "href": "https://github.com/gitlab-qa-github/import-test/pull/2#pullrequestreview-1230532237" + }, + "pull_request": { + "href": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2" + } + }, + "author_association": "COLLABORATOR", + "body": "", + "commit_id": "05938cc9b0773f49bf800ceabcaa01b389a5d943", + "event": "reviewed", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2#pullrequestreview-1230532237", + "id": 1230532237, + "node_id": "PRR_kwDOG9XHMM5JWG6N", + "pull_request_url": "https://api.github.com/repos/gitlab-qa-github/import-test/pulls/2", + "state": "approved", + "submitted_at": "2022-12-27T09:57:21Z", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/40021320?v=4", + "events_url": "https://api.github.com/users/gitlab-qa/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa/followers", + "following_url": "https://api.github.com/users/gitlab-qa/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa", + "id": 40021320, + "login": "gitlab-qa", + "node_id": "MDQ6VXNlcjQwMDIxMzIw", + "organizations_url": "https://api.github.com/users/gitlab-qa/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa" + } + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/issues/2/comments + method: GET + query_params: + per_page: '100' + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "author_association": "OWNER", + "body": "Some test PR comment", + "created_at": "2022-03-07T08:27:17Z", + "html_url": "https://github.com/gitlab-qa-github/import-test/pull/2#issuecomment-1060322120", + "id": 1060322120, + "issue_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/2", + "node_id": "IC_kwDOG9XHMM4_MztI", + "performed_via_github_app": null, + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060322120/reactions" + }, + "updated_at": "2022-03-07T08:27:17Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060322120", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/issues/1/comments + method: GET + query_params: + per_page: '100' + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "author_association": "OWNER", + "body": "Some test comment", + "created_at": "2022-03-07T08:07:40Z", + "html_url": "https://github.com/gitlab-qa-github/import-test/issues/1#issuecomment-1060295687", + "id": 1060295687, + "issue_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1", + "node_id": "IC_kwDOG9XHMM4_MtQH", + "performed_via_github_app": null, + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060295687/reactions" + }, + "updated_at": "2022-03-07T08:07:47Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060295687", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + }, + { + "author_association": "OWNER", + "body": "Another test comment", + "created_at": "2022-03-07T08:27:03Z", + "html_url": "https://github.com/gitlab-qa-github/import-test/issues/1#issuecomment-1060321905", + "id": 1060321905, + "issue_url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/1", + "node_id": "IC_kwDOG9XHMM4_Mzpx", + "performed_via_github_app": null, + "reactions": { + "+1": 0, + "-1": 0, + "confused": 0, + "eyes": 0, + "heart": 0, + "hooray": 0, + "laugh": 0, + "rocket": 0, + "total_count": 0, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060321905/reactions" + }, + "updated_at": "2022-03-07T08:27:03Z", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/issues/comments/1060321905", + "user": { + "avatar_url": "https://avatars.githubusercontent.com/u/59606922?v=4", + "events_url": "https://api.github.com/users/gitlab-qa-github/events{/privacy}", + "followers_url": "https://api.github.com/users/gitlab-qa-github/followers", + "following_url": "https://api.github.com/users/gitlab-qa-github/following{/other_user}", + "gists_url": "https://api.github.com/users/gitlab-qa-github/gists{/gist_id}", + "gravatar_id": "", + "html_url": "https://github.com/gitlab-qa-github", + "id": 59606922, + "login": "gitlab-qa-github", + "node_id": "MDQ6VXNlcjU5NjA2OTIy", + "organizations_url": "https://api.github.com/users/gitlab-qa-github/orgs", + "received_events_url": "https://api.github.com/users/gitlab-qa-github/received_events", + "repos_url": "https://api.github.com/users/gitlab-qa-github/repos", + "site_admin": false, + "starred_url": "https://api.github.com/users/gitlab-qa-github/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gitlab-qa-github/subscriptions", + "type": "User", + "url": "https://api.github.com/users/gitlab-qa-github" + } + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/branches + method: GET + query_params: + per_page: '100' + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + [ + { + "commit": { + "sha": "05938cc9b0773f49bf800ceabcaa01b389a5d943", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/commits/05938cc9b0773f49bf800ceabcaa01b389a5d943" + }, + "name": "gitlab-qa-github-patch-1", + "protected": false, + "protection": { + "enabled": false, + "required_status_checks": { + "checks": [], + "contexts": [], + "enforcement_level": "off" + } + }, + "protection_url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/gitlab-qa-github-patch-1/protection" + }, + { + "commit": { + "sha": "fff7d743291b72165fea8781d5924650230e8d6c", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/commits/fff7d743291b72165fea8781d5924650230e8d6c" + }, + "name": "main", + "protected": true, + "protection": { + "enabled": true, + "required_status_checks": { + "checks": [], + "contexts": [], + "enforcement_level": "non_admins" + } + }, + "protection_url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/main/protection" + }, + { + "commit": { + "sha": "fff7d743291b72165fea8781d5924650230e8d6c", + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/commits/fff7d743291b72165fea8781d5924650230e8d6c" + }, + "name": "release", + "protected": true, + "protection": { + "enabled": true, + "required_status_checks": { + "checks": [], + "contexts": [], + "enforcement_level": "off" + } + }, + "protection_url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/release/protection" + } + ] + +- request: + path: /repos/gitlab-qa-github/import-test/branches/main/protection + method: GET + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + { + "allow_deletions": { + "enabled": false + }, + "allow_force_pushes": { + "enabled": false + }, + "allow_fork_syncing": { + "enabled": false + }, + "block_creations": { + "enabled": false + }, + "enforce_admins": { + "enabled": false, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/main/protection/enforce_admins" + }, + "lock_branch": { + "enabled": false + }, + "required_conversation_resolution": { + "enabled": true + }, + "required_linear_history": { + "enabled": false + }, + "required_pull_request_reviews": { + "dismiss_stale_reviews": true, + "require_code_owner_reviews": true, + "require_last_push_approval": false, + "required_approving_review_count": 1, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/main/protection/required_pull_request_reviews" + }, + "required_signatures": { + "enabled": true, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/main/protection/required_signatures" + }, + "required_status_checks": { + "checks": [], + "contexts": [], + "contexts_url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/main/protection/required_status_checks/contexts", + "strict": false, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/main/protection/required_status_checks" + }, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/main/protection" + } + +- request: + path: /repos/gitlab-qa-github/import-test/branches/release/protection + method: GET + headers: + Host: api.github.com + response: + status: 200 + headers: + Content-Type: application/json; charset=utf-8 + X-Ratelimit-Limit: '5000' + X-Ratelimit-Remaining: '5000' + body: | + { + "allow_deletions": { + "enabled": false + }, + "allow_force_pushes": { + "enabled": true + }, + "allow_fork_syncing": { + "enabled": false + }, + "block_creations": { + "enabled": false + }, + "enforce_admins": { + "enabled": false, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/release/protection/enforce_admins" + }, + "lock_branch": { + "enabled": true + }, + "required_conversation_resolution": { + "enabled": false + }, + "required_linear_history": { + "enabled": false + }, + "required_pull_request_reviews": { + "dismiss_stale_reviews": false, + "require_code_owner_reviews": true, + "require_last_push_approval": false, + "required_approving_review_count": 1, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/release/protection/required_pull_request_reviews" + }, + "required_signatures": { + "enabled": false, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/release/protection/required_signatures" + }, + "url": "https://api.github.com/repos/gitlab-qa-github/import-test/branches/release/protection" + } diff --git a/qa/qa/fixtures/package_managers/nuget/nuget_install_package.yaml.erb b/qa/qa/fixtures/package_managers/nuget/nuget_install_package.yaml.erb index 39b65a55884..823525d648a 100644 --- a/qa/qa/fixtures/package_managers/nuget/nuget_install_package.yaml.erb +++ b/qa/qa/fixtures/package_managers/nuget/nuget_install_package.yaml.erb @@ -1,4 +1,4 @@ -image: mcr.microsoft.com/dotnet/sdk:5.0 +image: mcr.microsoft.com/dotnet/sdk:7.0 stages: - install diff --git a/qa/qa/fixtures/package_managers/nuget/nuget_upload_package.yaml.erb b/qa/qa/fixtures/package_managers/nuget/nuget_upload_package.yaml.erb index 7c88eb49be0..dc3311d3a1d 100644 --- a/qa/qa/fixtures/package_managers/nuget/nuget_upload_package.yaml.erb +++ b/qa/qa/fixtures/package_managers/nuget/nuget_upload_package.yaml.erb @@ -1,4 +1,4 @@ -image: mcr.microsoft.com/dotnet/sdk:5.0 +image: mcr.microsoft.com/dotnet/sdk:7.0 stages: - deploy diff --git a/qa/qa/flow/alert_settings.rb b/qa/qa/flow/alert_settings.rb index 0e884f58773..2a464c16c6d 100644 --- a/qa/qa/flow/alert_settings.rb +++ b/qa/qa/flow/alert_settings.rb @@ -5,9 +5,12 @@ module QA module AlertSettings extend self - def setup_http_endpoint_and_send_alert(integration_name: nil, payload: nil) - integration_name ||= random_word - payload ||= { title: random_word, description: random_word } + def setup_http_endpoint( + integration_name: random_word, + payload: { title: random_word, description: random_word }, + send: true + ) + credentials = {} Page::Project::Menu.perform(&:go_to_monitor_settings) Page::Project::Settings::Monitor.perform do |setting| setting.expand_alerts do |alert| @@ -16,10 +19,42 @@ module QA alert.enter_integration_name(integration_name) alert.activate_integration alert.save_and_create_alert - alert.fill_in_test_payload(payload.to_json) - alert.send_test_alert + + if send + alert.fill_in_test_payload(payload.to_json) + alert.send_test_alert + else + alert.go_to_view_credentials + credentials = { url: alert.webhook_url, auth_key: alert.authorization_key } + end + end + end + + credentials + end + + def setup_prometheus(payload: { title: random_word, description: random_word }, send: true) + credentials = {} + Page::Project::Menu.perform(&:go_to_monitor_settings) + Page::Project::Settings::Monitor.perform do |setting| + setting.expand_alerts do |alert| + alert.add_new_integration + alert.select_prometheus + alert.activate_integration + alert.fill_in_prometheus_url + alert.save_and_create_alert + + if send + alert.fill_in_test_payload(payload.to_json) + alert.send_test_alert + else + alert.go_to_view_credentials + credentials = { url: alert.webhook_url, auth_key: alert.authorization_key } + end end end + + credentials end private diff --git a/qa/qa/page/component/content_editor.rb b/qa/qa/page/component/content_editor.rb index e9fc575ae39..a9abda42610 100644 --- a/qa/qa/page/component/content_editor.rb +++ b/qa/qa/page/component/content_editor.rb @@ -15,7 +15,6 @@ module QA base.view 'app/assets/javascripts/content_editor/components/toolbar_text_style_dropdown.vue' do element :text_style_dropdown - element :text_style_menu_item end base.view 'app/assets/javascripts/content_editor/components/toolbar_image_button.vue' do @@ -33,9 +32,7 @@ module QA # wait for text style option to become active after typing has_active_element?(:text_style_dropdown, wait: 1) click_element(:text_style_dropdown) - within_element(:text_style_dropdown) do - click_element(:text_style_menu_item, text_style: heading) - end + find_element(:text_style_dropdown).find('li', text: heading).click end end diff --git a/qa/qa/page/component/dropdown.rb b/qa/qa/page/component/dropdown.rb index e6204fb5332..c3e0fefee0d 100644 --- a/qa/qa/page/component/dropdown.rb +++ b/qa/qa/page/component/dropdown.rb @@ -25,6 +25,12 @@ module QA find('span.gl-dropdown-button-text').text end + def all_items + raise NotImplementedError if use_select2? + + find_all("li.gl-dropdown-item").map(&:text) + end + def clear_current_selection_if_present return super if use_select2? @@ -40,7 +46,12 @@ module QA def search_item(item_text) return super if use_select2? - find('div.gl-search-box-by-type input[type="Search"]').set(item_text) + find('div.gl-listbox-search input[type="Search"]').set(item_text) + wait_for_search_to_complete + end + + def send_keys_to_search(item_text) + find('div.gl-listbox-search input[type="Search"]').send_keys(item_text) wait_for_search_to_complete end @@ -103,6 +114,7 @@ module QA def use_select2? @use_select2 ||= has_css?('.select2-container', wait: 1) end + # rubocop:enable Gitlab/PredicateMemoization end end diff --git a/qa/qa/page/component/groups_filter.rb b/qa/qa/page/component/groups_filter.rb index ec59d010718..ea91ced8679 100644 --- a/qa/qa/page/component/groups_filter.rb +++ b/qa/qa/page/component/groups_filter.rb @@ -24,36 +24,29 @@ module QA private + # Check if a group exists in private or public tab + # @param name [String] group name + # @return [Boolean] whether a group with given name exists def has_filtered_group?(name) - # Filter and submit to reload the page and only retrieve the filtered results - find_element(:groups_filter_field).set(name).send_keys(:return) - - # Since we submitted after filtering, the presence of - # groups_list_tree_container means we have the complete filtered list - # of groups - has_element?(:groups_list_tree_container, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME) - # If there are no groups we'll know immediately because we filtered the list - if page.has_text?('No groups or projects matched your search', -wait: 0) || page.has_text?('No groups matched your search', wait: 0) - return false unless has_element?(:public_groups_tab) - - # Try for public groups - click_element(:public_groups_tab) - # Filter and submit to reload the page and only retrieve the filtered results - find_element(:groups_filter_field).set(name).send_keys(:return) - - # Since we submitted after filtering, the presence of - # groups_list_tree_container means we have the complete filtered list - # of groups - has_element?(:groups_list_tree_container, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME) - - return false if page.has_text?('No groups or projects matched your search', -wait: 0) || page.has_text?('No groups matched your search', wait: 0) - end + filter_group(name) + return true if page.has_link?(name, wait: 0) # element containing link to group + + return false unless has_element?(:public_groups_tab, wait: 0) - # The name will be present as filter input so we check for a link, not text + # Check public groups + click_element(:public_groups_tab) + filter_group(name) page.has_link?(name, wait: 0) end + + # Filter by group name + # @param name [String] group name + # @return [Boolean] whether the filter returned any group + def filter_group(name) + fill_element(:groups_filter_field, name).send_keys(:return) + finished_loading? + has_element?(:groups_list_tree_container, wait: 1) + end end end end diff --git a/qa/qa/page/component/invite_members_modal.rb b/qa/qa/page/component/invite_members_modal.rb index 295b5134bd5..eb791594d22 100644 --- a/qa/qa/page/component/invite_members_modal.rb +++ b/qa/qa/page/component/invite_members_modal.rb @@ -41,7 +41,7 @@ module QA click_element :invite_a_group_button end - def add_member(username, access_level = 'Developer') + def add_member(username, access_level = 'Developer', refresh_page: true) open_invite_members_modal within_element(:invite_members_modal_content) do @@ -51,10 +51,10 @@ module QA set_access_level(access_level) end - send_invite + send_invite(refresh_page) end - def invite_group(group_name, access_level = 'Guest') + def invite_group(group_name, access_level = 'Guest', refresh_page: true) open_invite_group_modal within_element(:invite_members_modal_content) do @@ -69,7 +69,13 @@ module QA set_access_level(access_level) end - send_invite + send_invite(refresh_page) + end + + def send_invite(refresh = false) + click_element :invite_button + Support::WaitForRequests.wait_for_requests + page.refresh if refresh end private @@ -78,12 +84,6 @@ module QA # Guest option is selected by default, skipping these steps if desired option is 'Guest' select_element(:access_level_dropdown, access_level) unless access_level == 'Guest' end - - def send_invite - click_element :invite_button - Support::WaitForRequests.wait_for_requests - page.refresh - end end end end diff --git a/qa/qa/page/component/wiki_page_form.rb b/qa/qa/page/component/wiki_page_form.rb index 7a7329e6110..9143a25d9ab 100644 --- a/qa/qa/page/component/wiki_page_form.rb +++ b/qa/qa/page/component/wiki_page_form.rb @@ -17,7 +17,10 @@ module QA base.view 'app/assets/javascripts/vue_shared/components/markdown/markdown_editor.vue' do element :markdown_editor_form_field - element :editing_mode_button + end + + base.view 'app/assets/javascripts/vue_shared/components/markdown/editor_mode_dropdown.vue' do + element :editing_mode_switcher end base.view 'app/assets/javascripts/pages/shared/wikis/components/delete_wiki_modal.vue' do @@ -55,8 +58,9 @@ module QA end def use_new_editor - within_element(:editing_mode_button) do - find('label', text: 'Rich text').click + click_element(:editing_mode_switcher) + within_element(:editing_mode_switcher) do + find('button', text: 'Rich text').click end wait_until(reload: false) do diff --git a/qa/qa/page/file/form.rb b/qa/qa/page/file/form.rb index 2e0f8c59213..d0113d66dec 100644 --- a/qa/qa/page/file/form.rb +++ b/qa/qa/page/file/form.rb @@ -15,7 +15,6 @@ module QA end view 'app/views/projects/blob/_template_selectors.html.haml' do - element :template_type_dropdown element :gitignore_dropdown element :gitlab_ci_yml_dropdown element :dockerfile_dropdown @@ -23,13 +22,20 @@ module QA end def add_name(name) - fill_element(:file_name_field, with: name) + fill_element(:file_name_field, name) end - def select_template(template_type, template) - click_element :template_type_dropdown - click_link template_type + def add_custom_name(template_name) + case template_name + # Name has to be exactly LICENSE for template-type-dropdown to appear + when 'LICENSE' + add_name(template_name.to_s) + else + add_name("#{SecureRandom.hex(8)}/#{template_name}") + end + end + def select_template(template_type, template) case template_type when '.gitignore' click_element :gitignore_dropdown diff --git a/qa/qa/page/group/members.rb b/qa/qa/page/group/members.rb index 39003eb03c1..c7d63b97b4f 100644 --- a/qa/qa/page/group/members.rb +++ b/qa/qa/page/group/members.rb @@ -22,8 +22,12 @@ module QA element :access_level_link end - view 'app/assets/javascripts/members/components/action_buttons/remove_member_button.vue' do - element :delete_member_button + view 'app/assets/javascripts/members/components/action_dropdowns/user_action_dropdown.vue' do + element :user_action_dropdown + end + + view 'app/assets/javascripts/members/components/action_dropdowns/remove_member_dropdown_item.vue' do + element :delete_member_dropdown_item end view 'app/assets/javascripts/members/components/members_tabs.vue' do @@ -41,7 +45,8 @@ module QA def remove_member(username) within_element(:member_row, text: username) do - click_element :delete_member_button + click_element :user_action_dropdown + click_element :delete_member_dropdown_item end within_element(:remove_member_modal) do diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index aacff7c4172..6fd48692730 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -409,6 +409,7 @@ module QA fill_element(:reply_field, '') fill_element(:reply_field, initial_content.gsub(/(```suggestion:-0\+0\n).*(\n```)/, "\\1#{suggestion}\\2")) click_element(:comment_now_button) + wait_for_requests end def apply_suggestion_with_message(message) @@ -434,9 +435,9 @@ module QA end def revert_change! - # retry when the modal doesn't appear for large MRs as the onClick listener is initialized after the click - # https://gitlab.com/gitlab-org/gitlab/-/issues/366336 - retry_on_exception do + # reload page when the revert modal occasionally doesn't appear in ee:large-setup job + # https://gitlab.com/gitlab-org/gitlab/-/issues/386623 (transient issue) + retry_on_exception(reload: true) do click_element(:revert_button, Page::Component::CommitModal) end click_element(:submit_commit_button) diff --git a/qa/qa/page/project/fork/new.rb b/qa/qa/page/project/fork/new.rb index b622b341685..2b36766d996 100644 --- a/qa/qa/page/project/fork/new.rb +++ b/qa/qa/page/project/fork/new.rb @@ -5,6 +5,8 @@ module QA module Project module Fork class New < Page::Base + include ::QA::Page::Component::Dropdown + view 'app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue' do element :fork_project_button element :fork_privacy_button @@ -12,9 +14,6 @@ module QA view 'app/assets/javascripts/pages/projects/forks/new/components/project_namespace.vue' do element :select_namespace_dropdown - element :select_namespace_dropdown_item - element :select_namespace_dropdown_search_field - element :select_namespace_dropdown_item end def fork_project(namespace = Runtime::Namespace.path) @@ -25,20 +24,13 @@ module QA def get_list_of_namespaces click_element(:select_namespace_dropdown) - wait_until(reload: false) do - has_element?(:select_namespace_dropdown_item) - end - all_elements(:select_namespace_dropdown_item, minimum: 1).map(&:text) + all_items end def choose_namespace(namespace) retry_on_exception do click_element(:select_namespace_dropdown) - fill_element(:select_namespace_dropdown_search_field, namespace) - wait_until(reload: false) do - has_element?(:select_namespace_dropdown_item, text: namespace) - end - click_button(namespace) + search_and_select(namespace) end end end diff --git a/qa/qa/page/project/pipeline/new.rb b/qa/qa/page/project/pipeline/new.rb index 1d85d072e34..54c3bb0ddeb 100644 --- a/qa/qa/page/project/pipeline/new.rb +++ b/qa/qa/page/project/pipeline/new.rb @@ -5,7 +5,7 @@ module QA module Project module Pipeline class New < QA::Page::Base - view 'app/assets/javascripts/pipeline_new/components/pipeline_new_form.vue' do + view 'app/assets/javascripts/ci/pipeline_new/components/pipeline_new_form.vue' do element :run_pipeline_button, required: true element :ci_variable_row_container element :ci_variable_key_field diff --git a/qa/qa/page/project/settings/alerts.rb b/qa/qa/page/project/settings/alerts.rb index a74a227d697..7b1d738ec3c 100644 --- a/qa/qa/page/project/settings/alerts.rb +++ b/qa/qa/page/project/settings/alerts.rb @@ -23,6 +23,7 @@ module QA element :save_and_create_alert_button element :test_payload_field element :send_test_alert_button + element :prometheus_url_field end def enable_incident_for_alert @@ -59,10 +60,22 @@ module QA click_element(:integration_name_field) end + def select_prometheus + click_element(:integration_type_dropdown) + find("option[value='PROMETHEUS']").click + + # Click outside of the list to close it + click_element(:prometheus_url_field) + end + def enter_integration_name(name) fill_element(:integration_name_field, name) end + def fill_in_prometheus_url(url = Runtime::Scenario.gitlab_address) + fill_element(:prometheus_url_field, url) + end + def activate_integration within_element(:active_toggle_container) do find('.gl-toggle').click @@ -82,6 +95,18 @@ module QA def send_test_alert click_element(:send_test_alert_button) end + + def go_to_view_credentials + click_link_with_text('View credentials') + end + + def webhook_url + find('input[id="url"]').value + end + + def authorization_key + find('input[id="authorization-key"]').value + end end end end diff --git a/qa/qa/page/project/settings/ci_variables.rb b/qa/qa/page/project/settings/ci_variables.rb index 316920ffa90..8df0aaa9f27 100644 --- a/qa/qa/page/project/settings/ci_variables.rb +++ b/qa/qa/page/project/settings/ci_variables.rb @@ -7,7 +7,7 @@ module QA class CiVariables < Page::Base include QA::Page::Settings::Common - view 'app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue' do + view 'app/assets/javascripts/ci/ci_variable_list/components/ci_variable_modal.vue' do element :ci_variable_key_field element :ci_variable_value_field element :ci_variable_save_button diff --git a/qa/qa/page/project/settings/protected_branches.rb b/qa/qa/page/project/settings/protected_branches.rb index 659fe198d49..3eddd0fd33a 100644 --- a/qa/qa/page/project/settings/protected_branches.rb +++ b/qa/qa/page/project/settings/protected_branches.rb @@ -51,10 +51,15 @@ module QA within_element(:"allowed_to_#{action}_dropdown_content") do click_on allowed[:roles][:description] - allowed[:users].each { |user| click_on user.username } if allowed.key?(:users) - allowed[:groups].each { |group| click_on group.name } if allowed.key?(:groups) + allowed[:users].each { |user| select_name user.username } if allowed.key?(:users) + allowed[:groups].each { |group| select_name group.name } if allowed.key?(:groups) end end + + def select_name(name) + fill_element(:dropdown_input_field, name) + click_on name + end end end end diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb index 168bfd6aa0a..3c2b8d56f1d 100644 --- a/qa/qa/page/project/show.rb +++ b/qa/qa/page/project/show.rb @@ -47,13 +47,12 @@ module QA element :tree_holder, '.tree-holder' # rubocop:disable QA/ElementWithPattern end - view 'app/views/projects/_fork_info.html.haml' do + view 'app/assets/javascripts/repository/components/fork_info.vue' do element :forked_from_link end view 'app/views/projects/buttons/_fork.html.haml' do - element :fork_label, "%span= s_('ProjectOverview|Fork')" # rubocop:disable QA/ElementWithPattern - element :fork_link, "link_to new_project_fork_path(@project)" # rubocop:disable QA/ElementWithPattern + element :fork_button end view 'app/views/projects/empty.html.haml' do @@ -97,8 +96,12 @@ module QA click_element :new_file_menu_item end + # Click by JS is needed to bypass the VSCode Web IDE popover + # Change back to regular click_element when vscode_web_ide FF is removed + # Rollout issue: https://gitlab.com/gitlab-org/gitlab/-/issues/371084 def fork_project - click_on 'Fork' + fork_button = find_element(:fork_button) + click_by_javascript(fork_button) end def forked_from?(parent_project_name) diff --git a/qa/qa/page/project/web_ide/vscode.rb b/qa/qa/page/project/web_ide/vscode.rb new file mode 100644 index 00000000000..dd5222cfd93 --- /dev/null +++ b/qa/qa/page/project/web_ide/vscode.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# VSCode WebIDE is built off an iFrame application therefore we are uanble to use `qa-selectors` +module QA + module Page + module Project + module WebIDE + class VSCode < Page::Base + # Use to Pass Test::Sanity::Selectors temporarily until iframe [data-qa-* selector added + view 'app/views/shared/_broadcast_message.html.haml' do + element :broadcast_notification_container + element :close_button + end + + # Used for stablility, due to feature_caching of vscode_web_ide + def wait_for_ide_to_load + page.driver.browser.switch_to.window(page.driver.browser.window_handles.last) + wait_for_requests + Support::Waiter.wait_until(max_duration: 60, reload_page: page, retry_on_exception: true) do + within_vscode_editor do + # vscode file_explorer element + page.has_css?('.explorer-folders-view', visible: true) + end + end + end + + def within_vscode_editor(&block) + iframe = find('#ide iframe') + page.within_frame(iframe, &block) + end + + def create_new_folder(name) + within_vscode_editor do + # Use for stability, WebIDE inside an iframe is finnicky + Support::Waiter.wait_until(max_duration: 60, retry_on_exception: true) do + page.find('.explorer-folders-view').right_click + # new_folder_button + page.has_css?('[aria-label="New Folder..."]', visible: true) + end + + # Additonal wait for stability, webdriver sometimes moves too fast + Support::Waiter.wait_until(max_duration: 60, retry_on_exception: true) do + page.find('[aria-label="New Folder..."]').click + # Verify New Folder button is triggered and textbox is waiting for input + page.find('.explorer-item-edited', visible: true) + send_keys(name, :enter) + page.has_content?(name) + end + end + end + + def commit_and_push(folder_name) + within_vscode_editor do + # Commit Tab + page.find('a.codicon-source-control-view-icon').click + send_keys(folder_name) + page.has_content?(folder_name) + + # Commit Button + page.find('a.monaco-description-button').click + page.has_css?('.notification-list-item-details-row', visible: true) + end + end + end + end + end + end +end diff --git a/qa/qa/resource/api_fabricator.rb b/qa/qa/resource/api_fabricator.rb index d82109c1d54..44520b04e9a 100644 --- a/qa/qa/resource/api_fabricator.rb +++ b/qa/qa/resource/api_fabricator.rb @@ -104,7 +104,7 @@ module QA raise ResourceNotFoundError, "Resource at #{request.mask_url} could not be found (#{response.code}): `#{response}`.\n#{QA::Support::Loglinking.failure_metadata(response.headers[:x_request_id])}" end - @api_fabrication_http_method = :get # rubocop:disable Gitlab/ModuleWithInstanceVariables + @api_fabrication_http_method ||= :get # rubocop:disable Gitlab/ModuleWithInstanceVariables response end diff --git a/qa/qa/resource/base.rb b/qa/qa/resource/base.rb index 00c002cae9c..2abe1904c92 100644 --- a/qa/qa/resource/base.rb +++ b/qa/qa/resource/base.rb @@ -96,11 +96,7 @@ module QA result = yield.tap do fabrication_time = Time.now - start fabrication_http_method = if resource.api_fabrication_http_method == :get || resource.retrieved_from_cache - if include?(Reusable) - "Retrieved for reuse" - else - "Retrieved" - end + "Retrieved" else "Built" end diff --git a/qa/qa/resource/group_base.rb b/qa/qa/resource/group_base.rb index c5b1a4ecea0..5e2a567119d 100644 --- a/qa/qa/resource/group_base.rb +++ b/qa/qa/resource/group_base.rb @@ -16,7 +16,8 @@ module QA :name, :full_path, # Add visibility to enable create private group - :visibility + :visibility, + :shared_with_groups # Get group projects # @@ -140,7 +141,8 @@ module QA :require_two_factor_authentication, :share_with_group_lock, :subgroup_creation_level, - :two_factor_grace_perion + :shared_with_groups, + :two_factor_grace_period # TODO: Add back visibility comparison once https://gitlab.com/gitlab-org/gitlab/-/issues/331252 is fixed # :visibility ) diff --git a/qa/qa/resource/group_runner.rb b/qa/qa/resource/group_runner.rb new file mode 100644 index 00000000000..d7fa26a1d53 --- /dev/null +++ b/qa/qa/resource/group_runner.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module QA + module Resource + class GroupRunner < RunnerBase + attribute :group do + Resource::Group.fabricate_via_api! do |resource| + resource.name = "group-with-ci-cd-#{SecureRandom.hex(8)}" + resource.description = 'Group with CI/CD Pipelines' + end + end + + attribute :token do + group.runners_token + rescue NoValueError + group.reload!.runners_token + end + + private + + def runner(**kwargs) + fail_msg = "Wait for runner '#{name}' to register in group '#{group.name}'" + Support::Retrier.retry_until(max_duration: 60, sleep_interval: 1, message: fail_msg) do + auto_paginated_response(request_url("/runners", **kwargs)).find { |runner| runner[:description] == name } + end + end + end + end +end diff --git a/qa/qa/resource/issue.rb b/qa/qa/resource/issue.rb index 2e18e1d0323..15c2c25757f 100644 --- a/qa/qa/resource/issue.rb +++ b/qa/qa/resource/issue.rb @@ -65,6 +65,10 @@ module QA end end + def api_related_mrs_path + "#{api_get_path}/related_merge_requests" + end + def set_issue_assignees(assignee_ids:) put_body = { assignee_ids: assignee_ids } response = put Runtime::API::Request.new(api_client, api_put_path).url, put_body @@ -79,6 +83,13 @@ module QA QA::Runtime::Logger.debug("Successfully updated issue assignees to #{assignee_ids}") end + # Related merge requests + # + # @return [Array<Hash>] + def related_merge_requests + parse_body(api_get_from(api_related_mrs_path)) + end + protected # Return subset of fields for comparing issues diff --git a/qa/qa/resource/merge_request.rb b/qa/qa/resource/merge_request.rb index d1d99393ca2..50ef9538fb0 100644 --- a/qa/qa/resource/merge_request.rb +++ b/qa/qa/resource/merge_request.rb @@ -6,27 +6,27 @@ module QA include ApprovalConfiguration attr_accessor :approval_rules, - :source_branch, - :target_new_branch, - :update_existing_file, - :assignee, - :milestone, - :labels, - :file_name, - :file_content, - :reviewer_ids + :source_branch, + :target_new_branch, + :update_existing_file, + :assignee, + :milestone, + :labels, + :file_name, + :file_content, + :reviewer_ids attr_writer :no_preparation, - :wait_for_merge, - :template + :wait_for_merge, + :template attributes :iid, - :title, - :description, - :merge_when_pipeline_succeeds, - :merge_status, - :state, - :reviewers + :title, + :description, + :merge_when_pipeline_succeeds, + :merge_status, + :state, + :reviewers attribute :project do Project.fabricate_via_api! do |resource| @@ -143,6 +143,13 @@ module QA } end + # Get merge request reviews + # + # @return [Array<Hash>] + def reviews + parse_body(api_get_from(api_reviewers_path)) + end + def merge_via_api! Support::Waiter.wait_until(sleep_interval: 1) do QA::Runtime::Logger.debug("Waiting until merge request with id '#{iid}' can be merged") @@ -179,7 +186,7 @@ module QA def fabricate_large_merge_request @project = Resource::ImportProject.fabricate_via_browser_ui! # Setting the name here, since otherwise some tests will look for an existing file in - # the proejct without ever knowing what is in it. + # the project without ever knowing what is in it. @file_name = "added_file-00000000.txt" @source_branch = "large_merge_request" visit("#{project.web_url}/-/merge_requests/1") diff --git a/qa/qa/resource/project.rb b/qa/qa/resource/project.rb index 3cbc002fa86..3f42c6b649e 100644 --- a/qa/qa/resource/project.rb +++ b/qa/qa/resource/project.rb @@ -10,25 +10,25 @@ module QA include ApprovalConfiguration attr_accessor :initialize_with_readme, - :auto_devops_enabled, - :github_personal_access_token, - :github_repository_path, - :gitlab_repository_path, - :personal_namespace + :auto_devops_enabled, + :github_personal_access_token, + :github_repository_path, + :gitlab_repository_path, + :personal_namespace attr_reader :repository_storage attributes :id, - :name, - :path, - :add_name_uuid, - :runners_token, - :visibility, - :template_name, - :import, - :import_status, - :import_error, - :description + :name, + :path, + :add_name_uuid, + :runners_token, + :visibility, + :template_name, + :import, + :import_status, + :import_error, + :description attribute :group do Group.fabricate! do |group| @@ -43,7 +43,7 @@ module QA alias_method :full_path, :path_with_namespace def sandbox_path - return '' if personal_namespace || !group.respond_to?('sandbox') + return '' if personal_namespace || !group.respond_to?(:sandbox) "#{group.sandbox.path}/" end @@ -450,6 +450,14 @@ module QA parse_body(response) end + # Fetch project specific runners + # + # @param [Hash] **kwargs optional query arguments, see: https://docs.gitlab.com/ee/api/runners.html#list-projects-runners + # @return [Array] + def runners(**kwargs) + auto_paginated_response(request_url(api_runners_path, **kwargs)) + end + # Uses the API to wait until a pull mirroring update is successful (pull mirroring is treated as an import) def wait_for_pull_mirroring mirror_succeeded = Support::Retrier.retry_until( diff --git a/qa/qa/resource/project_runner.rb b/qa/qa/resource/project_runner.rb new file mode 100644 index 00000000000..173b17550c7 --- /dev/null +++ b/qa/qa/resource/project_runner.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module QA + module Resource + class ProjectRunner < RunnerBase + attribute :project do + Project.fabricate_via_api! do |resource| + resource.name = 'project-with-ci-cd' + resource.description = 'Project with CI/CD Pipelines' + end + end + + attribute :token do + project.runners_token + rescue NoValueError + project.reload!.runners_token + end + + private + + def runner(**kwargs) + fail_msg = "Wait for runner '#{name}' to register in project '#{project.name}'" + Support::Retrier.retry_until(max_duration: 60, sleep_interval: 1, message: fail_msg) do + project.runners(**kwargs).find { |runner| runner[:description] == name } + end + end + end + end +end diff --git a/qa/qa/resource/reusable.rb b/qa/qa/resource/reusable.rb deleted file mode 100644 index 536f70b50b4..00000000000 --- a/qa/qa/resource/reusable.rb +++ /dev/null @@ -1,163 +0,0 @@ -# frozen_string_literal: true - -module QA - module Resource - # - # This module includes methods that allow resource classes to be reused safely. It should be prepended to a new - # reusable version of an existing resource class. See Resource::Project and ReusableResource::Project for an example. - # Reusable resource classes must also be registered with a resource collection that will manage cleanup. - # - # @example Register a resource class with a collection - # QA::Resource::ReusableCollection.register_resource_classes do |collection| - # QA::Resource::ReusableProject.register(collection) - # end - module Reusable - attr_accessor :reuse, - :reuse_as - - ResourceReuseError = Class.new(RuntimeError) - - def self.prepended(base) - base.extend(ClassMethods) - end - - # Gets an existing resource if it exists and the specified attributes of the resource are valid. - # Creates a new instance of the resource if it does not exist. - # - # @return [String] The URL of the resource. - def fabricate_via_api! - validate_reuse_preconditions - - resource_web_url(api_get) - rescue Errors::ResourceNotFoundError - super - ensure - self.class.resources[reuse_as] ||= { - tests: Set.new, - resource: self - } - - self.class.resources[reuse_as][:attributes] ||= all_attributes.index_with do |attribute_name| - instance_variable_get("@#{attribute_name}") - end - self.class.resources[reuse_as][:tests] << Runtime::Example.location - end - - # Overrides remove_via_api! to log a debug message stating that removal will happen after the suite completes. - # - # @return [nil] - def remove_via_api! - QA::Runtime::Logger.debug("#{self.class.name} - deferring removal until after suite") - end - - # Object comparison - # - # @param [QA::Resource::Base] other - # @return [Boolean] - def ==(other) - self.class <= other.class && comparable == other.comparable - end - - # Confirms that reuse of the resource did not change it in a way that breaks later reuse. - # For example, this should fail if a reusable resource should have a specific name, but the name has been changed. - def validate_reuse - QA::Runtime::Logger.debug(["Validating a #{self.class.name} that was reused as #{reuse_as}", identifier].compact.join(' ')) - - fresh_resource = reference_resource - diff = reuse_validation_diff(fresh_resource) - - if diff.present? - raise ResourceReuseError, <<~ERROR - The reused #{self.class.name} resource does not have the attributes expected. - The following change was found: #{diff}" - The resource's web_url is #{web_url}. - It was used in these tests: #{self.class.resources[reuse_as][:tests].to_a.join(', ')} - ERROR - end - - ensure - fresh_resource.remove_via_api! - end - - private - - # Creates a new resource that can be compared to a reused resource, using the post body of the original. - # Must be implemented by classes that include this module. - def reference_resource - return super if defined?(super) - - raise NotImplementedError - end - - # Confirms that the resource attributes specified in its fabricate_via_api! block will allow it to be reused. - # - # @return [nil] returns nil unless an error is raised - def validate_reuse_preconditions - return unless self.class.resources.key?(reuse_as) - - attributes = unique_identifiers.each_with_object({ proposed: {}, existing: {} }) do |id, attrs| - proposed = public_send(id) - existing = self.class.resources[reuse_as][:resource].public_send(id) - - next if proposed == existing - - attrs[:proposed][id] = proposed - attrs[:existing][id] = existing - end - - unless attributes[:proposed].empty? && attributes[:existing].empty? - raise ResourceReuseError, "Reusable resources must use the same unique identifier(s). " \ - "The #{self.class.name} to be reused as :#{reuse_as} has the identifier(s) #{attributes[:proposed]} " \ - "but it should have #{attributes[:existing]}" - end - end - - # Compares the attributes of the current reused resource with a reference instance. - # - # @return [Hash] any differences between the resources. - def reuse_validation_diff(other) - original, reference = prepare_reuse_validation_diff(other) - - return if original == reference - - diff_values = original.to_a - reference.to_a - diff_values.to_h - end - - # Compares the current reusable resource to a reference instance, ignoring identifying unique attributes that - # had to be changed. - # - # @return [Hash, Hash] the current and reference resource attributes, respectively. - def prepare_reuse_validation_diff(other) - original = self.reload!.comparable - reference = other.reload!.comparable - unique_identifiers.each { |id| reference[id] = original[id] } - [original, reference] - end - - # The attributes of the resource that should be the same whenever a test wants to reuse a resource. Must be - # implemented by classes that include this module. - # - # @return [Array<Symbol>] the attribute names. - def unique_identifiers - return super if defined?(super) - - raise NotImplementedError - end - - module ClassMethods - # Includes the resources created/reused by this class in the specified collection - def register(collection) - collection[self.name] = resources - end - - # The resources created/reused by this resource class. - # - # @return [Hash<Symbol, Hash>] the resources created/reused by this resource class. - def resources - @resources ||= {} - end - end - end - end -end diff --git a/qa/qa/resource/reusable_collection.rb b/qa/qa/resource/reusable_collection.rb deleted file mode 100644 index 99a55800d1c..00000000000 --- a/qa/qa/resource/reusable_collection.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -require 'singleton' - -module QA - module Resource - # - # This singleton class collects all reusable resources used by tests and allows operations to be performed on them - # all. For example, verifying their state after tests have run and might have changed them. - # - class ReusableCollection - include Singleton - - attr_accessor :resource_classes - - def initialize - @resource_classes = {} - end - - # Yields each resource in the collection. - # - # @yieldparam [Symbol] reuse_as the name that identifies the resource instance. - # @yieldparam [QA::Resource] reuse_instance the resource. - def each_resource - resource_classes.each_value do |reuse_instances| - reuse_instances.each do |reuse_as, reuse_instance| - yield reuse_as, reuse_instance[:resource] - end - end - end - - class << self - # Removes all created resources that are included in the collection. - def remove_all_via_api! - instance.each_resource do |reuse_as, resource| - next QA::Runtime::Logger.debug("#{resource.class.name} reused as :#{reuse_as} has already been removed.") unless resource.exists? - - if resource.respond_to?(:marked_for_deletion?) && resource.marked_for_deletion? - next QA::Runtime::Logger.debug("#{resource.class.name} reused as :#{reuse_as} is already scheduled to be removed.") - end - - resource.method(:remove_via_api!).super_method.call - end - end - - # Validates the reuse of each resource as defined by the resource class of each resource in the collection. - def validate_resource_reuse - instance.each_resource { |_, resource| resource.validate_reuse } - end - - # Yields the collection of resources to allow resource classes to register themselves with the collection. - # - # @yieldparam [Hash] resource_classes the resource classes in the collection. - def register_resource_classes - yield instance.resource_classes - end - end - end - end -end diff --git a/qa/qa/resource/reusable_group.rb b/qa/qa/resource/reusable_group.rb deleted file mode 100644 index 05ff38249f6..00000000000 --- a/qa/qa/resource/reusable_group.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -module QA - module Resource - class ReusableGroup < Group - prepend Reusable - - def initialize - super - - @name = @path = QA::Runtime::Env.reusable_group_path - @description = "QA reusable group" - @reuse_as = :default_group - end - - private - - # Creates a new group that can be compared to a reused group, using the attributes of the original. Attributes that - # must be unique (path and name) are replaced with new unique values. - # - # @return [QA::Resource] a new instance of Resource::ReusableGroup that should be a copy of the original resource - def reference_resource - attributes = self.class.resources[reuse_as][:attributes] - name = "ref#{SecureRandom.hex(8)}_#{attributes.delete(:path)}"[0...MAX_NAME_LENGTH] - - Group.fabricate_via_api! do |resource| - self.class.resources[reuse_as][:attributes].each do |attribute_name, attribute_value| - resource.instance_variable_set("@#{attribute_name}", attribute_value) if attribute_value - end - resource.path = name - resource.name = name - end - end - - # The attributes of the resource that should be the same whenever a test wants to reuse a group. - # - # @return [Array<Symbol>] the attribute names. - def unique_identifiers - [:name, :path] - end - end - end -end diff --git a/qa/qa/resource/reusable_project.rb b/qa/qa/resource/reusable_project.rb deleted file mode 100644 index 8a12c25b6f0..00000000000 --- a/qa/qa/resource/reusable_project.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -module QA - module Resource - class ReusableProject < Project - prepend Reusable - - attribute :group do - ReusableGroup.fabricate_via_api! do |resource| - resource.api_client = api_client - end - end - - def initialize - super - - @add_name_uuid = false - @name = @path = QA::Runtime::Env.reusable_project_path - @reuse_as = :default_project - @initialize_with_readme = true - end - - private - - # Creates a new project that can be compared to a reused project, using the attributes of the original. Attributes - # that must be unique (path and name) are replaced with new unique values. - # - # @return [QA::Resource] a new instance of Resource::ReusableProject that should be a copy of the original resource - def reference_resource - attributes = self.class.resources[reuse_as][:attributes] - name = "reference_resource_#{SecureRandom.hex(8)}_for_#{attributes.delete(:name)}" - - Project.fabricate_via_api! do |project| - self.class.resources[reuse_as][:attributes].each do |attribute_name, attribute_value| - project.instance_variable_set("@#{attribute_name}", attribute_value) if attribute_value - end - project.name = name - project.path = name - project.path_with_namespace = "#{project.group.full_path}/#{project.name}" - end - end - - # The attributes of the resource that should be the same whenever a test wants to reuse a project. - # - # @return [Array<Symbol>] the attribute names. - def unique_identifiers - [:name, :path] - end - end - end -end diff --git a/qa/qa/resource/runner.rb b/qa/qa/resource/runner.rb deleted file mode 100644 index 3c74d8de21a..00000000000 --- a/qa/qa/resource/runner.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -module QA - module Resource - class Runner < Base - attributes :id, - :active, - :paused, - :runner_type, - :online, - :status, - :ip_address, - :token, - :tags, - :config, - :run_untagged, - :name, # This attribute == runner[:description] - :image, - :executor, - :executor_image - - attribute :project do - Project.fabricate_via_api! do |resource| - resource.name = 'project-with-ci-cd' - resource.description = 'Project with CI/CD Pipelines' - end - end - - def initialize - @tags = nil - @config = nil - @run_untagged = nil - @name = "qa-runner-#{SecureRandom.hex(4)}" - @image = 'registry.gitlab.com/gitlab-org/gitlab-runner:alpine' - @executor = :shell - @executor_image = 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7' - end - - # Initially we only support fabricate - # via API - def fabricate! - fabricate_via_api! - end - - # Start container and register runner - # Fetch via API and populate attributes - # - def fabricate_via_api! - start_container_and_register - populate_runner_attributes - end - - def remove_via_api! - super - ensure - @docker_container.remove! - end - - def reload! - populate_runner_attributes - end - - def api_delete_path - "/runners/#{id}" - end - - def api_get_path - "/runners" - end - - def api_post_path - "/runners" - end - - def api_post_body; end - - def not_found_by_tags? - url = "#{api_get_path}?tag_list=#{tags.compact.join(',')}" - auto_paginated_response(request_url(url)).empty? - end - - def runners_list - runners_list = nil - url = tags ? "#{api_get_path}?tag_list=#{tags.compact.join(',')}" : api_get_path - Runtime::Logger.info('Looking for list of runners via API...') - Support::Retrier.retry_until(max_duration: 60, sleep_interval: 1) do - runners_list = auto_paginated_response(request_url(url)) - runners_list.present? - end - - runners_list - end - - def wait_until_online - Runtime::Logger.info('Waiting for runner to come online...') - Support::Retrier.retry_until(max_duration: 60, sleep_interval: 1) do - this_runner[:status] == 'online' - end - end - - def restart - Runtime::Logger.info("Restarting runner container #{name}...") - @docker_container.restart - wait_until_online - end - - private - - def start_container_and_register - @docker_container = Service::DockerRun::GitlabRunner.new(name).tap do |runner| - Support::Retrier.retry_on_exception(sleep_interval: 5) do - runner.pull - end - - runner.token = @token ||= project.runners_token - runner.address = Runtime::Scenario.gitlab_address - runner.tags = tags if tags - runner.image = image - runner.config = config if config - runner.executor = executor - runner.executor_image = executor_image if executor == :docker - runner.run_untagged = run_untagged if run_untagged - runner.register! - end - end - - def this_runner - runner = nil - Support::Retrier.retry_until(max_duration: 60, sleep_interval: 1) do - runner = runners_list.find { |runner| runner[:description] == name } - !runner.nil? - end - runner - end - - def populate_runner_attributes - runner = this_runner - @id = runner[:id] - @active = runner[:active] - @paused = runner[:paused] - @runner_type = runner[:typed] - @online = runner[:online] - @status = runner[:status] - @ip_address = runner[:ip_address] - end - end - end -end diff --git a/qa/qa/resource/runner_base.rb b/qa/qa/resource/runner_base.rb new file mode 100644 index 00000000000..7580aa108c9 --- /dev/null +++ b/qa/qa/resource/runner_base.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true + +module QA + module Resource + class RunnerBase < Base + attr_accessor :run_untagged, + :image, + :executor, + :executor_image, + :tags, + :config + + attributes :id, + :active, + :paused, + :runner_type, + :online, + :status, + :ip_address, + :description, + :name, + :is_shared, + :contacted_at, + :platform, + :architecture, + :projects, + :revision, + :tag_list, + :version, + :access_level, + :maximum_timeout + + def initialize + @tags = nil + @config = nil + @run_untagged = nil + @name = "qa-runner-#{SecureRandom.hex(4)}" + @image = 'registry.gitlab.com/gitlab-org/gitlab-runner:alpine' + @executor = :shell + @executor_image = 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7' + end + + # Initially we only support fabricate via API + def fabricate! + fabricate_via_api! + end + + # Start container and register runner + # Fetch via API and populate attributes + # + def fabricate_via_api! + api_get + rescue NoValueError + # Start container on initial fabrication and populate all attributes once id is known + # see: https://docs.gitlab.com/ee/api/runners.html#get-runners-details + start_container_and_register + api_get + end + + def remove_via_api! + super + ensure + @docker_container.remove! + @docker_container = nil + end + + def api_get_path + "/runners/#{id}" + end + + def api_post_path + "/runners" + end + + def api_delete_path + api_get_path + end + + def api_post_body; end + + def wait_until_online + Runtime::Logger.info('Waiting for runner to come online...') + Support::Retrier.retry_until(max_duration: 60, sleep_interval: 1) do + reload! && status == 'online' + end + end + + def restart + Runtime::Logger.info("Restarting runner container #{name}...") + @docker_container.restart + wait_until_online + end + + private + + def start_container_and_register + @docker_container ||= Service::DockerRun::GitlabRunner.new(name).tap do |runner| + Support::Retrier.retry_on_exception(sleep_interval: 5) do + runner.pull + end + + runner.token = token + runner.address = Runtime::Scenario.gitlab_address + runner.tags = tags if tags + runner.image = image + runner.config = config if config + runner.executor = executor + runner.executor_image = executor_image if executor == :docker + runner.run_untagged = run_untagged if run_untagged + runner.register! + end + populate_initial_id + rescue StandardError => e + @docker_container&.remove! + raise(e) + end + + def populate_initial_id + tag_list = tags ? { tag_list: tags.compact.join(',') } : {} + runner = runner(**tag_list) + @id = runner[:id] + end + + def runner(**kwargs) + raise("Not implemented!") + end + end + end +end diff --git a/qa/qa/runtime/application_settings.rb b/qa/qa/runtime/application_settings.rb index 55a5ae9d06c..5aeab922a12 100644 --- a/qa/qa/runtime/application_settings.rb +++ b/qa/qa/runtime/application_settings.rb @@ -2,6 +2,8 @@ module QA module Runtime + # TODO: Ideally this should be changed to a normal class due to now being able to override what api client is used + # class ApplicationSettings class << self include Support::API @@ -13,26 +15,30 @@ module QA # #set({ allow_local_requests_from_web_hooks_and_services: true }) # #set(allow_local_requests_from_web_hooks_and_services: true) # https://docs.gitlab.com/ee/api/settings.html - def set_application_settings(**application_settings) - @original_application_settings = get_application_settings + def set_application_settings(api_client: admin_api_client, **application_settings) + @original_application_settings = get_application_settings(api_client: api_client) QA::Runtime::Logger.info("Setting application settings: #{application_settings}") r = put(Runtime::API::Request.new(api_client, APPLICATION_SETTINGS_PATH).url, **application_settings) - raise "Couldn't set application settings #{application_settings.inspect}" unless r.code == QA::Support::API::HTTP_STATUS_OK + return if r.code == QA::Support::API::HTTP_STATUS_OK + + raise "Couldn't set application settings #{application_settings.inspect}" end - def get_application_settings + def get_application_settings(api_client: admin_api_client) parse_body(get(Runtime::API::Request.new(api_client, APPLICATION_SETTINGS_PATH).url)) end + # TODO: This class probably needs to be refactored because this method relies on original settings to have been + # populated sometime in the past and there is no guarantee original settings instance variable is still valid def restore_application_settings(*application_settings_keys) set_application_settings(**@original_application_settings.slice(*application_settings_keys)) end private - def api_client - @api_client ||= Runtime::API::Client.as_admin + def admin_api_client + @admin_api_client ||= Runtime::API::Client.as_admin rescue API::Client::AuthorizationError => e raise "Administrator access is required to set application settings. #{e.message}" end diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index af1a4e06473..faf2023f7c2 100644 --- a/qa/qa/runtime/browser.rb +++ b/qa/qa/runtime/browser.rb @@ -96,12 +96,11 @@ module QA capabilities['goog:chromeOptions'][:args] << 'disable-dev-shm-usage' if QA::Runtime::Env.disable_dev_shm? # Set chrome default download path - if QA::Runtime::Env.chrome_default_download_path - capabilities['goog:chromeOptions'][:prefs] = { - 'download.default_directory' => File.expand_path(QA::Runtime::Env.chrome_default_download_path), - 'download.prompt_for_download' => false - } - end + + capabilities['goog:chromeOptions'][:prefs] = { + 'download.default_directory' => File.expand_path(QA::Runtime::Env.chrome_default_download_path), + 'download.prompt_for_download' => false + } # Specify the user-agent to allow challenges to be bypassed # See https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11938 diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index d4d9ffe62e6..e952c0337f2 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -237,6 +237,10 @@ module QA ENV['GITLAB_QA_PASSWORD_1'] end + def gitlab_qa_access_token_1 + ENV['GITLAB_QA_ACCESS_TOKEN_1'] + end + def gitlab_qa_username_2 ENV['GITLAB_QA_USERNAME_2'] || 'gitlab-qa-user2' end @@ -406,14 +410,6 @@ module QA ENV.fetch('GITLAB_QA_LOOP_RUNNER_MINUTES', 1).to_i end - def reusable_project_path - ENV.fetch('QA_REUSABLE_PROJECT_PATH', 'reusable_project') - end - - def reusable_group_path - ENV.fetch('QA_REUSABLE_GROUP_PATH', 'reusable_group') - end - def mailhog_hostname ENV['MAILHOG_HOSTNAME'] end @@ -503,7 +499,7 @@ module QA end def chrome_default_download_path - ENV['DEFAULT_CHROME_DOWNLOAD_PATH'] + ENV['DEFAULT_CHROME_DOWNLOAD_PATH'] || Dir.tmpdir end private diff --git a/qa/qa/runtime/path.rb b/qa/qa/runtime/path.rb index 3169c5dd743..fd451f2df19 100644 --- a/qa/qa/runtime/path.rb +++ b/qa/qa/runtime/path.rb @@ -8,6 +8,10 @@ module QA def qa_root ::File.expand_path('../../', __dir__) end + + def fixtures_path + ::File.expand_path('../fixtures', __dir__) + end end end end diff --git a/qa/qa/service/docker_run/base.rb b/qa/qa/service/docker_run/base.rb index 65ebe09eeea..bf85b640586 100644 --- a/qa/qa/service/docker_run/base.rb +++ b/qa/qa/service/docker_run/base.rb @@ -55,7 +55,9 @@ module QA end def pull - shell "docker pull #{@image}" + Support::Retrier.retry_until(retry_on_exception: true, sleep_interval: 3) do + shell "docker pull #{@image}" + end end def host_name diff --git a/qa/qa/service/docker_run/gitlab_runner.rb b/qa/qa/service/docker_run/gitlab_runner.rb index 7a62951a2f6..d6d1a085b77 100644 --- a/qa/qa/service/docker_run/gitlab_runner.rb +++ b/qa/qa/service/docker_run/gitlab_runner.rb @@ -36,6 +36,8 @@ module QA end def register! + raise("Missing runner token value!") unless token + cmd = <<~CMD.tr("\n", ' ') docker run -d --rm --network #{runner_network} --name #{@name} #{'-v /var/run/docker.sock:/var/run/docker.sock' if @executor == :docker} diff --git a/qa/qa/service/docker_run/smocker.rb b/qa/qa/service/docker_run/smocker.rb index 83ab58887da..b48f8aa84e3 100644 --- a/qa/qa/service/docker_run/smocker.rb +++ b/qa/qa/service/docker_run/smocker.rb @@ -7,24 +7,43 @@ module QA def initialize @image = 'thiht/smocker:0.17.1' @name = 'smocker-server' - @public_port = '8080' - @admin_port = '8081' + @public_port = 8080 + @admin_port = 8081 super @network_cache = network end - def host_name - return '127.0.0.1' unless QA::Runtime::Env.running_in_ci? || QA::Runtime::Env.qa_hostname + # @param wait [Integer] seconds to wait for server + # @yieldparam [SmockerApi] the api object ready for interaction + def self.init(wait: 10) + if @container.nil? + @container = new + @container.register! + @container.wait_for_running - "#{@name}.#{@network_cache}" + @api = Vendor::Smocker::SmockerApi.new( + host: @container.host_name, + public_port: @container.public_port, + admin_port: @container.admin_port + ) + @api.wait_for_ready(wait: wait) + end + + yield @api end - def base_url - "http://#{host_name}:#{@public_port}" + def self.teardown! + @container&.remove! + @container = nil + @api = nil end - def admin_url - "http://#{host_name}:#{@admin_port}" + attr_reader :public_port, :admin_port + + def host_name + return '127.0.0.1' unless QA::Runtime::Env.running_in_ci? || QA::Runtime::Env.qa_hostname + + "#{@name}.#{@network_cache}" end def wait_for_running diff --git a/qa/qa/service/kubernetes_cluster.rb b/qa/qa/service/kubernetes_cluster.rb index 59bfacf9195..5362124bee5 100644 --- a/qa/qa/service/kubernetes_cluster.rb +++ b/qa/qa/service/kubernetes_cluster.rb @@ -20,12 +20,6 @@ module QA @provider.validate_dependencies @provider.setup - @api_url = fetch_api_url - - credentials = @provider.filter_credentials(fetch_credentials) - @ca_certificate = Base64.decode64(credentials.dig('data', 'ca.crt')) - @token = Base64.decode64(credentials.dig('data', 'token')) - self end @@ -46,7 +40,7 @@ module QA end def create_secret(secret, secret_name) - shell("kubectl create secret generic #{secret_name} --from-literal=token='#{secret}'") + shell("kubectl create secret generic #{secret_name} --from-literal=token='#{secret}'", mask_secrets: [secret]) end def apply_manifest(manifest) diff --git a/qa/qa/specs/features/api/1_manage/import/import_github_repo_spec.rb b/qa/qa/specs/features/api/1_manage/import/import_github_repo_spec.rb index 27f9bcc9675..a10e95a860c 100644 --- a/qa/qa/specs/features/api/1_manage/import/import_github_repo_spec.rb +++ b/qa/qa/specs/features/api/1_manage/import/import_github_repo_spec.rb @@ -9,10 +9,7 @@ module QA context 'when imported via api' do it 'imports project', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347670' do - imported_project.reload! # import the project - - expect { imported_project.project_import_status[:import_status] }.to eventually_eq('finished') - .within(max_duration: 240, sleep_interval: 1) + expect_project_import_finished_successfully aggregate_failures do verify_status_data @@ -30,15 +27,18 @@ module QA def verify_status_data stats = imported_project.project_import_status.dig(:stats, :imported) - expect(stats).to include( + expect(stats).to eq( issue: 1, + issue_event: 16, + pull_request: 1, + pull_request_review: 2, + pull_request_review_request: 1, + diff_note: 1, label: 9, milestone: 1, note: 3, - pull_request: 1, - pull_request_review: 1, - diff_note: 1, - release: 1 + release: 1, + protected_branch: 2 ) end @@ -154,7 +154,10 @@ module QA [ "*Created by: gitlab-qa-github*\n\n**Review:** Commented\n\nGood but needs some improvement", "*Created by: gitlab-qa-github*\n\n```suggestion:-0+0\nProject for GitHub import test to GitLab\r\n```", - "*Created by: gitlab-qa-github*\n\nSome test PR comment" + "*Created by: gitlab-qa-github*\n\nSome test PR comment", + "*Created by: gitlab-qa*\n\n**Review:** Approved", + "assigned to @#{user.username}", + "requested review from @#{user.username}" ] ) expect(events).to match_array( @@ -163,6 +166,19 @@ module QA { name: "add_milestone", label: "0.0.1" } ] ) + # TODO: reenable once https://gitlab.com/gitlab-org/gitlab/-/issues/386714 fixed + # currently this doesn't work as expected if reviewer is not matched by public email + # event for assigning approver is created with reviewer being user doing import but mr actually doesn't + # contain reviewers or the approved state + # + # reviews = merge_request.reviews.map do |review| + # { + # id: review.dig(:user, :id), + # username: review.dig(:user, :username), + # state: review[:state] + # } + # end + # expect(reviews).to eq([{ id: user.id, username: user.username, state: "approved" }]) end def verify_release_import @@ -183,7 +199,7 @@ module QA # @param [QA::Resource::Issuable] issuable # @return [Array] def fetch_events_and_comments(issuable) - comments = issuable.comments.map { |comment| comment[:body] } + comments = issuable.comments.pluck(:body) events = [ *issuable.label_events.map { |e| { name: "#{e[:action]}_label", label: e.dig(:label, :name) } }, *issuable.state_events.map { |e| { name: e[:state] } }, diff --git a/qa/qa/specs/features/api/1_manage/integrations/webhook_events_spec.rb b/qa/qa/specs/features/api/1_manage/integrations/webhook_events_spec.rb index a2d66ffe8d3..fb530967073 100644 --- a/qa/qa/specs/features/api/1_manage/integrations/webhook_events_spec.rb +++ b/qa/qa/specs/features/api/1_manage/integrations/webhook_events_spec.rb @@ -8,10 +8,11 @@ module QA end after(:context) do - Vendor::Smocker::SmockerApi.teardown! + Service::DockerRun::Smocker.teardown! end let(:session) { SecureRandom.hex(5) } + let(:tag_name) { SecureRandom.hex(5) } it 'sends a push event', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348945' do setup_webhook(push: true) do |webhook, smocker| @@ -71,7 +72,7 @@ module QA end it 'sends an issues and note event', - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349723' do + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349723' do setup_webhook(issues: true, note: true) do |webhook, smocker| issue = Resource::Issue.fabricate_via_api! do |issue_init| issue_init.project = webhook.project @@ -98,10 +99,36 @@ module QA end end + it 'sends a tag event', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/383577' do + setup_webhook(tag_push: true) do |webhook, smocker| + project_push = Resource::Repository::ProjectPush.fabricate! do |project_push| + project_push.project = webhook.project + end + + Resource::Tag.fabricate_via_api! do |tag| + tag.project = project_push.project + tag.ref = project_push.branch_name + tag.name = tag_name + end + + wait_until do + smocker.history(session).size == 1 + end + + events = smocker.history(session).map(&:as_hook_event) + aggregate_failures do + expect(events.size).to be(1), "Should have 1 event: \n#{events.map(&:raw).join("\n")}" + expect(events[0].project_name).to eql(webhook.project.name) + expect(events[0].tag?).to be(true), "Not tag event: \n#{events[0].raw}" + end + end + end + private def setup_webhook(**event_args) - Vendor::Smocker::SmockerApi.init(wait: 10) do |smocker| + Service::DockerRun::Smocker.init(wait: 10) do |smocker| smocker.register(session: session) webhook = Resource::ProjectWebHook.fabricate_via_api! do |hook| diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb index dd2e7f06995..052e3d0e32d 100644 --- a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb +++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb @@ -52,6 +52,32 @@ module QA end end + context 'with associated merge request' do + let!(:source_mr) do + Resource::MergeRequest.fabricate_via_api! do |mr| + mr.project = source_project + mr.api_client = source_admin_api_client + mr.description = "Closes #{source_issue.web_url}" + end + end + + let(:imported_related_mrs) do + imported_issue.related_merge_requests.pluck(:iid) + end + + it( + 'preserves related merge request', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/386305', + quarantine: { + type: :bug, + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/386308' + } + ) do + expect_project_import_finished_successfully + expect(imported_related_mrs).to eq([source_mr.iid]) + end + end + # we can't fabricate things in source instance via UI context "with designs", quarantine: { type: :broken, diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_large_project_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_large_project_spec.rb index 5fc170435e3..9ce028318c3 100644 --- a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_large_project_spec.rb +++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_large_project_spec.rb @@ -15,7 +15,8 @@ module QA let!(:gitlab_source_project) { ENV["QA_LARGE_IMPORT_REPO"] || "migration-test-project" } let!(:import_wait_duration) { { max_duration: (ENV["QA_LARGE_IMPORT_DURATION"] || 3600).to_i, sleep_interval: 30 } } - let!(:source_admin_user) { "no-op" } + # test uses production as source which doesn't have actual admin user + let!(:source_admin_user) { nil } let!(:source_admin_api_client) do Runtime::API::Client.new( source_gitlab_address, @@ -227,8 +228,8 @@ module QA comment_diff = verify_comments(type, actual, expected) { - "missing_#{type}s": (expected.keys - actual.keys).map { |it| expected[it]&.slice(:title, :url) }.compact, - "extra_#{type}s": (actual.keys - expected.keys).map { |it| actual[it]&.slice(:title, :url) }.compact, + "missing_#{type}s": (expected.keys - actual.keys).filter_map { |it| expected[it]&.slice(:title, :url) }, + "extra_#{type}s": (actual.keys - expected.keys).filter_map { |it| actual[it]&.slice(:title, :url) }, "#{type}_comments": comment_diff } end diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb index 83691cdf143..9f6b1d38bd7 100644 --- a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb +++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb @@ -6,11 +6,7 @@ module QA include_context 'with gitlab project migration' # this spec is used as a sanity test for gitlab migration because it can run outside of orchestrated setup - context 'with import within same instance', orchestrated: false, import: false, quarantine: { - type: :test_environment, - issue: "https://gitlab.com/gitlab-org/gitlab/-/issues/383605", - only: { job: "review-qa" } - } do + context 'with import within same instance', orchestrated: false, import: false do let!(:source_project_with_readme) { true } let!(:source_gitlab_address) { Runtime::Scenario.gitlab_address } let!(:source_admin_api_client) { admin_api_client } diff --git a/qa/qa/specs/features/api/1_manage/project_access_token_spec.rb b/qa/qa/specs/features/api/1_manage/project_access_token_spec.rb index e210ba882bb..d693bbd43ff 100644 --- a/qa/qa/specs/features/api/1_manage/project_access_token_spec.rb +++ b/qa/qa/specs/features/api/1_manage/project_access_token_spec.rb @@ -5,14 +5,16 @@ module QA describe 'Project access token', product_group: :authentication_and_authorization do before(:all) do @project_access_token = QA::Resource::ProjectAccessToken.fabricate_via_api! do |pat| - pat.project = Resource::ReusableProject.fabricate_via_api! + pat.project = Resource::Project.fabricate_via_api! do |project| + project.initialize_with_readme = true + end end @user_api_client = Runtime::API::Client.new(:gitlab, personal_access_token: @project_access_token.token) end context 'for the same project' do - it 'can be used to create a file via the project API', :reliable, testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347858' do + it 'can be used to create a file via the project API', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347858' do expect do Resource::File.fabricate_via_api! do |file| file.api_client = @user_api_client @@ -44,7 +46,7 @@ module QA @different_project = Resource::Project.fabricate! end - it 'cannot be used to create a file via the project API', :reliable, testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347860' do + it 'cannot be used to create a file via the project API', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347860' do expect do Resource::File.fabricate_via_api! do |file| file.api_client = @user_api_client @@ -57,7 +59,7 @@ module QA end.to raise_error(Resource::ApiFabricator::ResourceFabricationFailedError, /403 Forbidden/) end - it 'cannot be used to commit via the API', :reliable, testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347861' do + it 'cannot be used to commit via the API', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347861' do expect do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.api_client = @user_api_client diff --git a/qa/qa/specs/features/api/1_manage/user_inherited_access_spec.rb b/qa/qa/specs/features/api/1_manage/user_inherited_access_spec.rb index 3df6e988bfa..ad1abe6e5e9 100644 --- a/qa/qa/specs/features/api/1_manage/user_inherited_access_spec.rb +++ b/qa/qa/specs/features/api/1_manage/user_inherited_access_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'User', :requires_admin, product_group: :workspace do + describe 'User', :requires_admin, product_group: :organization do let(:admin_api_client) { Runtime::API::Client.as_admin } let!(:sub_group) do diff --git a/qa/qa/specs/features/api/1_manage/users_spec.rb b/qa/qa/specs/features/api/1_manage/users_spec.rb index ff036c18671..08e1b7a1e0c 100644 --- a/qa/qa/specs/features/api/1_manage/users_spec.rb +++ b/qa/qa/specs/features/api/1_manage/users_spec.rb @@ -4,7 +4,7 @@ require 'airborne' module QA RSpec.describe 'Manage' do - describe 'Users API', :reliable, product_group: :workspace do + describe 'Users API', :reliable, product_group: :organization do let(:api_client) { Runtime::API::Client.new(:gitlab) } let(:request) { Runtime::API::Request.new(api_client, '/users') } diff --git a/qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb b/qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb index a1060c1d890..fc00d851087 100644 --- a/qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb +++ b/qa/qa/specs/features/api/3_create/merge_request/push_options_labels_spec.rb @@ -10,8 +10,11 @@ module QA let(:branch) { "push-options-test-#{SecureRandom.hex(8)}" } let(:title) { "MR push options test #{SecureRandom.hex(8)}" } let(:commit_message) { 'Add README.md' } - - let(:project) { Resource::ReusableProject.fabricate_via_api! } + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.initialize_with_readme = true + end + end def create_new_mr_via_push Resource::Repository::ProjectPush.fabricate! do |push| diff --git a/qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb b/qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb index 0a82c5d6736..9fed6787ade 100644 --- a/qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb +++ b/qa/qa/specs/features/api/3_create/merge_request/push_options_mwps_spec.rb @@ -18,7 +18,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = "runner-for-#{project.name}" runner.tags = ["runner-for-#{project.name}"] diff --git a/qa/qa/specs/features/api/4_verify/file_variable_spec.rb b/qa/qa/specs/features/api/4_verify/file_variable_spec.rb index 6d375341c1b..bd0ec13b1f8 100644 --- a/qa/qa/specs/features/api/4_verify/file_variable_spec.rb +++ b/qa/qa/specs/features/api/4_verify/file_variable_spec.rb @@ -1,10 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Verify', :runner, product_group: :pipeline_authoring, quarantine: { - issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/383324', - type: :stale - } do + RSpec.describe 'Verify', :runner, product_group: :pipeline_authoring do describe 'Pipeline with project file variables' do let(:executor) { "qa-runner-#{Faker::Alphanumeric.alphanumeric(number: 8)}" } @@ -15,7 +12,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] @@ -31,19 +28,26 @@ module QA { file_path: '.gitlab-ci.yml', content: <<~YAML + default: + tags: [#{executor}] + variables: EXTRA_ARGS: "-f $TEST_FILE" DOCKER_REMOTE_ARGS: --tlscacert="$DOCKER_CA_CERT" EXTRACTED_CRT_FILE: ${DOCKER_CA_CERT}.crt MY_FILE_VAR: $TEST_FILE - test: - tags: [#{executor}] + job_echo: script: - echo "run something $EXTRA_ARGS" - echo "docker run $DOCKER_REMOTE_ARGS" - echo "run --output=$EXTRACTED_CRT_FILE" - echo "Will read private key from $MY_FILE_VAR" + + job_cat: + script: + - cat "$MY_FILE_VAR" + - cat "$DOCKER_CA_CERT" YAML } ] @@ -53,8 +57,8 @@ module QA let(:add_file_variables) do { - 'TEST_FILE' => 'hello, this is test', - 'DOCKER_CA_CERT' => 'This is secret' + 'TEST_FILE' => "hello, this is test\n", + 'DOCKER_CA_CERT' => "This is secret\n" }.each do |file_name, content| add_file_variable_to_project(file_name, content) end @@ -71,18 +75,37 @@ module QA runner.remove_via_api! end - it 'shows in job log accordingly', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/370791' do + it( + 'does not expose file variable content with echo', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/370791' + ) do + job = Resource::Job.fabricate_via_api! do |job| + job.project = project + job.id = project.job_by_name('job_echo')[:id] + end + + aggregate_failures do + trace = job.trace + expect(trace).to include('run something -f', "#{project.name}.tmp/TEST_FILE") + expect(trace).to include('docker run --tlscacert=', "#{project.name}.tmp/DOCKER_CA_CERT") + expect(trace).to include('run --output=', "#{project.name}.tmp/DOCKER_CA_CERT.crt") + expect(trace).to include('Will read private key from', "#{project.name}.tmp/TEST_FILE") + end + end + + it( + 'can read file variable content with cat', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/386409' + ) do job = Resource::Job.fabricate_via_api! do |job| job.project = project - job.id = project.job_by_name('test')[:id] + job.id = project.job_by_name('job_cat')[:id] end aggregate_failures do trace = job.trace - expect(trace).to have_content('run something -f hello, this is test') - expect(trace).to have_content('docker run --tlscacert="This is secret"') - expect(trace).to have_content('run --output=This is secret.crt') - expect(trace).to have_content('Will read private key from hello, this is test') + expect(trace).to have_content('hello, this is test') + expect(trace).to have_content('This is secret') end end diff --git a/qa/qa/specs/features/api/4_verify/remove_runner_spec.rb b/qa/qa/specs/features/api/4_verify/remove_runner_spec.rb deleted file mode 100644 index 7aaaa7137ed..00000000000 --- a/qa/qa/specs/features/api/4_verify/remove_runner_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -module QA - RSpec.describe 'Verify', :runner, product_group: :runner do - describe 'Runner removal' do - include Support::API - - let(:api_client) { Runtime::API::Client.new(:gitlab) } - let(:executor) { "qa-runner-#{Time.now.to_i}" } - let(:runner_tags) { ["runner-registration-e2e-test-#{Faker::Alphanumeric.alphanumeric(number: 8)}"] } - let!(:runner) do - Resource::Runner.fabricate! do |runner| - runner.name = executor - runner.tags = runner_tags - end - end - - # Removing a runner via the UI is covered by `spec/features/runners_spec.rb`` - it 'removes the runner', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/354828' do - runners_list = runner.runners_list - expect(runners_list.size).to eq(1) - expect(runners_list.first[:description]).to eq(executor) - - request = Runtime::API::Request.new(api_client, "runners/#{runner.id}") - response = delete(request.url) - expect(response.code).to eq(Support::API::HTTP_STATUS_NO_CONTENT) - expect(response.body).to be_empty - - expect(runner).to be_not_found_by_tags - end - end - end -end diff --git a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_group_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_group_spec.rb index 8fe4dc192bd..b2ccacfd142 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_group_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_group_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'Subgroup transfer', product_group: :workspace do + describe 'Subgroup transfer', product_group: :organization do let(:source_group) do Resource::Group.fabricate_via_api! do |group| group.path = "source-group-for-transfer_#{SecureRandom.hex(8)}" diff --git a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb index d684eabe644..ef05f4cfecf 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/group/transfer_project_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'Project transfer between groups', :reliable, product_group: :workspace do + describe 'Project transfer between groups', :reliable, product_group: :organization do let(:source_group) do Resource::Group.fabricate_via_api! do |group| group.path = "source-group-#{SecureRandom.hex(8)}" diff --git a/qa/qa/specs/features/browser_ui/1_manage/integrations/pipeline_status_emails_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/integrations/pipeline_status_emails_spec.rb index 4495d83f336..da49573b960 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/integrations/pipeline_status_emails_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/integrations/pipeline_status_emails_spec.rb @@ -36,7 +36,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb index 3f461e9247f..50e86b4d555 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Manage', :reliable, product_group: :workspace do + RSpec.describe 'Manage', :reliable, product_group: :organization do describe 'Add project member' do it 'user adds project member', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347887' do Flow::Login.sign_in diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/create_project_badge_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/create_project_badge_spec.rb index b251b3075dd..0a643d1e33b 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/create_project_badge_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/create_project_badge_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'Create project badge', :reliable, product_group: :workspace do + describe 'Create project badge', :reliable, product_group: :organization do let(:badge_name) { "project-badge-#{SecureRandom.hex(8)}" } let(:expected_badge_link_url) { "#{Runtime::Scenario.gitlab_address}/#{project.path_with_namespace}" } let(:expected_badge_image_url) { "#{Runtime::Scenario.gitlab_address}/#{project.path_with_namespace}/badges/main/pipeline.svg" } diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb index 686cc8fe11e..c9e90cce84c 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Manage', :smoke, product_group: :workspace do + RSpec.describe 'Manage', :smoke, product_group: :organization do describe 'Project' do shared_examples 'successful project creation' do it 'creates a new project' do diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/dashboard_images_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/dashboard_images_spec.rb index 2abbb6ca73c..e609dfb9197 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/dashboard_images_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/dashboard_images_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Manage', product_group: :workspace do + RSpec.describe 'Manage', product_group: :organization do shared_examples 'loads all images' do |admin| let(:api_client) { Runtime::API::Client.as_admin } diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb index 164f86bffce..4479f2ebfab 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'Invite group', :reliable, product_group: :workspace do + describe 'Invite group', :reliable, product_group: :organization do shared_examples 'invites group to project' do it 'verifies group is added and members can access project with correct access level' do Page::Project::Menu.perform(&:click_members) diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/project_owner_permissions_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/project_owner_permissions_spec.rb index 98a08dd0d9a..59774ed7c49 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/project_owner_permissions_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/project_owner_permissions_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'Project owner permissions', :reliable, product_group: :workspace do + describe 'Project owner permissions', :reliable, product_group: :organization do let!(:owner) do Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) end diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb index 33ca5f6009c..95305b7a4aa 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/view_project_activity_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'Project activity', :reliable, product_group: :workspace do + describe 'Project activity', :reliable, product_group: :organization do it 'user creates an event in the activity page upon Git push', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347879' do Flow::Login.sign_in diff --git a/qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb index b9b82baa6f1..94b383a746d 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'User', :requires_admin, product_group: :workspace do + describe 'User', :requires_admin, product_group: :organization do let(:admin_api_client) { Runtime::API::Client.as_admin } let(:followed_user_api_client) { Runtime::API::Client.new(:gitlab, user: followed_user) } diff --git a/qa/qa/specs/features/browser_ui/1_manage/user/parent_group_access_termination_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/user/parent_group_access_termination_spec.rb index 6bc695487ee..7caa6677787 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/user/parent_group_access_termination_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/user/parent_group_access_termination_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'User', :requires_admin, :reliable, product_group: :workspace do + describe 'User', :requires_admin, :reliable, product_group: :organization do let(:admin_api_client) { Runtime::API::Client.as_admin } let!(:user) do @@ -34,6 +34,7 @@ module QA Page::Group::Menu.perform(&:click_subgroup_members_item) Page::Group::Members.perform do |members_page| + members_page.search_member(user.username) members_page.remove_member(user.username) end end diff --git a/qa/qa/specs/features/browser_ui/1_manage/user/user_inherited_access_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/user/user_inherited_access_spec.rb index b7585f00630..9bb08cb66bc 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/user/user_inherited_access_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/user/user_inherited_access_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Manage' do - describe 'User', :requires_admin, product_group: :workspace do + describe 'User', :requires_admin, product_group: :organization do let(:admin_api_client) { Runtime::API::Client.as_admin } let!(:sub_group) do diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb index 257021b158a..1b82543a5d4 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_when_pipeline_succeeds_spec.rb @@ -14,7 +14,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = runner_name runner.tags = [runner_name] diff --git a/qa/qa/specs/features/browser_ui/3_create/pages/new_static_page_spec.rb b/qa/qa/specs/features/browser_ui/3_create/pages/new_static_page_spec.rb index 449bffe61e0..a214af19fca 100644 --- a/qa/qa/specs/features/browser_ui/3_create/pages/new_static_page_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/pages/new_static_page_spec.rb @@ -9,7 +9,8 @@ module QA issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/383215', type: :test_environment, only: { subdomain: 'staging-ref' } - } do + }, + feature_flag: { name: 'show_pages_in_deployments_menu' } do # TODO: Convert back to :smoke once proved to be stable. Related issue: https://gitlab.com/gitlab-org/gitlab/-/issues/300906 describe 'Pages', product_group: :editor do let!(:project) do @@ -29,14 +30,21 @@ module QA end before do + # Pages Menu Experiment currently progress https://gitlab.com/gitlab-org/gitlab/-/merge_requests/98044 + # Update spec along with Feature Flag Removal. + Runtime::Feature.disable(:show_pages_in_deployments_menu) Flow::Login.sign_in - Resource::Runner.fabricate_via_api! do |runner| + Resource::ProjectRunner.fabricate_via_api! do |runner| runner.project = project runner.executor = :docker end pipeline.visit! end + after do + Runtime::Feature.enable(:show_pages_in_deployments_menu) + end + it 'creates a Pages website', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347669' do Page::Project::Pipeline::Show.perform do |show| diff --git a/qa/qa/specs/features/browser_ui/3_create/project_wiki/project_based_page_deletion_spec.rb b/qa/qa/specs/features/browser_ui/3_create/project_wiki/project_based_page_deletion_spec.rb index 626f9a7d593..fef6b8ad65f 100644 --- a/qa/qa/specs/features/browser_ui/3_create/project_wiki/project_based_page_deletion_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/project_wiki/project_based_page_deletion_spec.rb @@ -1,23 +1,23 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', product_group: :editor do - describe 'Testing project wiki' - let(:initial_wiki) { Resource::Wiki::ProjectPage.fabricate_via_api! } + RSpec.describe 'Create' do + describe 'Testing project wiki', product_group: :editor do + let(:initial_wiki) { Resource::Wiki::ProjectPage.fabricate_via_api! } - before do - Flow::Login.sign_in - end + before do + Flow::Login.sign_in + end - it 'can delete a page', - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347815' do - initial_wiki.visit! + it 'can delete a page', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347815' do + initial_wiki.visit! - Page::Project::Wiki::Show.perform(&:click_edit) - Page::Project::Wiki::Edit.perform(&:delete_page) + Page::Project::Wiki::Show.perform(&:click_edit) + Page::Project::Wiki::Edit.perform(&:delete_page) - Page::Project::Wiki::Show.perform do |wiki| - expect(wiki).to have_no_page + Page::Project::Wiki::Show.perform do |wiki| + expect(wiki).to have_no_page + end end end end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb index b4103bd0976..7d21c635347 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb @@ -54,11 +54,10 @@ module QA Page::Project::Show.perform(&:create_new_file!) Page::File::Form.perform do |form| + form.add_custom_name(template[:file_name]) form.select_template template[:file_name], template[:name] expect(form).to have_normalized_ws_text(content[0..100]) - - form.add_name("#{SecureRandom.hex(8)}/#{template[:file_name]}") form.commit_changes aggregate_failures "indications of file created" do diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb index 93f804f1e39..6cbbfb9e7e5 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb @@ -1,7 +1,12 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :project }, product_group: :editor do + RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :global }, + product_group: :editor, + quarantine: { + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/387033', + type: :stale + } do describe 'Web IDE file templates' do include Runtime::Fixtures @@ -11,11 +16,11 @@ module QA project.description = 'Add file templates via the Web IDE' project.initialize_with_readme = true end - Runtime::Feature.disable(:vscode_web_ide, project: @project) + Runtime::Feature.disable(:vscode_web_ide) end after(:all) do - Runtime::Feature.enable(:vscode_web_ide, project: @project) + Runtime::Feature.enable(:vscode_web_ide) end templates = [ diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_new_directory_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_new_directory_in_web_ide_spec.rb index a001dee891a..ded1b1c9d7c 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/add_new_directory_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/add_new_directory_in_web_ide_spec.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :project }, product_group: :editor do + RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :global }, product_group: :editor, quarantine: { + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/387029', + type: :stale + } do describe 'Add a directory in Web IDE' do let(:project) do Resource::Project.fabricate_via_api! do |project| @@ -11,13 +14,13 @@ module QA end before do - Runtime::Feature.disable(:vscode_web_ide, project: project) + Runtime::Feature.disable(:vscode_web_ide) Flow::Login.sign_in project.visit! end after do - Runtime::Feature.enable(:vscode_web_ide, project: project) + Runtime::Feature.enable(:vscode_web_ide) end context 'when a directory with the same name already exists' do diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/create_first_file_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/create_first_file_in_web_ide_spec.rb index cb0da601a88..45499ea1999 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/create_first_file_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/create_first_file_in_web_ide_spec.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :project }, product_group: :editor do + RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :global }, product_group: :editor, quarantine: { + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/387723', + type: :stale + } do describe 'First file using Web IDE' do let(:project) do Resource::Project.fabricate_via_api! do |project| @@ -13,12 +16,12 @@ module QA let(:file_name) { 'the very first file.txt' } before do - Runtime::Feature.disable(:vscode_web_ide, project: project) + Runtime::Feature.disable(:vscode_web_ide) Flow::Login.sign_in end after do - Runtime::Feature.enable(:vscode_web_ide, project: project) + Runtime::Feature.enable(:vscode_web_ide) end it "creates the first file in an empty project via Web IDE", testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347803' do diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb index 2007fe4a667..3ea87d90c2d 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :project }, product_group: :editor do + RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :global }, product_group: :editor, quarantine: { + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/387035', + type: :stale + } do describe 'Link to line in Web IDE' do let(:user) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) } let(:project) do @@ -11,12 +14,12 @@ module QA end before do - Runtime::Feature.disable(:vscode_web_ide, project: project) + Runtime::Feature.disable(:vscode_web_ide) Flow::Login.sign_in end after do - Runtime::Feature.enable(:vscode_web_ide, project: project) + Runtime::Feature.enable(:vscode_web_ide) project.remove_via_api! end diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb index dc9f68c5c73..7195dd5c970 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_fork_in_web_ide_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :project }, product_group: :editor do + RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :global }, product_group: :editor do describe 'Open a fork in Web IDE', skip: { issue: "https://gitlab.com/gitlab-org/gitlab/-/issues/351696", @@ -15,11 +15,11 @@ module QA end before do - Runtime::Feature.disable(:vscode_web_ide, project: parent_project) + Runtime::Feature.disable(:vscode_web_ide) end after do - Runtime::Feature.enable(:vscode_web_ide, project: parent_project) + Runtime::Feature.enable(:vscode_web_ide) end context 'when a user does not have permissions to commit to the project' do diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_web_ide_from_diff_tab_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_web_ide_from_diff_tab_spec.rb index 039d25477bf..02d2710656d 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/open_web_ide_from_diff_tab_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/open_web_ide_from_diff_tab_spec.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :project }, product_group: :editor do + RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :global }, product_group: :editor, quarantine: { + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/387031', + type: :stale + } do describe 'Open Web IDE from Diff Tab' do files = [ { @@ -44,13 +47,13 @@ module QA end before do - Runtime::Feature.disable(:vscode_web_ide, project: project) + Runtime::Feature.disable(:vscode_web_ide) Flow::Login.sign_in merge_request.visit! end after do - Runtime::Feature.enable(:vscode_web_ide, project: project) + Runtime::Feature.enable(:vscode_web_ide) end it 'opens and edits a multi-file merge request in Web IDE from Diff Tab', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347724' do diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb index fe0060e9bbc..4c21581781d 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :project }, product_group: :editor do + RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :global }, product_group: :editor, quarantine: { + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/387043', + type: :stale + } do describe 'Review a merge request in Web IDE' do let(:new_file) { 'awesome_new_file.txt' } let(:original_text) { 'Text' } @@ -23,13 +26,13 @@ module QA end before do - Runtime::Feature.disable(:vscode_web_ide, project: project) + Runtime::Feature.disable(:vscode_web_ide) Flow::Login.sign_in merge_request.visit! end after do - Runtime::Feature.enable(:vscode_web_ide, project: project) + Runtime::Feature.enable(:vscode_web_ide) end it 'opens and edits a merge request in Web IDE', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347786' do diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/server_hooks_custom_error_message_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/server_hooks_custom_error_message_spec.rb index 3cd14ecd799..8c171e6bc8c 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/server_hooks_custom_error_message_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/server_hooks_custom_error_message_spec.rb @@ -2,8 +2,12 @@ module QA RSpec.describe 'Create', :skip_live_env, except: { job: 'review-qa-*' }, - feature_flag: { name: 'vscode_web_ide', scope: :project }, - product_group: :editor do + feature_flag: { name: 'vscode_web_ide', scope: :global }, + product_group: :editor, + quarantine: { + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/387928', + type: :stale + } do describe 'Git Server Hooks' do let(:file_path) { File.absolute_path(File.join('qa', 'fixtures', 'web_ide', 'README.md')) } @@ -16,13 +20,13 @@ module QA end before do - Runtime::Feature.disable(:vscode_web_ide, project: project) + Runtime::Feature.disable(:vscode_web_ide) Flow::Login.sign_in project.visit! end after do - Runtime::Feature.enable(:vscode_web_ide, project: project) + Runtime::Feature.enable(:vscode_web_ide) end context 'Custom error messages' do diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/upload_new_file_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/upload_new_file_in_web_ide_spec.rb index c6e283f67e0..781623d10f6 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/upload_new_file_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/upload_new_file_in_web_ide_spec.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true module QA - RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :project }, product_group: :editor do + RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :global }, product_group: :editor, quarantine: { + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/387032', + type: :stale + } do describe 'Upload a file in Web IDE' do let(:file_path) { File.absolute_path(File.join('qa', 'fixtures', 'web_ide', file_name)) } @@ -13,7 +16,7 @@ module QA end before do - Runtime::Feature.disable(:vscode_web_ide, project: project) + Runtime::Feature.disable(:vscode_web_ide) Flow::Login.sign_in project.visit! @@ -21,7 +24,7 @@ module QA end after do - Runtime::Feature.enable(:vscode_web_ide, project: project) + Runtime::Feature.enable(:vscode_web_ide) end context 'when a file with the same name already exists' do diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide/web_terminal_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide/web_terminal_spec.rb index 695b295bd86..599c34ed3db 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide/web_terminal_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide/web_terminal_spec.rb @@ -10,12 +10,12 @@ module QA issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/338179', type: :bug }, - feature_flag: { name: 'vscode_web_ide', scope: :project }, + feature_flag: { name: 'vscode_web_ide', scope: :global }, product_group: :editor ) do describe 'Web IDE web terminal' do before do - Runtime::Feature.disable(:vscode_web_ide, project: project) + Runtime::Feature.disable(:vscode_web_ide) project = Resource::Project.fabricate_via_api! do |project| project.name = 'web-terminal-project' end @@ -37,7 +37,7 @@ module QA ) end - @runner = Resource::Runner.fabricate_via_api! do |runner| + @runner = Resource::ProjectRunner.fabricate_via_api! do |runner| runner.project = project runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = %w[web-ide] @@ -58,7 +58,7 @@ module QA end after do - Runtime::Feature.enable(:vscode_web_ide, project: project) + Runtime::Feature.enable(:vscode_web_ide) @runner.remove_via_api! if @runner end diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide_new/add_new_directory_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide_new/add_new_directory_in_web_ide_spec.rb new file mode 100644 index 00000000000..7b40c8a62c1 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide_new/add_new_directory_in_web_ide_spec.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Create', feature_flag: { name: 'vscode_web_ide', scope: :global }, product_group: :editor do + describe 'Add a directory in Web IDE' do + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'add-directory-project' + project.initialize_with_readme = true + end + end + + before do + Runtime::Feature.enable(:vscode_web_ide) + Flow::Login.sign_in + project.visit! + end + + after do + Runtime::Feature.disable(:vscode_web_ide) + end + + context 'when a directory with the same name already exists' do + let(:directory_name) { 'first_directory' } + + before do + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.add_files( + [ + { + file_path: 'first_directory/test_file.txt', + content: "Test file content" + } + ]) + end + project.visit! + end + + it 'throws an error', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/386760' do + Page::Project::Show.perform(&:open_web_ide!) + Page::Project::WebIDE::VSCode.perform do |ide| + ide.wait_for_ide_to_load + ide.create_new_folder(directory_name) + ide.within_vscode_editor do + expect(page).to have_content('A file or folder first_directory already exists at this location.') + end + end + end + end + + context 'when user adds a new empty directory' do + let(:directory_name) { 'new_empty_directory' } + + before do + Page::Project::Show.perform(&:open_web_ide!) + end + + it 'shows successfully but not able to be committed', +testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/386761' do + Page::Project::WebIDE::VSCode.perform do |ide| + ide.wait_for_ide_to_load + ide.create_new_folder(directory_name) + ide.commit_and_push(directory_name) + ide.within_vscode_editor do + expect(page).to have_content('No changes found. Not able to commit.') + end + end + end + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/custom_variable_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/custom_variable_spec.rb index 5dda8b04805..2ae28d54242 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/custom_variable_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/custom_variable_spec.rb @@ -14,7 +14,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/pipeline_with_protected_variable_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/pipeline_with_protected_variable_spec.rb index 48d6ed8dc49..a8ec0a1c835 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/pipeline_with_protected_variable_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/pipeline_with_protected_variable_spec.rb @@ -14,7 +14,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb index a4849d47183..81ccd36c514 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/raw_variables_defined_in_yaml_spec.rb @@ -2,10 +2,7 @@ module QA RSpec.describe 'Verify', :runner do - describe 'Pipeline with raw variables in YAML', product_group: :pipeline_authoring, feature_flag: { - name: 'ci_raw_variables_in_yaml_config', - scope: :project - } do + describe 'Pipeline with raw variables in YAML', product_group: :pipeline_authoring do let(:executor) { "qa-runner-#{Time.now.to_i}" } let(:pipeline_job_name) { 'rspec' } @@ -16,14 +13,14 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] end end - let(:commit_ci_file) do + let!(:commit_ci_file) do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.commit_message = 'Add .gitlab-ci.yml' @@ -76,10 +73,7 @@ module QA let(:pipeline_id) { project.pipelines.first[:id] } let(:job_id) { project.job_by_name(pipeline_job_name)[:id] } - def before_do - # TODO: Switch to use `let!` and remove this line when removing FF - commit_ci_file - + before do Flow::Login.sign_in project.visit! Flow::Pipeline.visit_latest_pipeline(status: 'passed') @@ -92,55 +86,20 @@ module QA runner&.remove_via_api! end - context 'when FF is on', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/381487' do - before do - Runtime::Feature.enable(:ci_raw_variables_in_yaml_config, project: project) - sleep 60 - - before_do - end - - it 'expands variables according to expand: true/false', :aggregate_failures do - Page::Project::Job::Show.perform do |show| - expect(show.output).to have_content("VAR1 is JOBID-#{job_id}") - expect(show.output).to have_content("VAR2 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}") - expect(show.output).to have_content("VAR3 is PIPELINEID-$CI_PIPELINE_ID and $VAR1") - expect(show.output).to have_content("VAR4 is JOBID-$CI_JOB_ID") - expect(show.output).to have_content("VAR5 is PIPELINEID-#{pipeline_id} and JOBID-$CI_JOB_ID") - expect(show.output).to have_content("VAR6 is PIPELINEID-$CI_PIPELINE_ID and $VAR4") - expect(show.output).to have_content("VAR7 is overridden value 7 #{pipeline_id}") - expect(show.output).to have_content("VAR8 is value 8 $CI_PIPELINE_ID") - end - end - end - - # TODO: Remove this context when FF :ci_raw_variables_in_yaml_config is removed - # Also archive testcase and close related issue - context 'when FF is off', - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/381486', - quarantine: { - issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/381806', - only: { pipeline: %w[staging staging-canary staging-ref] }, - type: :waiting_on - } do - before do - Runtime::Feature.disable(:ci_raw_variables_in_yaml_config, project: project) - sleep 60 - - before_do - end - - it 'expands all variables', :aggregate_failures do - Page::Project::Job::Show.perform do |show| - expect(show.output).to have_content("VAR1 is JOBID-#{job_id}") - expect(show.output).to have_content("VAR2 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}") - expect(show.output).to have_content("VAR3 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}") - expect(show.output).to have_content("VAR4 is JOBID-#{job_id}") - expect(show.output).to have_content("VAR5 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}") - expect(show.output).to have_content("VAR6 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}") - expect(show.output).to have_content("VAR7 is overridden value 7 #{pipeline_id}") - expect(show.output).to have_content("VAR8 is value 8 #{pipeline_id}") - end + it( + 'expands variables according to expand: true/false', + :aggregate_failures, + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/381487' + ) do + Page::Project::Job::Show.perform do |show| + expect(show.output).to have_content("VAR1 is JOBID-#{job_id}") + expect(show.output).to have_content("VAR2 is PIPELINEID-#{pipeline_id} and JOBID-#{job_id}") + expect(show.output).to have_content("VAR3 is PIPELINEID-$CI_PIPELINE_ID and $VAR1") + expect(show.output).to have_content("VAR4 is JOBID-$CI_JOB_ID") + expect(show.output).to have_content("VAR5 is PIPELINEID-#{pipeline_id} and JOBID-$CI_JOB_ID") + expect(show.output).to have_content("VAR6 is PIPELINEID-$CI_PIPELINE_ID and $VAR4") + expect(show.output).to have_content("VAR7 is overridden value 7 #{pipeline_id}") + expect(show.output).to have_content("VAR8 is value 8 $CI_PIPELINE_ID") end end end diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb index b6270c11ef6..0aedbd307bf 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb @@ -1,10 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Verify', :smoke, :runner, product_group: :pipeline_execution, quarantine: { - issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/356295', - type: :investigating - } do + RSpec.describe 'Verify', :runner, product_group: :pipeline_execution do describe 'Pipeline creation and processing' do let(:executor) { "qa-runner-#{Time.now.to_i}" } @@ -15,7 +12,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_multiple_files_from_a_project_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_multiple_files_from_a_project_spec.rb index d773d0f36d0..5bbe09b3fb0 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_multiple_files_from_a_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/include_multiple_files_from_a_project_spec.rb @@ -20,7 +20,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/locked_artifacts_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/locked_artifacts_spec.rb index ba1363d79c5..588d22275df 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/locked_artifacts_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/locked_artifacts_spec.rb @@ -15,7 +15,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb index 34f548a0e69..ddd91f97515 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/merge_mr_when_pipline_is_blocked_spec.rb @@ -12,7 +12,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb index 448da6d9d87..5dff2db6f2b 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/mr_event_rule_pipeline_spec.rb @@ -14,7 +14,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/parent_child_pipelines_independent_relationship_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/parent_child_pipelines_independent_relationship_spec.rb index a7ca7b82d1e..fef90a7c8fc 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/parent_child_pipelines_independent_relationship_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/parent_child_pipelines_independent_relationship_spec.rb @@ -10,7 +10,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate_via_api! do |runner| + Resource::ProjectRunner.fabricate_via_api! do |runner| runner.project = project runner.name = project.name runner.tags = [project.name] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb index fca34fc1f8e..7d1339d2c2d 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pass_dotenv_variables_to_downstream_via_bridge_spec.rb @@ -22,10 +22,10 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::GroupRunner.fabricate! do |runner| runner.name = executor runner.tags = [executor] - runner.token = group.reload!.runners_token + runner.group = group end end diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_with_image_pull_policy_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_with_image_pull_policy_spec.rb index d30d5b43568..aaaa11ef867 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_with_image_pull_policy_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_with_image_pull_policy_spec.rb @@ -13,7 +13,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = runner_name runner.tags = [runner_name] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_with_manual_jobs_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_with_manual_jobs_spec.rb index 4223caaafef..4294235a8b1 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_with_manual_jobs_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/run_pipeline_with_manual_jobs_spec.rb @@ -13,7 +13,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb index c1d996df925..3361ab98bda 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb @@ -12,7 +12,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb index 83283c5d8e3..bd656142989 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb @@ -12,7 +12,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/update_ci_file_with_pipeline_editor_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/update_ci_file_with_pipeline_editor_spec.rb index 1f49c7a3663..a749da4608a 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/update_ci_file_with_pipeline_editor_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/update_ci_file_with_pipeline_editor_spec.rb @@ -12,7 +12,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate_via_api! do |runner| + Resource::ProjectRunner.fabricate_via_api! do |runner| runner.project = project runner.name = random_test_string runner.tags = [random_test_string] diff --git a/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb index 24c49be13bb..e141bac5e3f 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb @@ -5,7 +5,7 @@ module QA describe 'Runner registration' do let(:executor) { "qa-runner-#{Time.now.to_i}" } let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = executor runner.tags = ['e2e-test'] end diff --git a/qa/qa/specs/features/browser_ui/4_verify/testing/endpoint_coverage_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/testing/endpoint_coverage_spec.rb index 0166c53ffd5..d4fee70fbf3 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/testing/endpoint_coverage_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/testing/endpoint_coverage_spec.rb @@ -18,7 +18,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate_via_api! do |runner| + Resource::ProjectRunner.fabricate_via_api! do |runner| runner.project = project runner.name = project.name runner.tags = [project.name] diff --git a/qa/qa/specs/features/browser_ui/4_verify/testing/view_code_coverage_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/testing/view_code_coverage_spec.rb index 2a4852a2b8b..b45ccfa5433 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/testing/view_code_coverage_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/testing/view_code_coverage_spec.rb @@ -5,7 +5,7 @@ module QA describe 'Code coverage statistics' do let(:executor) { "qa-runner-#{Time.now.to_i}" } let(:runner) do - Resource::Runner.fabricate_via_api! do |runner| + Resource::ProjectRunner.fabricate_via_api! do |runner| runner.name = executor runner.tags = ['e2e-test'] end diff --git a/qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb b/qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb index c57a5c27dd2..800324afc58 100644 --- a/qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb @@ -28,7 +28,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.name}"] runner.executor = :docker diff --git a/qa/qa/specs/features/browser_ui/5_package/dependency_proxy/dependency_proxy_spec.rb b/qa/qa/specs/features/browser_ui/5_package/dependency_proxy/dependency_proxy_spec.rb index 978867d5cf1..a0d283fd7ad 100644 --- a/qa/qa/specs/features/browser_ui/5_package/dependency_proxy/dependency_proxy_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/dependency_proxy/dependency_proxy_spec.rb @@ -14,7 +14,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.name}"] runner.executor = :docker diff --git a/qa/qa/specs/features/browser_ui/5_package/infrastructure_registry/terraform_module_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/infrastructure_registry/terraform_module_registry_spec.rb index a80e154a969..fe320f10416 100644 --- a/qa/qa/specs/features/browser_ui/5_package/infrastructure_registry/terraform_module_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/infrastructure_registry/terraform_module_registry_spec.rb @@ -16,12 +16,11 @@ module QA end let(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{imported_project.name}"] runner.executor = :docker runner.project = imported_project - runner.token = group.reload!.runners_token end end diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb index ab4fb21f19a..0dce0022b38 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb @@ -20,7 +20,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.name}"] runner.executor = :docker diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb index 687d9f710fb..39c2121331d 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb @@ -24,7 +24,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.name}"] runner.executor = :docker diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb index 820571593a6..d6fb52cfea9 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb @@ -20,7 +20,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.name}"] runner.executor = :docker diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_project_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_project_level_spec.rb index 46c165ed806..c69b672a2ec 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_project_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_project_level_spec.rb @@ -33,7 +33,7 @@ module QA end let(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{package_project.name}"] runner.executor = :docker @@ -173,11 +173,11 @@ module QA end let(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::GroupRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{imported_project.name}"] runner.executor = :docker - runner.token = group.reload!.runners_token + runner.group = group end end diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb index e209fc55e35..92dee63e37a 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb @@ -45,11 +45,11 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::GroupRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.group.name}"] runner.executor = :docker - runner.token = project.group.reload!.runners_token + runner.group = project.group end end diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb index d1aaa05c85a..29cdd5b9362 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb @@ -39,7 +39,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.name}"] runner.executor = :docker diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb index d44bc8fa2ad..0e1ac4d861d 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb @@ -51,11 +51,11 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::GroupRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.group.name}"] runner.executor = :docker - runner.token = project.group.reload!.runners_token + runner.group = project.group end end @@ -137,7 +137,7 @@ module QA <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net5.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> </PropertyGroup> </Project> diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb index 442deb1eb4e..038decddd96 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb @@ -36,7 +36,7 @@ product_group: :package_registry do end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.name}"] runner.executor = :docker diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb index fddb7fb6ebc..12e9d3e995f 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb @@ -21,7 +21,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.name}"] runner.executor = :docker diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb index 284130fa92b..b80eb3a688e 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb @@ -21,7 +21,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{project.name}"] runner.executor = :docker diff --git a/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb b/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb index 3f91d120fdd..a504b694308 100644 --- a/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb +++ b/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb @@ -15,7 +15,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate_via_api! do |resource| + Resource::ProjectRunner.fabricate_via_api! do |resource| resource.project = project resource.name = runner_name resource.tags = [runner_name] diff --git a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb index d6446c9725d..1e7d0eab365 100644 --- a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb +++ b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb @@ -2,7 +2,6 @@ module QA RSpec.describe 'Configure', - quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/381454', type: :flaky }, only: { subdomain: %i[staging staging-canary] }, product_group: :configure do describe 'Auto DevOps with a Kubernetes Agent' do let!(:app_project) do diff --git a/qa/qa/specs/features/browser_ui/8_monitor/alert_management/alert_settings_create_new_alerts_spec.rb b/qa/qa/specs/features/browser_ui/8_monitor/alert_management/alert_settings_create_new_alerts_spec.rb new file mode 100644 index 00000000000..2b7dd8fb673 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/8_monitor/alert_management/alert_settings_create_new_alerts_spec.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Monitor', product_group: :respond do + describe 'Alert settings' do + shared_examples 'sends test alert' do + it 'creates new alert' do + Page::Project::Menu.perform(&:go_to_monitor_alerts) + Page::Project::Monitor::Alerts::Index.perform do |index| + expect(index).to have_alert_with_title(alert_title) + end + end + end + + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'project-for-alerts' + project.description = 'Project for alerts' + end + end + + let(:alert_title) { Faker::Lorem.word } + + before do + Flow::Login.sign_in + project.visit! + end + + context( + 'when using HTTP endpoint integration', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/382803' + ) do + let(:payload) do + { title: alert_title, description: alert_title } + end + + before do + Flow::AlertSettings.setup_http_endpoint(payload: payload) + end + + it_behaves_like 'sends test alert' + end + + context( + 'when using Prometheus integration', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/385792' + ) do + let(:payload) do + { + version: '4', + groupKey: nil, + status: 'firing', + receiver: '', + groupLabels: {}, + commonLabels: {}, + commonAnnotations: {}, + externalURL: '', + alerts: [ + { + startsAt: Time.now, + generatorURL: Faker::Internet.url, + endsAt: nil, + status: 'firing', + labels: { gitlab_environment_name: Faker::Lorem.word }, + annotations: + { + title: alert_title, + gitlab_y_label: 'status' + } + } + ] + } + end + + before do + Flow::AlertSettings.setup_prometheus(payload: payload) + end + + it_behaves_like 'sends test alert' + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/8_monitor/alert_management/create_alert_using_authorization_key_spec.rb b/qa/qa/specs/features/browser_ui/8_monitor/alert_management/create_alert_using_authorization_key_spec.rb new file mode 100644 index 00000000000..9d4aff59e48 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/8_monitor/alert_management/create_alert_using_authorization_key_spec.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Monitor', product_group: :respond do + describe 'Alert settings' do + shared_examples 'sends test alert using authorization key' do |type| + it 'creates new alert', :aggregate_failures do + response = RestClient.post( + credentials[:url], + payload.to_json, + { 'Content-Type': 'application/json', Authorization: "Bearer #{credentials[:auth_key]}" } + ) + + # With HTTP type, a successful request returns 200 and a JSON with the alert's title + # With Prometheus type, a successful request returns 201 + if type == 'http' + expect(response.code).to eq 200 + expect(JSON.parse(response).first['title']).to eq alert_title + else + expect(response.code).to eq 201 + end + + Page::Project::Menu.perform(&:go_to_monitor_alerts) + Page::Project::Monitor::Alerts::Index.perform do |index| + expect(index).to have_alert_with_title(alert_title) + end + end + end + + let(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'project-for-alerts' + project.description = 'Project for alerts' + end + end + + let(:alert_title) { Faker::Lorem.word } + + before do + Flow::Login.sign_in + project.visit! + end + + context( + 'when using HTTP endpoint integration', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/386734' + ) do + let(:payload) do + { title: alert_title, description: alert_title } + end + + let(:credentials) do + Flow::AlertSettings.setup_http_endpoint(send: false) + end + + it_behaves_like 'sends test alert using authorization key', 'http' + end + + context( + 'when using Prometheus integration', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/386735' + ) do + let(:payload) do + { + version: '4', + groupKey: nil, + status: 'firing', + receiver: '', + groupLabels: {}, + commonLabels: {}, + commonAnnotations: {}, + externalURL: '', + alerts: [ + { + startsAt: Time.now, + generatorURL: Faker::Internet.url, + endsAt: nil, + status: 'firing', + labels: { gitlab_environment_name: Faker::Lorem.word }, + annotations: + { + title: alert_title, + gitlab_y_label: 'status' + } + } + ] + } + end + + let(:credentials) do + Flow::AlertSettings.setup_prometheus(send: false) + end + + it_behaves_like 'sends test alert using authorization key' + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/8_monitor/incident_management/http_endpoint_integration_creates_alert_spec.rb b/qa/qa/specs/features/browser_ui/8_monitor/incident_management/http_endpoint_integration_creates_alert_spec.rb deleted file mode 100644 index 8ea728ca94c..00000000000 --- a/qa/qa/specs/features/browser_ui/8_monitor/incident_management/http_endpoint_integration_creates_alert_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -module QA - RSpec.describe 'Monitor', product_group: :respond do - describe 'Http endpoint integration' do - let(:project) do - Resource::Project.fabricate_via_api! do |project| - project.name = 'project-for-alerts' - project.description = 'Project for alerts' - end - end - - let(:random_word) { Faker::Lorem.word } - - let(:payload) do - { title: random_word, description: random_word } - end - - before do - Flow::Login.sign_in - project.visit! - Flow::AlertSettings.setup_http_endpoint_and_send_alert(payload: payload) - end - - it( - 'can send test alert that creates new alert', - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/382803' - ) do - Page::Project::Menu.perform(&:go_to_monitor_alerts) - Page::Project::Monitor::Alerts::Index.perform do |alerts| - expect(alerts).to have_alert_with_title(random_word) - end - end - end - end -end diff --git a/qa/qa/specs/features/sanity/feature_flags_spec.rb b/qa/qa/specs/features/sanity/feature_flags_spec.rb index acb9528fe6a..36069558701 100644 --- a/qa/qa/specs/features/sanity/feature_flags_spec.rb +++ b/qa/qa/specs/features/sanity/feature_flags_spec.rb @@ -1,86 +1,88 @@ # frozen_string_literal: true module QA - RSpec.describe 'Feature flag handler sanity checks', :sanity_feature_flags do - context 'with an existing feature flag definition file' do - let(:definition) do - path = Pathname.new('../config/feature_flags') - .expand_path(Runtime::Path.qa_root) - .glob('**/*.yml') - .first - YAML.safe_load(File.read(path)) - end + RSpec.describe 'Framework sanity', :sanity_feature_flags do + describe 'Feature flag handler checks' do + context 'with an existing feature flag definition file' do + let(:definition) do + path = Pathname.new('../config/feature_flags') + .expand_path(Runtime::Path.qa_root) + .glob('**/*.yml') + .first + YAML.safe_load(File.read(path)) + end - it 'reads the correct default enabled state' do - # This test will fail if we ever remove all the feature flags, but that's very unlikely given how many there - # are and how much we rely on them. - expect(QA::Runtime::Feature.enabled?(definition['name'])).to be definition['default_enabled'] + it 'reads the correct default enabled state' do + # This test will fail if we ever remove all the feature flags, but that's very unlikely given how many there + # are and how much we rely on them. + expect(QA::Runtime::Feature.enabled?(definition['name'])).to be definition['default_enabled'] + end end - end - describe 'feature flag definition files' do - let(:file) do - path = Pathname.new("#{root}/config/feature_flags/development").expand_path(Runtime::Path.qa_root) - path.mkpath - Tempfile.new(%w[ff-test .yml], path) - end + describe 'feature flag definition files' do + let(:file) do + path = Pathname.new("#{root}/config/feature_flags/development").expand_path(Runtime::Path.qa_root) + path.mkpath + Tempfile.new(%w[ff-test .yml], path) + end - let(:flag) { Pathname.new(file.path).basename('.yml').to_s } - let(:root) { '..' } + let(:flag) { Pathname.new(file.path).basename('.yml').to_s } + let(:root) { '..' } - before do - definition = <<~YAML + before do + definition = <<~YAML name: #{flag} type: development default_enabled: #{flag_enabled} - YAML - File.write(file, definition) - end + YAML + File.write(file, definition) + end - after do - file.close! - end + after do + file.close! + end - shared_examples 'gets flag value' do - context 'with a default disabled feature flag' do - let(:flag_enabled) { 'false' } + shared_examples 'gets flag value' do + context 'with a default disabled feature flag' do + let(:flag_enabled) { 'false' } - it 'reads the flag as disabled' do - expect(QA::Runtime::Feature.enabled?(flag)).to be false - end + it 'reads the flag as disabled' do + expect(QA::Runtime::Feature.enabled?(flag)).to be false + end - it 'reads as enabled after the flag is enabled' do - QA::Runtime::Feature.enable(flag) + it 'reads as enabled after the flag is enabled' do + QA::Runtime::Feature.enable(flag) - expect { QA::Runtime::Feature.enabled?(flag) }.to eventually_be_truthy - .within(max_duration: 60, sleep_interval: 5) + expect { QA::Runtime::Feature.enabled?(flag) }.to eventually_be_truthy + .within(max_duration: 60, sleep_interval: 5) + end end - end - context 'with a default enabled feature flag' do - let(:flag_enabled) { 'true' } + context 'with a default enabled feature flag' do + let(:flag_enabled) { 'true' } - it 'reads the flag as enabled' do - expect(QA::Runtime::Feature.enabled?(flag)).to be true - end + it 'reads the flag as enabled' do + expect(QA::Runtime::Feature.enabled?(flag)).to be true + end - it 'reads as disabled after the flag is disabled' do - QA::Runtime::Feature.disable(flag) + it 'reads as disabled after the flag is disabled' do + QA::Runtime::Feature.disable(flag) - expect { QA::Runtime::Feature.enabled?(flag) }.to eventually_be_falsey - .within(max_duration: 60, sleep_interval: 5) + expect { QA::Runtime::Feature.enabled?(flag) }.to eventually_be_falsey + .within(max_duration: 60, sleep_interval: 5) + end end end - end - context 'with a CE feature flag' do - include_examples 'gets flag value' - end + context 'with a CE feature flag' do + include_examples 'gets flag value' + end - context 'with an EE feature flag' do - let(:root) { '../ee' } + context 'with an EE feature flag' do + let(:root) { '../ee' } - include_examples 'gets flag value' + include_examples 'gets flag value' + end end end end diff --git a/qa/qa/specs/features/sanity/framework_spec.rb b/qa/qa/specs/features/sanity/framework_spec.rb index fa34f525a85..5c80afe338e 100644 --- a/qa/qa/specs/features/sanity/framework_spec.rb +++ b/qa/qa/specs/features/sanity/framework_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Framework sanity checks', :orchestrated, :framework do + RSpec.describe 'Framework sanity', :orchestrated, :framework do describe 'Passing orchestrated example' do it 'succeeds' do Runtime::Browser.visit(:gitlab, Page::Main::Login) diff --git a/qa/qa/specs/features/sanity/interception_spec.rb b/qa/qa/specs/features/sanity/interception_spec.rb index f8930db3aa5..67be832055d 100644 --- a/qa/qa/specs/features/sanity/interception_spec.rb +++ b/qa/qa/specs/features/sanity/interception_spec.rb @@ -1,39 +1,41 @@ # frozen_string_literal: true module QA - RSpec.describe 'Browser request interception', :orchestrated, :framework do - before(:context) do - skip 'Only can test for chrome' unless QA::Runtime::Env.can_intercept? - end + RSpec.describe 'Framework sanity', :orchestrated, :framework do + describe 'Browser request interception' do + before(:context) do + skip 'Only can test for chrome' unless QA::Runtime::Env.can_intercept? + end - before do - Runtime::Browser.visit(:gitlab, Page::Main::Login) - end + before do + Runtime::Browser.visit(:gitlab, Page::Main::Login) + end - let(:page) { Capybara.current_session } - let(:logger) { class_double('QA::Runtime::Logger') } + let(:page) { Capybara.current_session } + let(:logger) { class_double('QA::Runtime::Logger') } - it 'intercepts failed graphql calls' do - page.execute_script <<~JS + it 'intercepts failed graphql calls' do + page.execute_script <<~JS fetch('/api/graphql', { method: 'POST', body: JSON.stringify({ query: 'query {}'}), headers: { 'Content-Type': 'application/json' } }) - JS + JS - Support::Waiter.wait_until do - !get_cached_error.nil? + Support::Waiter.wait_until do + !get_cached_error.nil? + end + expect(**get_cached_error).to include({ 'method' => 'POST', 'status' => 200, 'url' => '/api/graphql' }) end - expect(**get_cached_error).to include({ 'method' => 'POST', 'status' => 200, 'url' => '/api/graphql' }) - end - def get_cached_error - cache = page.execute_script <<~JS + def get_cached_error + cache = page.execute_script <<~JS return Interceptor.getCache() - JS + JS - cache['errors']&.first + cache['errors']&.first + end end end end diff --git a/qa/qa/specs/features/sanity/version_spec.rb b/qa/qa/specs/features/sanity/version_spec.rb index e93a8a6fea1..deefe830c36 100644 --- a/qa/qa/specs/features/sanity/version_spec.rb +++ b/qa/qa/specs/features/sanity/version_spec.rb @@ -7,31 +7,33 @@ module QA # environment variable is the version actually running. # # See https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/1179 - RSpec.describe 'Version sanity check', :smoke, only: { pipeline: [:pre, :release] } do - let(:api_client) { Runtime::API::Client.new(:gitlab) } - let(:request) { Runtime::API::Request.new(api_client, '/version') } + RSpec.describe 'Framework sanity', :smoke, only: { pipeline: [:pre, :release] } do + describe 'Version check' do + let(:api_client) { Runtime::API::Client.new(:gitlab) } + let(:request) { Runtime::API::Request.new(api_client, '/version') } - it 'is the specified version' do - # The `DEPLOY_VERSION` variable will only be provided for deploys to the - # `pre` and `release` environments, which only receive packaged releases. - # - # For these releases, `deploy_version` will be a package string (e.g., - # `13.1.3-ee.0`), and the reported version will be something like - # `13.1.3-ee`, so we only compare the leading SemVer string. - # - # | Package | Version | - # | ---------------- | -------------- | - # | 13.3.5-ee.0 | 13.3.5-ee | - # | 13.3.0-rc42.ee.0 | 13.3.0-rc42-ee | - deploy = Runtime::Env.deploy_version&.gsub(/\A(\d+\.\d+\.\d+).*\z/, '\1') + it 'is the specified version' do + # The `DEPLOY_VERSION` variable will only be provided for deploys to the + # `pre` and `release` environments, which only receive packaged releases. + # + # For these releases, `deploy_version` will be a package string (e.g., + # `13.1.3-ee.0`), and the reported version will be something like + # `13.1.3-ee`, so we only compare the leading SemVer string. + # + # | Package | Version | + # | ---------------- | -------------- | + # | 13.3.5-ee.0 | 13.3.5-ee | + # | 13.3.0-rc42.ee.0 | 13.3.0-rc42-ee | + deploy = Runtime::Env.deploy_version&.gsub(/\A(\d+\.\d+\.\d+).*\z/, '\1') - skip('No deploy version provided') if deploy.nil? || deploy.empty? + skip('No deploy version provided') if deploy.nil? || deploy.empty? - get request.url + get request.url - expect_status(200) - expect(json_body).to have_key(:version) - expect(json_body[:version]).to start_with(deploy) + expect_status(200) + expect(json_body).to have_key(:version) + expect(json_body[:version]).to start_with(deploy) + end end end end diff --git a/qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb b/qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb new file mode 100644 index 00000000000..c6836d11803 --- /dev/null +++ b/qa/qa/specs/features/shared_contexts/advanced_search_shared_context.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module QA + RSpec.shared_context 'advanced search active' do + let!(:advanced_search_on) { check_advanced_search_status } + + before do + QA::EE::Resource::Settings::Elasticsearch.fabricate_via_api! unless advanced_search_on + end + + after do + Runtime::Search.disable_elasticsearch(api_client) if !advanced_search_on && !api_client.nil? + end + + # TODO: convert this method to use the API instead of the UI once the functionality exists + # https://gitlab.com/gitlab-org/gitlab/-/issues/382849 + def check_advanced_search_status + Flow::Login.sign_in + QA::Page::Main::Menu.perform do |menu| + menu.search_for('lorem ipsum') + end + page.has_text?('Advanced search is enabled') + end + end +end diff --git a/qa/qa/specs/features/shared_contexts/import/github_import_shared_context.rb b/qa/qa/specs/features/shared_contexts/import/github_import_shared_context.rb index 27d94b04cde..481a09f601b 100644 --- a/qa/qa/specs/features/shared_contexts/import/github_import_shared_context.rb +++ b/qa/qa/specs/features/shared_contexts/import/github_import_shared_context.rb @@ -35,8 +35,44 @@ module QA end end + let(:smocker_host) { ENV["QA_SMOCKER_HOST"] } + let(:smocker) do + Vendor::Smocker::SmockerApi.new( + host: smocker_host, + public_port: 443, + admin_port: 8081, + tls: true + ) + end + + let(:mocks_path) { File.join(Runtime::Path.fixtures_path, "mocks", "import") } + before do + set_mocks group.add_member(user, Resource::Members::AccessLevel::MAINTAINER) end + + def expect_project_import_finished_successfully + imported_project.reload! # import the project + + status = nil + Support::Retrier.retry_until(max_duration: 240, sleep_interval: 1, raise_on_failure: false) do + status = imported_project.project_import_status[:import_status] + %w[finished failed].include?(status) + end + + # finished status means success, all other statuses are considered to fail the test + expect(status).to eq('finished'), "Expected import to finish successfully, but status was: #{status}" + end + + # Setup github mocked responses if mock server host is present + # + # @return [void] + def set_mocks + return Runtime::Logger.warn("Mock host is not set, skipping github response setup") unless smocker_host + + smocker.reset + smocker.register(File.read(File.join(mocks_path, "github.yml"))) + end end end diff --git a/qa/qa/specs/features/shared_contexts/import/gitlab_group_migration_common.rb b/qa/qa/specs/features/shared_contexts/import/gitlab_group_migration_common.rb index e1d762f41cb..853f427db12 100644 --- a/qa/qa/specs/features/shared_contexts/import/gitlab_group_migration_common.rb +++ b/qa/qa/specs/features/shared_contexts/import/gitlab_group_migration_common.rb @@ -19,6 +19,9 @@ module QA is_new_session: false ) end + let!(:source_bulk_import_enabled) do + Runtime::ApplicationSettings.get_application_settings(api_client: source_admin_api_client)[:bulk_import_enabled] + end let!(:source_admin_user) do Resource::User.fabricate_via_api! do |usr| usr.api_client = source_admin_api_client @@ -36,6 +39,9 @@ module QA # target instance objects # let!(:admin_api_client) { Runtime::API::Client.as_admin } + let!(:target_bulk_import_enabled) do + Runtime::ApplicationSettings.get_application_settings(api_client: admin_api_client)[:bulk_import_enabled] + end let!(:admin_user) do Resource::User.fabricate_via_api! do |usr| usr.api_client = admin_api_client @@ -87,7 +93,8 @@ module QA end before do - Runtime::ApplicationSettings.set_application_settings(bulk_import_enabled: true) + enable_bulk_import(source_admin_api_client) if source_admin_user && !source_bulk_import_enabled + enable_bulk_import(admin_api_client) unless target_bulk_import_enabled target_sandbox.add_member(user, Resource::Members::AccessLevel::OWNER) end @@ -102,5 +109,9 @@ module QA # make sure cleanup runs last cleanup! end + + def enable_bulk_import(api_client) + Runtime::ApplicationSettings.set_application_settings(api_client: api_client, bulk_import_enabled: true) + end end end diff --git a/qa/qa/specs/features/shared_contexts/merge_train_spec_with_user_prep.rb b/qa/qa/specs/features/shared_contexts/merge_train_spec_with_user_prep.rb index 9d1a37cb0b8..8af5dc5463e 100644 --- a/qa/qa/specs/features/shared_contexts/merge_train_spec_with_user_prep.rb +++ b/qa/qa/specs/features/shared_contexts/merge_train_spec_with_user_prep.rb @@ -20,7 +20,7 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::ProjectRunner.fabricate! do |runner| runner.project = project runner.name = executor runner.tags = [executor] diff --git a/qa/qa/specs/features/shared_contexts/packages_registry_shared_context.rb b/qa/qa/specs/features/shared_contexts/packages_registry_shared_context.rb index 73a6c2bd99e..a611a801b11 100644 --- a/qa/qa/specs/features/shared_contexts/packages_registry_shared_context.rb +++ b/qa/qa/specs/features/shared_contexts/packages_registry_shared_context.rb @@ -28,11 +28,11 @@ module QA end let(:runner) do - Resource::Runner.fabricate! do |runner| + Resource::GroupRunner.fabricate! do |runner| runner.name = "qa-runner-#{Time.now.to_i}" runner.tags = ["runner-for-#{package_project.group.name}"] runner.executor = :docker - runner.token = package_project.group.reload!.runners_token + runner.group = package_project.group end end diff --git a/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb b/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb index 45caeced35c..2219031e9c6 100644 --- a/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb +++ b/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb @@ -37,8 +37,8 @@ module QA end let!(:runner) do - Resource::Runner.fabricate! do |runner| - runner.token = group.reload!.runners_token + Resource::GroupRunner.fabricate! do |runner| + runner.group = group runner.name = random_string runner.tags = [random_string] end diff --git a/qa/qa/specs/helpers/context_selector.rb b/qa/qa/specs/helpers/context_selector.rb index caa5ace430f..dfb00cb807b 100644 --- a/qa/qa/specs/helpers/context_selector.rb +++ b/qa/qa/specs/helpers/context_selector.rb @@ -27,7 +27,7 @@ module QA uri = URI(Runtime::Scenario.gitlab_address) options.each do |option| - opts[:domain] = 'gitlab' if option == :production + opts[:domain] = production_domain if option == :production next unless option.is_a?(Hash) @@ -75,6 +75,10 @@ module QA def pipeline_from_project_name(project_name) project_name.to_s.start_with?('gitlab-qa') ? Runtime::Env.default_branch : project_name end + + def production_domain + GitlabEdition.jh? ? 'jihulab' : 'gitlab' + end end end end diff --git a/qa/qa/specs/spec_helper.rb b/qa/qa/specs/spec_helper.rb index 003e8aa74c1..0e6e3973de9 100644 --- a/qa/qa/specs/spec_helper.rb +++ b/qa/qa/specs/spec_helper.rb @@ -28,13 +28,6 @@ RSpec.configure do |config| config.add_formatter QA::Support::Formatters::FeatureFlagFormatter config.add_formatter QA::Support::Formatters::TestMetricsFormatter if QA::Runtime::Env.running_in_ci? - config.before(:suite) do |suite| - QA::Resource::ReusableCollection.register_resource_classes do |collection| - QA::Resource::ReusableProject.register(collection) - QA::Resource::ReusableGroup.register(collection) - end - end - config.prepend_before do |example| QA::Runtime::Logger.info("Starting test: #{Rainbow(example.full_description).bright}") QA::Runtime::Example.current = example @@ -85,24 +78,6 @@ RSpec.configure do |config| config.after(:suite) do |suite| # Write all test created resources to JSON file QA::Tools::TestResourceDataProcessor.write_to_file(suite.reporter.failed_examples.any?) - - # If requested, confirm that resources were used appropriately (e.g., not left with changes that interfere with - # further reuse) - QA::Resource::ReusableCollection.validate_resource_reuse if QA::Runtime::Env.validate_resource_reuse? - - # If any tests failed, leave the resources behind to help troubleshoot, otherwise remove them. - # Do not remove the shared resource on live environments - begin - next if suite.reporter.failed_examples.present? - next unless QA::Runtime::Scenario.attributes.include?(:gitlab_address) - next if QA::Runtime::Env.running_on_dot_com? - - QA::Resource::ReusableCollection.remove_all_via_api! - rescue QA::Resource::Errors::InternalServerError => e - # Temporarily prevent this error from failing jobs while the cause is investigated - # See https://gitlab.com/gitlab-org/gitlab/-/issues/354387 - QA::Runtime::Logger.debug(e.message) - end end config.append_after(:suite) do diff --git a/qa/qa/support/api.rb b/qa/qa/support/api.rb index ea19d9ef332..0081b1c1d46 100644 --- a/qa/qa/support/api.rb +++ b/qa/qa/support/api.rb @@ -144,7 +144,7 @@ module QA end def with_paginated_response_body(url, attempts: 0) - not_ok_error = lambda do |resp| + not_ok_error = ->(resp) do raise "Failed to GET #{masked_url(url)} - (#{resp.code}): `#{resp}`." end @@ -164,7 +164,7 @@ module QA yield parse_body(response) - break if next_page.empty? + break if next_page.blank? url = url.match?(/&page=\d+/) ? url.gsub(/&page=\d+/, "&page=#{next_page}") : "#{url}&page=#{next_page}" end diff --git a/qa/qa/support/formatters/allure_metadata_formatter.rb b/qa/qa/support/formatters/allure_metadata_formatter.rb index c8ddbeb4536..eac74a3b961 100644 --- a/qa/qa/support/formatters/allure_metadata_formatter.rb +++ b/qa/qa/support/formatters/allure_metadata_formatter.rb @@ -3,6 +3,14 @@ module QA module Support module Formatters + # RSpec formatter to enhance metadata present in allure report + # Following additional data is added: + # * quarantine issue links + # * failure issues search link + # * ci job link + # * flaky status and test pass rate + # * devops stage and group as epic and feature behaviour tags + # class AllureMetadataFormatter < ::RSpec::Core::Formatters::BaseFormatter include Support::InfluxdbTools @@ -18,8 +26,6 @@ module QA # @param [RSpec::Core::Notifications::StartNotification] _start_notification # @return [void] def start(_start_notification) - return unless merge_request_iid # on main runs allure native history has pass rate already - save_flaky_specs log(:debug, "Fetched #{flaky_specs.length} flaky testcases!") rescue StandardError => e @@ -63,11 +69,11 @@ module QA # @param [RSpec::Core::Example] example # @return [void] def add_failure_issues_link(example) - spec_file = example.file_path.split('/').last - example.issue( - 'Failure issues', - "https://gitlab.com/gitlab-org/gitlab/-/issues?scope=all&state=opened&search=#{spec_file}" - ) + return unless example.execution_result.status == :failed + + search_query = ERB::Util.url_encode("Failure in #{example.file_path.gsub('./qa/specs/features/', '')}") + search_url = "https://gitlab.com/gitlab-org/gitlab/-/issues?scope=all&state=opened&search=#{search_query}" + example.issue('Failure issues', search_url) rescue StandardError => e log(:error, "Failed to add failure issue link for example '#{example.description}', error: #{e}") end @@ -89,10 +95,10 @@ module QA # @param [RSpec::Core::Example] example # @return [void] def set_flaky_status(example) - return unless merge_request_iid && flaky_specs.key?(example.metadata[:testcase]) + return unless flaky_specs.key?(example.metadata[:testcase]) && example.execution_result.status != :pending example.set_flaky - example.parameter("pass_rate", "#{flaky_specs[example.metadata[:testcase]].round(1)}%") + example.parameter("pass_rate", "#{flaky_specs[example.metadata[:testcase]].round(0)}%") log(:debug, "Setting spec as flaky because it's pass rate is below 98%") rescue StandardError => e log(:error, "Failed to add spec pass rate data for example '#{example.description}', error: #{e}") diff --git a/qa/qa/support/loglinking.rb b/qa/qa/support/loglinking.rb index 5a1aad3c7eb..e9202af3965 100644 --- a/qa/qa/support/loglinking.rb +++ b/qa/qa/support/loglinking.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'active_support/core_ext/integer/time' - module QA module Support module Loglinking @@ -10,22 +8,6 @@ module QA STAGING_REF_ADDRESS = 'https://staging-ref.gitlab.com' PRODUCTION_ADDRESS = 'https://gitlab.com' PRE_PROD_ADDRESS = 'https://pre.gitlab.com' - SENTRY_BASE_URLS = { - staging: 'https://sentry.gitlab.net/gitlab/staginggitlabcom/?environment=gstg', - staging_ref: 'https://sentry.gitlab.net/gitlab/staging-ref/?environment=all', - pre: 'https://sentry.gitlab.net/gitlab/pregitlabcom/?environment=all', - production: 'https://sentry.gitlab.net/gitlab/gitlabcom/?environment=gprd' - }.freeze - KIBANA_BASE_URLS = { - staging: 'https://nonprod-log.gitlab.net/', - production: 'https://log.gprd.gitlab.net/', - pre: 'https://nonprod-log.gitlab.net/' - }.freeze - KIBANA_INDICES = { - staging: 'ed942d00-5186-11ea-ad8a-f3610a492295', - production: '7092c4e2-4eb5-46f2-8305-a7da2edad090', - pre: 'pubsub-rails-inf-pre' - }.freeze class << self def failure_metadata(correlation_id) @@ -33,43 +15,23 @@ module QA errors = ["Correlation Id: #{correlation_id}"] - env = get_logging_environment + env = logging_environment - unless env.nil? - sentry_base_url = get_sentry_base_url(env) - kibana_base_url = get_kibana_base_url(env) - kibana_index = get_kibana_index(env) + sentry = QA::Support::SystemLogs::Sentry.new(env, correlation_id) + sentry_url = sentry.url - errors << "Sentry Url: #{get_sentry_url(sentry_base_url, correlation_id)}" if sentry_base_url - errors << "Kibana Url: #{get_kibana_url(kibana_base_url, kibana_index, correlation_id)}" if kibana_base_url - end + kibana = QA::Support::SystemLogs::Kibana.new(env, correlation_id) + kibana_discover_url = kibana.discover_url + kibana_dashboard_url = kibana.dashboard_url - errors.join("\n") - end + errors << "Sentry Url: #{sentry_url}" if sentry_url + errors << "Kibana - Discover Url: #{kibana_discover_url}" if kibana_discover_url + errors << "Kibana - Dashboard Url: #{kibana_dashboard_url}" if kibana_dashboard_url - def get_sentry_base_url(env) - SENTRY_BASE_URLS[env] - end - - def get_sentry_url(base_url, correlation_id) - "#{base_url}&query=correlation_id%3A%22#{correlation_id}%22" - end - - def get_kibana_base_url(env) - KIBANA_BASE_URLS[env] - end - - def get_kibana_index(env) - KIBANA_INDICES[env] - end - - def get_kibana_url(base_url, index, correlation_id) - "#{base_url}app/discover#/?_a=%28index:%27#{index}%27%2Cquery%3A%28language%3Akuery%2C" \ - "query%3A%27json.correlation_id%20%3A%20#{correlation_id}%27%29%29" \ - "&_g=%28time%3A%28from%3A%27#{start_time}%27%2Cto%3A%27#{end_time}%27%29%29" + errors.join("\n") end - def get_logging_environment + def logging_environment address = QA::Runtime::Scenario.attributes[:gitlab_address] return if address.nil? @@ -86,14 +48,6 @@ module QA nil end end - - def start_time - (Time.now.utc - 24.hours).iso8601(3) - end - - def end_time - Time.now.utc.iso8601(3) - end end end end diff --git a/qa/qa/support/system_logs/kibana.rb b/qa/qa/support/system_logs/kibana.rb new file mode 100644 index 00000000000..056323a6e30 --- /dev/null +++ b/qa/qa/support/system_logs/kibana.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +require 'active_support/core_ext/integer/time' + +module QA + module Support + module SystemLogs + class Kibana + BASE_URLS = { + staging: 'https://nonprod-log.gitlab.net/', + production: 'https://log.gprd.gitlab.net/', + pre: 'https://nonprod-log.gitlab.net/' + }.freeze + INDICES = { + staging: 'ed942d00-5186-11ea-ad8a-f3610a492295', + production: '7092c4e2-4eb5-46f2-8305-a7da2edad090', + pre: 'pubsub-rails-inf-pre' + }.freeze + DASHBOARD_IDS = { + staging: 'b74dc030-6f56-11ed-9af2-6131f0ee4ce6', + production: '5e6d3440-7597-11ed-9f43-e3784d7fe3ca', + pre: '15596340-7570-11ed-9af2-6131f0ee4ce6' + }.freeze + + def initialize(env, correlation_id) + @base_url = BASE_URLS[env] + @index = INDICES[env] + @dashboard_id = DASHBOARD_IDS[env] + @correlation_id = correlation_id + end + + def discover_url + return if @base_url.nil? + + "#{@base_url}app/discover#/?_a=%28index:%27#{@index}%27%2Cquery%3A%28language%3Akuery%2C" \ + "query%3A%27json.correlation_id%20%3A%20#{@correlation_id}%27%29%29" \ + "&_g=%28time%3A%28from%3A%27#{start_time}%27%2Cto%3A%27#{end_time}%27%29%29" + end + + def dashboard_url + return if @base_url.nil? + + "#{@base_url}app/dashboards#/view/#{@dashboard_id}?_g=%28time%3A%28from:%27#{start_time}%27%2C" \ + "to%3A%27#{end_time}%27%29%29&_a=%28filters%3A%21%28%28query%3A%28match_phrase%3A%28" \ + "json.correlation_id%3A%27#{@correlation_id}%27%29%29%29%29%29" + end + + private + + def start_time + (Time.now.utc - 24.hours).iso8601(3) + end + + def end_time + Time.now.utc.iso8601(3) + end + end + end + end +end diff --git a/qa/qa/support/system_logs/sentry.rb b/qa/qa/support/system_logs/sentry.rb new file mode 100644 index 00000000000..a1bd53e7d7a --- /dev/null +++ b/qa/qa/support/system_logs/sentry.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module QA + module Support + module SystemLogs + class Sentry + BASE_URLS = { + staging: 'https://sentry.gitlab.net/gitlab/staginggitlabcom/?environment=gstg', + staging_ref: 'https://sentry.gitlab.net/gitlab/staging-ref/?environment=all', + pre: 'https://sentry.gitlab.net/gitlab/pregitlabcom/?environment=all', + production: 'https://sentry.gitlab.net/gitlab/gitlabcom/?environment=gprd' + }.freeze + + def initialize(env, correlation_id) + @base_url = BASE_URLS[env] + @correlation_id = correlation_id + end + + def url + return if @base_url.nil? + + "#{@base_url}&query=correlation_id%3A%22#{@correlation_id}%22" + end + end + end + end +end diff --git a/qa/qa/tools/delete_subgroups.rb b/qa/qa/tools/delete_subgroups.rb index edf2f0ff5f0..84166ec0038 100644 --- a/qa/qa/tools/delete_subgroups.rb +++ b/qa/qa/tools/delete_subgroups.rb @@ -127,7 +127,7 @@ module QA next unless subgroup_exists?(subgroup) logger.info("Permanently deleting subgroup #{path}...") - delete_subgroup_response = delete(subgroup_request(subgroup, { permanently_remove: true, full_path: path })) + delete_subgroup_response = delete(subgroup_request(subgroup, permanently_remove: true, full_path: path)) process_response_and_subgroup(delete_subgroup_response, subgroup) end diff --git a/qa/qa/vendor/jenkins/job.rb b/qa/qa/vendor/jenkins/job.rb index 46048960fae..1d6918c5548 100644 --- a/qa/qa/vendor/jenkins/job.rb +++ b/qa/qa/vendor/jenkins/job.rb @@ -96,7 +96,7 @@ module QA end xml.concurrentBuild false xml.builders do - xml.send('hudson.tasks.Shell') do + xml.send(:"hudson.tasks.Shell") do xml.command shell_command xml.configuredLocalRules end @@ -115,12 +115,12 @@ module QA if repo_url xml.scm(class: 'hudson.plugins.git.GitSCM') do xml.userRemoteConfigs do - xml.send('hudson.plugins.git.UserRemoteConfig') do + xml.send(:"hudson.plugins.git.UserRemoteConfig") do xml.url repo_url end end xml.branches do - xml.send('hudson.plugins.git.BranchSpec') do + xml.send(:"hudson.plugins.git.BranchSpec") do xml.name end end @@ -133,7 +133,7 @@ module QA def build_gitlab_connection(xml) if gitlab_connection - xml.send('com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty') do + xml.send(:"com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty") do xml.gitLabConnection gitlab_connection end end @@ -141,7 +141,7 @@ module QA def build_gitlab_triggers(xml) if gitlab_connection - xml.send('com.dabsquared.gitlabjenkins.GitLabPushTrigger') do + xml.send(:"com.dabsquared.gitlabjenkins.GitLabPushTrigger") do xml.spec xml.triggerOnPush true xml.triggerOnMergeRequest true @@ -154,7 +154,7 @@ module QA def build_gitlab_publishers(xml) if gitlab_connection - xml.send('com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher') do + xml.send(:"com.dabsquared.gitlabjenkins.publisher.GitLabCommitStatusPublisher") do xml.name 'jenkins' xml.markUnstableAsSuccess false end diff --git a/qa/qa/vendor/smocker/event_payload.rb b/qa/qa/vendor/smocker/event_payload.rb index e7287c741ce..70998e055ea 100644 --- a/qa/qa/vendor/smocker/event_payload.rb +++ b/qa/qa/vendor/smocker/event_payload.rb @@ -41,7 +41,7 @@ module QA end def tag? - event == :tag + event == :tag_push end def wiki? diff --git a/qa/qa/vendor/smocker/smocker_api.rb b/qa/qa/vendor/smocker/smocker_api.rb index 230656776b7..359d1497825 100644 --- a/qa/qa/vendor/smocker/smocker_api.rb +++ b/qa/qa/vendor/smocker/smocker_api.rb @@ -17,36 +17,21 @@ module QA body: '{}' YAML - # @param wait [Integer] seconds to wait for server - # @yieldparam [SmockerApi] the api object ready for interaction - def self.init(**wait_args) - if @container.nil? - @container = Service::DockerRun::Smocker.new - @container.register! - @container.wait_for_running - end - - yield new(@container, **wait_args) - end - - def self.teardown! - @container&.remove! - @container = nil - end - - def initialize(container, **wait_args) - @container = container - wait_for_ready(**wait_args) + def initialize(host:, public_port: 8080, admin_port: 8081, tls: false) + @host = host + @public_port = public_port + @admin_port = admin_port + @scheme = tls ? "https" : "http" end # @return [String] Base url of mock endpoint def base_url - @container.base_url + @base_url ||= "#{scheme}://#{host}:#{public_port}" end # @return [String] Url of admin endpoint def admin_url - @container.admin_url + @admin_url ||= "#{scheme}://#{host}:#{admin_port}" end # @param endpoint [String] path for mock endpoint @@ -130,6 +115,8 @@ module QA private + attr_reader :host, :public_port, :admin_port, :scheme + def build_params(**args) args.each_with_object([]) do |(k, v), memo| memo << "#{k}=#{v}" if v diff --git a/qa/spec/resource/api_fabricator_spec.rb b/qa/spec/resource/api_fabricator_spec.rb index 76cc8e0e303..0cec6b2a1ea 100644 --- a/qa/spec/resource/api_fabricator_spec.rb +++ b/qa/spec/resource/api_fabricator_spec.rb @@ -125,7 +125,7 @@ RSpec.describe QA::Resource::ApiFabricator do it 'logs a correlation id' do response = double('Raw POST response', code: 400, body: post_response.to_json, headers: { x_request_id: 'foobar' }) - allow(QA::Support::Loglinking).to receive(:get_logging_environment).and_return(nil) + allow(QA::Support::Loglinking).to receive(:logging_environment).and_return(nil) expect(api_request).to receive(:new).with(api_client_instance, subject.api_post_path).and_return(double(url: resource_web_url)) expect(subject).to receive(:post).with(resource_web_url, subject.api_post_body).and_return(response) @@ -157,7 +157,8 @@ RSpec.describe QA::Resource::ApiFabricator do Fabrication of FooBarResource using the API failed (400) with `#{raw_post}`. Correlation Id: foobar Sentry Url: https://sentry.gitlab.net/gitlab/staginggitlabcom/?environment=gstg&query=correlation_id%3A%22foobar%22 - Kibana Url: https://nonprod-log.gitlab.net/app/discover#/?_a=%28index:%27ed942d00-5186-11ea-ad8a-f3610a492295%27%2Cquery%3A%28language%3Akuery%2Cquery%3A%27json.correlation_id%20%3A%20foobar%27%29%29&_g=%28time%3A%28from%3A%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29 + Kibana - Discover Url: https://nonprod-log.gitlab.net/app/discover#/?_a=%28index:%27ed942d00-5186-11ea-ad8a-f3610a492295%27%2Cquery%3A%28language%3Akuery%2Cquery%3A%27json.correlation_id%20%3A%20foobar%27%29%29&_g=%28time%3A%28from%3A%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29 + Kibana - Dashboard Url: https://nonprod-log.gitlab.net/app/dashboards#/view/b74dc030-6f56-11ed-9af2-6131f0ee4ce6?_g=%28time%3A%28from:%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29&_a=%28filters%3A%21%28%28query%3A%28match_phrase%3A%28json.correlation_id%3A%27foobar%27%29%29%29%29%29 ERROR end end diff --git a/qa/spec/resource/reusable_collection_spec.rb b/qa/spec/resource/reusable_collection_spec.rb deleted file mode 100644 index cb2df6931d0..00000000000 --- a/qa/spec/resource/reusable_collection_spec.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -RSpec.describe QA::Resource::ReusableCollection do - let(:reusable_resource_class) do - Class.new do - prepend QA::Resource::Reusable - - attr_reader :removed - - def self.name - 'FooReusableResource' - end - - def comparable - self.class.name - end - - def remove_via_api! - @removed = true - end - - def exists?() end - - def reload! - Struct.new(:api_resource).new({ marked_for_deletion_on: false }) - end - end - end - - let(:another_reusable_resource_class) do - Class.new(reusable_resource_class) do - def self.name - 'BarReusableResource' - end - end - end - - let(:a_resource_instance) { reusable_resource_class.new } - let(:another_resource_instance) { another_reusable_resource_class.new } - - it 'is a singleton class' do - expect { described_class.new }.to raise_error(NoMethodError) - end - - subject(:collection) do - described_class.instance - end - - before do - described_class.register_resource_classes do |c| - reusable_resource_class.register(c) - another_reusable_resource_class.register(c) - end - - collection.resource_classes = { - 'FooReusableResource' => { - reuse_as_identifier: { - resource: a_resource_instance - } - }, - 'BarReusableResource' => { - another_reuse_as_identifier: { - resource: another_resource_instance - } - } - } - - allow(a_resource_instance).to receive(:validate_reuse) - allow(another_resource_instance).to receive(:validate_reuse) - end - - after do - collection.resource_classes = {} - end - - describe '#each_resource' do - it 'yields each resource and reuse_as identifier in the collection' do - expect { |blk| collection.each_resource(&blk) } - .to yield_successive_args( - [:reuse_as_identifier, a_resource_instance], - [:another_reuse_as_identifier, another_resource_instance] - ) - end - end - - describe '.remove_all_via_api!' do - before do - allow(a_resource_instance).to receive(:exists?).and_return(true) - allow(another_resource_instance).to receive(:exists?).and_return(true) - end - - it 'removes each instance of each resource class' do - described_class.remove_all_via_api! - - expect(a_resource_instance.removed).to be_truthy - expect(another_resource_instance.removed).to be_truthy - end - - context 'when a resource is marked for deletion' do - before do - marked_for_deletion = Struct.new(:api_resource).new({ marked_for_deletion_on: true }) - - allow(a_resource_instance).to receive(:reload!).and_return(marked_for_deletion) - allow(another_resource_instance).to receive(:reload!).and_return(marked_for_deletion) - end - - it 'does not remove the resource' do - expect(a_resource_instance.removed).to be_falsey - expect(another_resource_instance.removed).to be_falsy - end - end - end - - describe '.validate_resource_reuse' do - it 'validates each instance of each resource class' do - expect(a_resource_instance).to receive(:validate_reuse) - expect(another_resource_instance).to receive(:validate_reuse) - - described_class.validate_resource_reuse - end - end - - describe '.register_resource_classes' do - it 'yields the hash of resource classes in the collection' do - expect { |blk| described_class.register_resource_classes(&blk) }.to yield_with_args(collection.resource_classes) - end - end -end diff --git a/qa/spec/runtime/application_settings_spec.rb b/qa/spec/runtime/application_settings_spec.rb index 5c4947f6f70..d387bf0995a 100644 --- a/qa/spec/runtime/application_settings_spec.rb +++ b/qa/spec/runtime/application_settings_spec.rb @@ -1,14 +1,10 @@ # frozen_string_literal: true RSpec.describe QA::Runtime::ApplicationSettings do - let(:api_client) { double('QA::Runtime::API::Client') } + let(:api_client) { instance_double(QA::Runtime::API::Client) } let(:request) { Struct.new(:url).new('http://api') } let(:get_response) { Struct.new(:body).new("{}") } - before do - allow(described_class).to receive(:api_client).and_return(api_client) - end - describe '.set_application_settings' do it 'sets application settings' do expect(QA::Runtime::API::Request) @@ -23,7 +19,10 @@ RSpec.describe QA::Runtime::ApplicationSettings do .with(request.url, { allow_local_requests_from_web_hooks_and_services: true }) .and_return(Struct.new(:code).new(200)) - described_class.set_application_settings(allow_local_requests_from_web_hooks_and_services: true) + described_class.set_application_settings( + api_client: api_client, + allow_local_requests_from_web_hooks_and_services: true + ) end end @@ -39,7 +38,7 @@ RSpec.describe QA::Runtime::ApplicationSettings do .with(request.url) .and_return(get_response) - described_class.get_application_settings + described_class.get_application_settings(api_client: api_client) end end end diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb index 95970800a4e..84d3199a274 100644 --- a/qa/spec/spec_helper.rb +++ b/qa/spec/spec_helper.rb @@ -3,3 +3,4 @@ require_relative '../qa' require_relative 'scenario_shared_examples' +require_relative('../../jh/qa/spec/spec_helper') if GitlabEdition.jh? diff --git a/qa/spec/support/formatters/allure_metadata_formatter_spec.rb b/qa/spec/support/formatters/allure_metadata_formatter_spec.rb index d84e190fd56..ab3b753c3b0 100644 --- a/qa/spec/support/formatters/allure_metadata_formatter_spec.rb +++ b/qa/spec/support/formatters/allure_metadata_formatter_spec.rb @@ -5,25 +5,33 @@ describe QA::Support::Formatters::AllureMetadataFormatter do let(:formatter) { described_class.new(StringIO.new) } - let(:rspec_example_notification) { double('RSpec::Core::Notifications::ExampleNotification', example: rspec_example) } + let(:rspec_example_notification) do + instance_double(RSpec::Core::Notifications::ExampleNotification, example: rspec_example) + end + + # rubocop:disable RSpec/VerifiedDoubles let(:rspec_example) do double( - 'RSpec::Core::Example', + RSpec::Core::Example, tms: nil, issue: nil, add_link: nil, + set_flaky: nil, + parameter: nil, attempts: 0, - file_path: 'file/path/spec.rb', - execution_result: instance_double("RSpec::Core::Example::ExecutionResult", status: :passed), + file_path: 'spec.rb', + execution_result: instance_double(RSpec::Core::Example::ExecutionResult, status: status), metadata: { testcase: 'testcase', quarantine: { issue: 'issue' } } ) end + # rubocop:enable RSpec/VerifiedDoubles let(:ci_job) { 'ee:relative 5' } let(:ci_job_url) { 'url' } + let(:status) { :failed } before do stub_env('CI', 'true') @@ -31,16 +39,62 @@ describe QA::Support::Formatters::AllureMetadataFormatter do stub_env('CI_JOB_URL', ci_job_url) end - it "adds additional data to report" do - formatter.example_finished(rspec_example_notification) + context 'with links' do + it 'adds quarantine, failure issue and ci job links', :aggregate_failures do + formatter.example_finished(rspec_example_notification) - aggregate_failures do expect(rspec_example).to have_received(:issue).with('Quarantine issue', 'issue') expect(rspec_example).to have_received(:add_link).with(name: "Job(#{ci_job})", url: ci_job_url) expect(rspec_example).to have_received(:issue).with( 'Failure issues', - 'https://gitlab.com/gitlab-org/gitlab/-/issues?scope=all&state=opened&search=spec.rb' + 'https://gitlab.com/gitlab-org/gitlab/-/issues?scope=all&state=opened&search=Failure%20in%20spec.rb' ) end end + + context 'with flaky test data', :aggregate_failures do + let(:influx_client) { instance_double(InfluxDB2::Client, create_query_api: influx_query_api) } + let(:influx_query_api) { instance_double(InfluxDB2::QueryApi, query: data) } + let(:data) do + [ + instance_double( + InfluxDB2::FluxTable, + records: [ + instance_double(InfluxDB2::FluxRecord, values: { 'status' => 'failed', 'testcase' => 'testcase' }), + instance_double(InfluxDB2::FluxRecord, values: { 'status' => 'passed', 'testcase' => 'testcase' }) + ] + ) + ] + end + + before do + stub_env('QA_RUN_TYPE', 'package-and-test') + stub_env('QA_INFLUXDB_URL', 'url') + stub_env('QA_INFLUXDB_TOKEN', 'token') + + allow(InfluxDB2::Client).to receive(:new) { influx_client } + end + + context 'with non skipped spec' do + it 'adds flaky test data' do + formatter.start(nil) + formatter.example_finished(rspec_example_notification) + + expect(rspec_example).to have_received(:set_flaky) + expect(rspec_example).to have_received(:parameter).with('pass_rate', '50%') + end + end + + context 'with skipped spec' do + let(:status) { :pending } + + it 'skips adding flaky test data' do + formatter.start(nil) + formatter.example_finished(rspec_example_notification) + + expect(rspec_example).not_to have_received(:set_flaky) + expect(rspec_example).not_to have_received(:parameter) + end + end + end end diff --git a/qa/spec/support/loglinking_spec.rb b/qa/spec/support/loglinking_spec.rb index 3955d266ef6..79004630253 100644 --- a/qa/spec/support/loglinking_spec.rb +++ b/qa/spec/support/loglinking_spec.rb @@ -13,103 +13,76 @@ RSpec.describe QA::Support::Loglinking do end context 'when correlation_id exists' do - context 'and logging environment exists' do - it 'returns Sentry URL' do - allow(QA::Support::Loglinking).to receive(:get_logging_environment).and_return(:foo) - allow(QA::Support::Loglinking).to receive(:get_sentry_base_url).and_return('https://sentry.address/?environment=bar') - allow(QA::Support::Loglinking).to receive(:get_kibana_base_url).and_return(nil) - allow(QA::Support::Loglinking).to receive(:get_kibana_index).and_return(nil) + let(:correlation_id) { 'foo123' } + let(:sentry_url) { "https://sentry.address/?environment=bar&query=correlation_id%3A%22#{correlation_id}%22" } + let(:discover_url) { "https://kibana.address/app/discover#/?_a=%28index:%27pubsub-rails-inf-foo%27%2Cquery%3A%28language%3Akuery%2Cquery%3A%27json.correlation_id%20%3A%20#{correlation_id}%27%29%29&_g=%28time%3A%28from%3A%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29" } + let(:dashboard_url) { "https://kibana.address/app/dashboards#/view/abc-123-dashboard-id?_g=%28time%3A%28from:%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29&_a=%28filters%3A%21%28%28query%3A%28match_phrase%3A%28json.correlation_id%3A%27#{correlation_id}%27%29%29%29%29%29" } + + before do + allow(QA::Support::SystemLogs::Sentry).to receive(:new).and_return(sentry) + allow(QA::Support::SystemLogs::Kibana).to receive(:new).and_return(kibana) + end - expect(QA::Support::Loglinking.failure_metadata('foo123')).to eql(<<~ERROR.chomp) - Correlation Id: foo123 - Sentry Url: https://sentry.address/?environment=bar&query=correlation_id%3A%22foo123%22 - ERROR + context 'and both Sentry and Kibana exist for the logging environment' do + let(:sentry) { instance_double(QA::Support::SystemLogs::Sentry, url: sentry_url) } + let(:kibana) do + instance_double(QA::Support::SystemLogs::Kibana, + discover_url: discover_url, dashboard_url: dashboard_url) end - it 'returns Kibana URL' do - time = Time.new(2022, 11, 14, 0, 0, 0, '+00:00') - - allow(QA::Support::Loglinking).to receive(:get_logging_environment).and_return(:foo) - allow(QA::Support::Loglinking).to receive(:get_sentry_base_url).and_return(nil) - allow(QA::Support::Loglinking).to receive(:get_kibana_base_url).and_return('https://kibana.address/') - allow(QA::Support::Loglinking).to receive(:get_kibana_index).and_return('pubsub-rails-inf-foo') - allow(Time).to receive(:now).and_return(time) - - expect(QA::Support::Loglinking.failure_metadata('foo123')).to eql(<<~ERROR.chomp) + it 'returns both Sentry and Kibana URLs' do + expect(QA::Support::Loglinking.failure_metadata(correlation_id)).to eql(<<~ERROR.chomp) Correlation Id: foo123 - Kibana Url: https://kibana.address/app/discover#/?_a=%28index:%27pubsub-rails-inf-foo%27%2Cquery%3A%28language%3Akuery%2Cquery%3A%27json.correlation_id%20%3A%20foo123%27%29%29&_g=%28time%3A%28from%3A%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29 + Sentry Url: #{sentry_url} + Kibana - Discover Url: #{discover_url} + Kibana - Dashboard Url: #{dashboard_url} ERROR end end - context 'and logging environment does not exist' do - it 'returns only the correlation ID' do - allow(QA::Support::Loglinking).to receive(:get_logging_environment).and_return(nil) - - expect(QA::Support::Loglinking.failure_metadata('foo123')).to eql('Correlation Id: foo123') + context 'and only Sentry exists for the logging environment' do + let(:sentry) { instance_double(QA::Support::SystemLogs::Sentry, url: sentry_url) } + let(:kibana) do + instance_double(QA::Support::SystemLogs::Kibana, + discover_url: nil, dashboard_url: nil) end - end - end - end - describe '.get_sentry_base_url' do - let(:url_hash) do - { - :staging => 'https://sentry.gitlab.net/gitlab/staginggitlabcom/?environment=gstg', - :staging_ref => 'https://sentry.gitlab.net/gitlab/staging-ref/?environment=all', - :pre => 'https://sentry.gitlab.net/gitlab/pregitlabcom/?environment=all', - :production => 'https://sentry.gitlab.net/gitlab/gitlabcom/?environment=gprd', - :foo => nil, - nil => nil - } - end - - it 'returns Sentry base URL based on environment' do - url_hash.each do |environment, url| - expect(QA::Support::Loglinking.get_sentry_base_url(environment)).to eq(url) + it 'returns only Sentry URL' do + expect(QA::Support::Loglinking.failure_metadata(correlation_id)).to eql(<<~ERROR.chomp) + Correlation Id: foo123 + Sentry Url: #{sentry_url} + ERROR + end end - end - end - describe '.get_kibana_base_url' do - let(:url_hash) do - { - :staging => 'https://nonprod-log.gitlab.net/', - :staging_ref => nil, - :production => 'https://log.gprd.gitlab.net/', - :pre => 'https://nonprod-log.gitlab.net/', - :foo => nil, - nil => nil - } - end + context 'and only Kibana exists for the logging environment' do + let(:sentry) { instance_double(QA::Support::SystemLogs::Sentry, url: nil) } + let(:kibana) do + instance_double(QA::Support::SystemLogs::Kibana, + discover_url: discover_url, dashboard_url: dashboard_url) + end - it 'returns Kibana URL based on environment' do - url_hash.each do |environment, url| - expect(QA::Support::Loglinking.get_kibana_base_url(environment)).to eq(url) + it 'returns only Kibana Discover and Dashboard URLs' do + expect(QA::Support::Loglinking.failure_metadata(correlation_id)).to eql(<<~ERROR.chomp) + Correlation Id: foo123 + Kibana - Discover Url: #{discover_url} + Kibana - Dashboard Url: #{dashboard_url} + ERROR + end end - end - end - describe '.get_kibana_index' do - let(:index_hash) do - { - :staging => 'ed942d00-5186-11ea-ad8a-f3610a492295', - :staging_ref => nil, - :production => '7092c4e2-4eb5-46f2-8305-a7da2edad090', - :pre => 'pubsub-rails-inf-pre', - :foo => nil, - nil => nil - } - end + context 'and neither Sentry nor Kibana exists for the logging environment' do + let(:sentry) { instance_double(QA::Support::SystemLogs::Sentry, url: nil) } + let(:kibana) { instance_double(QA::Support::SystemLogs::Kibana, discover_url: nil, dashboard_url: nil) } - it 'returns Kibana index based on environment' do - index_hash.each do |environment, index| - expect(QA::Support::Loglinking.get_kibana_index(environment)).to eq(index) + it 'returns only the correlation ID' do + expect(QA::Support::Loglinking.failure_metadata(correlation_id)).to eql("Correlation Id: #{correlation_id}") + end end end end - describe '.get_logging_environment' do + describe '.logging_environment' do let(:staging_address) { 'https://staging.gitlab.com' } let(:staging_ref_address) { 'https://staging-ref.gitlab.com' } let(:production_address) { 'https://gitlab.com' } @@ -143,7 +116,7 @@ RSpec.describe QA::Support::Loglinking do logging_env_array.each do |logging_env_hash| allow(QA::Runtime::Scenario).to receive(:attributes).and_return({ gitlab_address: logging_env_hash[:address] }) - expect(QA::Support::Loglinking.get_logging_environment).to eq(logging_env_hash[:expected_env]) + expect(QA::Support::Loglinking.logging_environment).to eq(logging_env_hash[:expected_env]) end end end diff --git a/qa/spec/support/system_logs/kibana_spec.rb b/qa/spec/support/system_logs/kibana_spec.rb new file mode 100644 index 00000000000..7e13f5a0a06 --- /dev/null +++ b/qa/spec/support/system_logs/kibana_spec.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +RSpec.describe QA::Support::SystemLogs::Kibana do + using RSpec::Parameterized::TableSyntax + + let(:correlation_id) { 'foo123' } + + shared_examples 'returns the expected URL' do + where(:env, :expected_url) do + :staging | ref(:staging_url) + :production | ref(:production_url) + :pre | ref(:pre_url) + :foo | nil + nil | nil + end + + with_them do + before do + allow(Time).to receive(:now).and_return(Time.new(2022, 11, 14, 0, 0, 0, '+00:00')) + end + + specify do + expect(subject).to eq(expected_url) + end + end + end + + describe '#discover_url' do + subject { described_class.new(env, correlation_id).discover_url } + + let(:staging_url) do + "https://nonprod-log.gitlab.net/app/discover#/?_a=%28index:%27ed942d00-5186-11ea-ad8a-f3610a492295%27" \ + "%2Cquery%3A%28language%3Akuery%2Cquery%3A%27json.correlation_id%20%3A%20#{correlation_id}%27%29" \ + "%29&_g=%28time%3A%28from%3A%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29" + end + + let(:production_url) do + "https://log.gprd.gitlab.net/app/discover#/?_a=%28index:%277092c4e2-4eb5-46f2-8305-a7da2edad090%27" \ + "%2Cquery%3A%28language%3Akuery%2Cquery%3A%27json.correlation_id%20%3A%20#{correlation_id}%27%29" \ + "%29&_g=%28time%3A%28from%3A%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29" + end + + let(:pre_url) do + "https://nonprod-log.gitlab.net/app/discover#/?_a=%28index:%27pubsub-rails-inf-pre%27" \ + "%2Cquery%3A%28language%3Akuery%2Cquery%3A%27json.correlation_id%20%3A%20#{correlation_id}%27%29" \ + "%29&_g=%28time%3A%28from%3A%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29" + end + + it_behaves_like 'returns the expected URL' + end + + describe '#dashboard_url' do + subject { described_class.new(env, correlation_id).dashboard_url } + + let(:staging_url) do + "https://nonprod-log.gitlab.net/app/dashboards#/view/b74dc030-6f56-11ed-9af2-6131f0ee4ce6?_g=%28time" \ + "%3A%28from:%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29&_a=%28filters%3A%21" \ + "%28%28query%3A%28match_phrase%3A%28json.correlation_id%3A%27#{correlation_id}%27%29%29%29%29%29" + end + + let(:production_url) do + "https://log.gprd.gitlab.net/app/dashboards#/view/5e6d3440-7597-11ed-9f43-e3784d7fe3ca?_g=%28time" \ + "%3A%28from:%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29&_a=%28filters%3A%21" \ + "%28%28query%3A%28match_phrase%3A%28json.correlation_id%3A%27#{correlation_id}%27%29%29%29%29%29" + end + + let(:pre_url) do + "https://nonprod-log.gitlab.net/app/dashboards#/view/15596340-7570-11ed-9af2-6131f0ee4ce6?_g=%28time" \ + "%3A%28from:%272022-11-13T00:00:00.000Z%27%2Cto%3A%272022-11-14T00:00:00.000Z%27%29%29&_a=%28filters%3A%21" \ + "%28%28query%3A%28match_phrase%3A%28json.correlation_id%3A%27#{correlation_id}%27%29%29%29%29%29" + end + + it_behaves_like 'returns the expected URL' + end +end diff --git a/qa/spec/support/system_logs/sentry_spec.rb b/qa/spec/support/system_logs/sentry_spec.rb new file mode 100644 index 00000000000..6821c527b23 --- /dev/null +++ b/qa/spec/support/system_logs/sentry_spec.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +RSpec.describe QA::Support::SystemLogs::Sentry do + using RSpec::Parameterized::TableSyntax + + let(:correlation_id) { 'foo123' } + + describe '#url' do + subject { described_class.new(env, correlation_id).url } + + let(:staging_url) do + "https://sentry.gitlab.net/gitlab/staginggitlabcom/?environment=gstg&query=correlation_id%3A%22#{correlation_id}%22" + end + + let(:staging_ref_url) do + "https://sentry.gitlab.net/gitlab/staging-ref/?environment=all&query=correlation_id%3A%22#{correlation_id}%22" + end + + let(:pre_url) do + "https://sentry.gitlab.net/gitlab/pregitlabcom/?environment=all&query=correlation_id%3A%22#{correlation_id}%22" + end + + let(:production_url) do + "https://sentry.gitlab.net/gitlab/gitlabcom/?environment=gprd&query=correlation_id%3A%22#{correlation_id}%22" + end + + where(:env, :expected_url) do + :staging | ref(:staging_url) + :staging_ref | ref(:staging_ref_url) + :production | ref(:production_url) + :pre | ref(:pre_url) + :foo | nil + nil | nil + end + + with_them do + it 'returns the expected URL' do + expect(subject).to eq(expected_url) + end + end + end +end |