diff --git a/.gitlab/ci/qa-common/variables.gitlab-ci.yml b/.gitlab/ci/qa-common/variables.gitlab-ci.yml index 29fc40b8a52..2fc9aaf3b62 100644 --- a/.gitlab/ci/qa-common/variables.gitlab-ci.yml +++ b/.gitlab/ci/qa-common/variables.gitlab-ci.yml @@ -18,7 +18,7 @@ variables: # Helm chart ref used by test-on-cng pipeline GITLAB_HELM_CHART_REF: "6cdb0e1cd4ceb7c9fd01ffa2f62c4a7a4c77a23b" # Specific ref for cng-mirror project to trigger builds for - GITLAB_CNG_MIRROR_REF: "8c4bbd04b509dc6cc3cb0469066ef053db028607" + GITLAB_CNG_MIRROR_REF: "00736d96dbee30eaf6fa3701f0cfa99ad8621cf4" # Makes sure some of the common scripts from pipeline-common use bundler to execute commands RUN_WITH_BUNDLE: "true" # Makes sure reporting script defined in .gitlab-qa-report from pipeline-common is executed from correct folder diff --git a/.gitlab/ci/test-on-cng/main.gitlab-ci.yml b/.gitlab/ci/test-on-cng/main.gitlab-ci.yml index 4a21528afea..9389e131db0 100644 --- a/.gitlab/ci/test-on-cng/main.gitlab-ci.yml +++ b/.gitlab/ci/test-on-cng/main.gitlab-ci.yml @@ -84,7 +84,7 @@ workflow: --print-deploy-args \ $(cat $CI_PROJECT_DIR/EXTRA_DEPLOY_VALUES) artifacts: - expire_in: 1 day + expire_in: 7 days when: always reports: junit: qa/tmp/rspec-*.xml diff --git a/GITLAB_KAS_VERSION b/GITLAB_KAS_VERSION index 8988e0f1e94..cce98a73a4a 100644 --- a/GITLAB_KAS_VERSION +++ b/GITLAB_KAS_VERSION @@ -1 +1 @@ -311c173844ce85e28e51818063bcac8e75dee41e +6093f9c42ad8d328c37423e3067f3c9e7cd1ddcf diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 0ae85ff88a9..5e327e2a7ba 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -3,7 +3,7 @@ import { __ } from '~/locale'; import { validateAdditionalProperties } from '~/tracking/utils'; import * as Sentry from '~/sentry/sentry_browser_wrapper'; import axios from './lib/utils/axios_utils'; -import { joinPaths } from './lib/utils/url_utility'; +import { joinPaths, isAbsolute } from './lib/utils/url_utility'; export const DEFAULT_PER_PAGE = 20; @@ -963,8 +963,30 @@ const Api = { }); }, + /** + * buildUrl (1) replaces `:version` placeholder by `gon.api_version` and + * (2) prepends the url with `gon.relative_url_root`, if the `url` argument + * is not an absolute URL (http://...). + * + * Using `gon.relative_url_root` is vital for GitLab instances installed on + * relative paths: https://docs.gitlab.com/install/relative_url/. + * + * In Rails, **API** paths, like `api_v..._path`, do not include the + * `gon.relative_url_root`. Since Rails doesn't provide `api_v..._url` helpers, + * `expose_url` backend method can be used as an alternative to `buildUrl`. + * + * buildUrl('/api/:version/projects/1') => '/[relative_url_root]/api/v4/projects/1' + * + * @param {string} url - + */ buildUrl(url) { - return joinPaths(gon.relative_url_root || '', url.replace(':version', gon.api_version)); + const withVersion = url.replace(':version', gon.api_version); + + if (isAbsolute(withVersion)) { + return withVersion; + } + + return joinPaths(gon.relative_url_root || '', withVersion); }, fetchFeatureFlagUserLists(id, page) { diff --git a/app/assets/javascripts/groups/init_overview_tabs.js b/app/assets/javascripts/groups/init_overview_tabs.js index 669502c7589..9f0a434b18f 100644 --- a/app/assets/javascripts/groups/init_overview_tabs.js +++ b/app/assets/javascripts/groups/init_overview_tabs.js @@ -17,7 +17,7 @@ export const createRouter = () => { { name: ACTIVE_TAB_SHARED, path: '/groups/:group*/-/shared' }, { name: ACTIVE_TAB_SHARED_GROUPS, path: '/groups/:group*/-/shared_groups' }, { name: ACTIVE_TAB_INACTIVE, path: '/groups/:group*/-/inactive' }, - { name: ACTIVE_TAB_SUBGROUPS_AND_PROJECTS, path: '/:group*' }, + { name: ACTIVE_TAB_SUBGROUPS_AND_PROJECTS, path: '/(groups)?/:group*' }, ]; const router = new VueRouter({ diff --git a/app/assets/javascripts/import_entities/import_groups/components/import_source_cell.vue b/app/assets/javascripts/import_entities/import_groups/components/import_source_cell.vue index b41fed4ea10..de2764e16b8 100644 --- a/app/assets/javascripts/import_entities/import_groups/components/import_source_cell.vue +++ b/app/assets/javascripts/import_entities/import_groups/components/import_source_cell.vue @@ -29,12 +29,8 @@ export default {