From 6d5a18ac65db79f3a32fb06618a4c4b7a08e777b Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 11 Nov 2020 18:09:10 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/cache-repo.gitlab-ci.yml | 41 ++- .../javascripts/registry/explorer/utils.js | 4 +- .../releases/components/app_index.vue | 26 +- .../releases/components/releases_sort.vue | 62 ++++ app/assets/javascripts/releases/constants.js | 18 ++ .../queries/all_releases.query.graphql | 11 +- .../releases/queries/release.fragment.graphql | 1 + .../releases/stores/modules/list/actions.js | 11 +- .../stores/modules/list/mutation_types.js | 1 + .../releases/stores/modules/list/mutations.js | 4 + .../releases/stores/modules/list/state.js | 6 + .../components/assignees/assignee_title.vue | 3 +- app/helpers/icons_helper.rb | 46 +-- ...tlab-ui-component-for-sorting-releases.yml | 5 + config/initializers/0_inject_feature_flags.rb | 1 - doc/.vale/gitlab/Acronyms.yml | 1 + doc/ci/docker/using_docker_images.md | 4 +- doc/ci/migration/jenkins.md | 2 +- doc/ci/runners/README.md | 10 +- doc/ci/ssh_keys/README.md | 2 +- doc/ci/variables/predefined_variables.md | 2 +- .../variables/where_variables_can_be_used.md | 2 +- doc/ci/yaml/README.md | 287 +++++------------- doc/ci/yaml/script.md | 147 +++++++++ doc/development/fe_guide/style/vue.md | 60 ++++ doc/development/fe_guide/vue.md | 29 +- doc/development/fe_guide/vuex.md | 4 +- doc/development/integrations/secure.md | 4 +- ...oval_settings_compliance_project_v13_5.png | Bin 0 -> 33148 bytes .../img/scope_mr_approval_settings_v13_5.png | Bin 0 -> 55092 bytes .../admin_area/merge_requests_approvals.md | 41 ++- .../container_scanning/index.md | 4 +- .../compliance/license_compliance/index.md | 2 +- doc/user/gitlab_com/index.md | 2 +- doc/user/group/index.md | 26 -- .../releases/img/releases_sort_v13_6.png | Bin 0 -> 5571 bytes doc/user/project/releases/index.md | 7 + lib/banzai/reference_parser/base_parser.rb | 5 +- .../populate_has_vulnerabilities.rb | 11 +- locale/gitlab.pot | 15 +- package.json | 2 +- .../releases/user_views_releases_spec.rb | 102 +++++-- spec/frontend/registry/explorer/utils_spec.js | 12 + .../releases/components/releases_sort_spec.js | 66 ++++ .../stores/modules/list/actions_spec.js | 48 ++- .../stores/modules/list/mutations_spec.js | 12 + .../reference_parser/base_parser_spec.rb | 3 + .../populate_has_vulnerabilities_spec.rb | 7 + spec/support/helpers/wiki_helpers.rb | 1 - yarn.lock | 8 +- 50 files changed, 797 insertions(+), 371 deletions(-) create mode 100644 app/assets/javascripts/releases/components/releases_sort.vue create mode 100644 changelogs/unreleased/221101-implement-gitlab-ui-component-for-sorting-releases.yml create mode 100644 doc/ci/yaml/script.md create mode 100644 doc/user/admin_area/img/mr_approval_settings_compliance_project_v13_5.png create mode 100644 doc/user/admin_area/img/scope_mr_approval_settings_v13_5.png create mode 100644 doc/user/project/releases/img/releases_sort_v13_6.png create mode 100644 spec/frontend/releases/components/releases_sort_spec.js diff --git a/.gitlab/ci/cache-repo.gitlab-ci.yml b/.gitlab/ci/cache-repo.gitlab-ci.yml index a091785dec3..ff7655cee71 100644 --- a/.gitlab/ci/cache-repo.gitlab-ci.yml +++ b/.gitlab/ci/cache-repo.gitlab-ci.yml @@ -23,14 +23,35 @@ cache-repo: stage: sync variables: GIT_STRATEGY: none - TAR_FILENAME: /tmp/gitlab-master.tar + SHALLOW_CLONE_TAR_FILENAME: gitlab-master-shallow.tar + FULL_CLONE_TAR_FILENAME: gitlab-master.tar + before_script: + - '[ -z "$CI_REPO_CACHE_CREDENTIALS" ] || gcloud auth activate-service-account --key-file=$CI_REPO_CACHE_CREDENTIALS' script: - - cd .. - - rm -rf $CI_PROJECT_NAME - - git clone --progress $CI_REPOSITORY_URL $CI_PROJECT_NAME - - cd $CI_PROJECT_NAME - - gcloud auth activate-service-account --key-file=$CI_REPO_CACHE_CREDENTIALS - - git remote rm origin - - tar cf $TAR_FILENAME . - - gzip $TAR_FILENAME - - gsutil cp $TAR_FILENAME.gz gs://gitlab-ci-git-repo-cache/project-$CI_PROJECT_ID/gitlab-master.tar.gz + # Enable shallow repo caching only if the $ENABLE_SHALLOW_REPO_CACHING variable exists + - if [ -n "$ENABLE_SHALLOW_REPO_CACHING" ]; then + cd .. && rm -rf $CI_PROJECT_NAME; + today=$(date +%Y-%m-%d); + year=$(date +%Y); + last_year=`expr $year - 1`; + one_year_ago=$(echo $today | sed "s/$year/$last_year/"); + echo "Cloning $CI_REPOSITORY_URL into $CI_PROJECT_NAME with commits from $one_year_ago."; + time git clone --progress --no-checkout --shallow-since=$one_year_ago $CI_REPOSITORY_URL $CI_PROJECT_NAME; + cd $CI_PROJECT_NAME; + echo "Archiving $CI_PROJECT_NAME into /tmp/$SHALLOW_CLONE_TAR_FILENAME."; + time tar cf /tmp/$SHALLOW_CLONE_TAR_FILENAME .; + echo "GZipping /tmp/$SHALLOW_CLONE_TAR_FILENAME."; + time gzip /tmp/$SHALLOW_CLONE_TAR_FILENAME; + [ -z "$CI_REPO_CACHE_CREDENTIALS" ] || (echo "Uploading /tmp/$SHALLOW_CLONE_TAR_FILENAME.gz to GCloud." && time gsutil cp /tmp/$SHALLOW_CLONE_TAR_FILENAME.gz gs://gitlab-ci-git-repo-cache/project-$CI_PROJECT_ID/$SHALLOW_CLONE_TAR_FILENAME.gz); + fi + # By default, we want to cache the full repo, unless the $DISABLE_FULL_REPO_CACHING variable exists (in the case the shallow clone caching is working well) + - if [ -z "$DISABLE_FULL_REPO_CACHING" ]; then + cd .. && rm -rf $CI_PROJECT_NAME; + echo "Cloning $CI_REPOSITORY_URL into $CI_PROJECT_NAME."; + time git clone --progress $CI_REPOSITORY_URL $CI_PROJECT_NAME; + echo "Archiving $CI_PROJECT_NAME into /tmp/$FULL_CLONE_TAR_FILENAME."; + time tar cf /tmp/$FULL_CLONE_TAR_FILENAME .; + echo "GZipping /tmp/$FULL_CLONE_TAR_FILENAME."; + time gzip /tmp/$FULL_CLONE_TAR_FILENAME; + [ -z "$CI_REPO_CACHE_CREDENTIALS" ] || (echo "Uploading /tmp/$FULL_CLONE_TAR_FILENAME.gz to GCloud." && time gsutil cp /tmp/$FULL_CLONE_TAR_FILENAME.gz gs://gitlab-ci-git-repo-cache/project-$CI_PROJECT_ID/$FULL_CLONE_TAR_FILENAME.gz); + fi diff --git a/app/assets/javascripts/registry/explorer/utils.js b/app/assets/javascripts/registry/explorer/utils.js index a3478756c9b..ff86a6b807d 100644 --- a/app/assets/javascripts/registry/explorer/utils.js +++ b/app/assets/javascripts/registry/explorer/utils.js @@ -1,6 +1,8 @@ export const pathGenerator = (imageDetails, ending = '?format=json') => { // this method is a temporary workaround, to be removed with graphql implementation // https://gitlab.com/gitlab-org/gitlab/-/issues/276432 - const basePath = imageDetails.path.replace(`/${imageDetails.name}`, ''); + const basePath = imageDetails.name + ? imageDetails.path.replace(`/${imageDetails.name}`, '') + : imageDetails.path; return `/${basePath}/registry/repository/${imageDetails.id}/tags${ending}`; }; diff --git a/app/assets/javascripts/releases/components/app_index.vue b/app/assets/javascripts/releases/components/app_index.vue index 422d8bf630d..5064b7dd6ad 100644 --- a/app/assets/javascripts/releases/components/app_index.vue +++ b/app/assets/javascripts/releases/components/app_index.vue @@ -6,6 +6,7 @@ import { __ } from '~/locale'; import ReleaseBlock from './release_block.vue'; import ReleasesPagination from './releases_pagination.vue'; import ReleaseSkeletonLoader from './release_skeleton_loader.vue'; +import ReleasesSort from './releases_sort.vue'; export default { name: 'ReleasesApp', @@ -16,6 +17,7 @@ export default { ReleaseBlock, ReleasesPagination, ReleaseSkeletonLoader, + ReleasesSort, }, computed: { ...mapState('list', [ @@ -62,16 +64,20 @@ export default {