diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb index 15563e3aa2aa012f11692e0819637f7d27403ab1..d671f0c21d72be66b53c3e6d5dfb7bf62e2cc9ef 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb @@ -5,8 +5,10 @@ module QA # Keep spec in reliable bucket but don't run in blocking pipelines RSpec.describe 'Manage', :github, :reliable, :skip_live_env, :requires_admin, product_group: :import do describe 'GitHub import' do + include QA::Support::Data::Github + context 'when imported via UI' do - let(:github_repo) { 'gitlab-qa-github/import-test' } + let(:github_repo) { "#{github_username}/import-test" } let(:api_client) { Runtime::API::Client.as_admin } let(:group) { Resource::Group.fabricate_via_api! { |resource| resource.api_client = api_client } } let(:user) do diff --git a/qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_for_project_mirror_github_spec.rb b/qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_for_project_mirror_github_spec.rb index f8633d6d2035d6019de784e83412441ccc86a7d9..0f8eaa770cc0d3333559b6ebef17a4b1b4e72bc0 100644 --- a/qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_for_project_mirror_github_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_for_project_mirror_github_spec.rb @@ -5,6 +5,8 @@ module QA describe 'Verify', :github, :requires_admin, only: { subdomain: %i[staging staging-canary] } do describe 'Pipeline for project mirrors Github', product_group: :pipeline_execution do + include QA::Support::Data::Github + let(:commit_message) { "Update #{github_data[:file_name]} - #{Time.now}" } let(:project_name) { 'github-project-with-pipeline' } let(:github_client) { Octokit::Client.new(access_token: github_data[:access_token]) } @@ -14,7 +16,7 @@ module QA { access_token: Runtime::Env.github_access_token, file_name: 'text_file.txt', - repo: 'gitlab-qa-github/test-project' + repo: "#{github_username}/test-project" } 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 0a0c2a4a6dfb231fe96a9e4e37a85aa19d81da65..da808548605a6aa241b9e41386b80ea10e1b2dbb 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 @@ -5,6 +5,8 @@ module QA type: :broken, issue: "https://gitlab.com/gitlab-org/gitlab/-/issues/382166" } do + include QA::Support::Data::Github + let!(:api_client) { Runtime::API::Client.as_admin } let!(:group) do @@ -28,7 +30,7 @@ module QA project.name = 'imported-project' project.group = group project.github_personal_access_token = Runtime::Env.github_access_token - project.github_repository_path = 'gitlab-qa-github/import-test' + project.github_repository_path = "#{github_username}/import-test" project.api_client = user_api_client project.issue_events_import = true project.full_notes_import = true diff --git a/qa/qa/support/data/github.rb b/qa/qa/support/data/github.rb new file mode 100644 index 0000000000000000000000000000000000000000..b0fe1baeff8a9d2f596e9d44376eebb8ba9c9b6c --- /dev/null +++ b/qa/qa/support/data/github.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module QA + module Support + module Data + module Github + def github_username + 'gitlab-qa-github' + end + end + end + end +end + +QA::Support::Data::Github.prepend_mod_with('Support::Data::Github', namespace: QA)