Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2024-01-12 12:08:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-12 12:08:57 +0300
commit5a226c1087d55511cd5564b210777453ede1ef63 (patch)
treeba6927dfe26359b67f0464258003d4143c1dc0d1
parentf84036d1da8555742cbe31b25595c50a8b956c57 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitignore1
-rw-r--r--app/assets/javascripts/ci/catalog/components/list/catalog_search.vue26
-rw-r--r--config/locales/doorkeeper.en.yml3
-rw-r--r--doc/user/profile/personal_access_tokens.md3
-rw-r--r--doc/user/project/members/index.md1
-rw-r--r--doc/user/project/repository/code_suggestions/saas.md12
-rw-r--r--go.work3
-rw-r--r--lib/gitlab/auth.rb5
-rw-r--r--spec/frontend/ci/catalog/components/list/catalog_search_spec.js13
-rw-r--r--spec/lib/gitlab/auth_spec.rb10
-rw-r--r--spec/requests/openid_connect_spec.rb2
11 files changed, 42 insertions, 37 deletions
diff --git a/.gitignore b/.gitignore
index 9aff9469db3..b6f5a8f514a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -110,7 +110,6 @@ tags.temp
jest-snapshot-test-match.json
jest-test-report.json
jest-snapshot-test-report.json
-/go.work.sum
# Vite Ruby
/public/vite*
diff --git a/app/assets/javascripts/ci/catalog/components/list/catalog_search.vue b/app/assets/javascripts/ci/catalog/components/list/catalog_search.vue
index e074cfda6f7..1319f204573 100644
--- a/app/assets/javascripts/ci/catalog/components/list/catalog_search.vue
+++ b/app/assets/javascripts/ci/catalog/components/list/catalog_search.vue
@@ -1,5 +1,5 @@
<script>
-import { GlSearchBoxByClick, GlSorting, GlSortingItem } from '@gitlab/ui';
+import { GlSearchBoxByClick, GlSorting } from '@gitlab/ui';
import { __ } from '~/locale';
import { SORT_ASC, SORT_DESC, SORT_OPTION_CREATED } from '../../constants';
@@ -7,7 +7,6 @@ export default {
components: {
GlSearchBoxByClick,
GlSorting,
- GlSortingItem,
},
data() {
return {
@@ -25,7 +24,7 @@ export default {
},
currentSortText() {
const currentSort = this.$options.sortOptions.find(
- (sort) => sort.key === this.currentSortOption,
+ (sort) => sort.value === this.currentSortOption,
);
return currentSort.text;
},
@@ -36,9 +35,6 @@ export default {
},
},
methods: {
- isActiveSort(sortItem) {
- return sortItem === this.currentSortOption;
- },
onClear() {
this.$emit('update-search-term', '');
},
@@ -49,10 +45,10 @@ export default {
this.$emit('update-search-term', this.searchTerm);
},
setSelectedSortOption(sortingItem) {
- this.currentSortOption = sortingItem.key;
+ this.currentSortOption = sortingItem;
},
},
- sortOptions: [{ key: SORT_OPTION_CREATED, text: __('Created at') }],
+ sortOptions: [{ value: SORT_OPTION_CREATED, text: __('Created at') }],
};
</script>
<template>
@@ -66,16 +62,10 @@ export default {
<gl-sorting
:is-ascending="isAscending"
:text="currentSortText"
+ :sort-options="$options.sortOptions"
+ :sort-by="currentSortOption"
+ @sortByChange="setSelectedSortOption"
@sortDirectionChange="onSortDirectionChange"
- >
- <gl-sorting-item
- v-for="sortingItem in $options.sortOptions"
- :key="sortingItem.key"
- :active="isActiveSort(sortingItem.key)"
- @click="setSelectedSortOption(sortingItem)"
- >
- {{ sortingItem.text }}
- </gl-sorting-item>
- </gl-sorting>
+ />
</div>
</template>
diff --git a/config/locales/doorkeeper.en.yml b/config/locales/doorkeeper.en.yml
index dbbbbf86994..85a4a84892d 100644
--- a/config/locales/doorkeeper.en.yml
+++ b/config/locales/doorkeeper.en.yml
@@ -79,6 +79,7 @@ en:
create_runner: Grants create access to the runners
k8s_proxy: Grants permission to perform Kubernetes API calls using the agent for Kubernetes.
ai_features: Access to API endpoints needed for GitLab Duo features
+ read_service_ping: Grant access to download Service Ping payload via API when authenticated as an admin user
scope_desc:
api:
Grants complete read/write access to the API, including all groups and projects, the container registry, the dependency proxy, and the package registry.
@@ -114,6 +115,8 @@ en:
Grants create access to the runners.
k8s_proxy:
Grants permission to perform Kubernetes API calls using the agent for Kubernetes.
+ read_service_ping:
+ Grant access to download Service Ping payload via API when authenticated as an admin user
group_access_token_scope_desc:
api:
Grants complete read and write access to the scoped group and related project API, including the container registry, the dependency proxy, and the package registry.
diff --git a/doc/user/profile/personal_access_tokens.md b/doc/user/profile/personal_access_tokens.md
index 9d54381ef87..dec42e74a58 100644
--- a/doc/user/profile/personal_access_tokens.md
+++ b/doc/user/profile/personal_access_tokens.md
@@ -123,8 +123,9 @@ A personal access token can perform actions based on the assigned scopes.
| `sudo` | Grants permission to perform API actions as any user in the system, when authenticated as an administrator. |
| `admin_mode` | Grants permission to perform API actions as an administrator, when Admin Mode is enabled. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107875) in GitLab 15.8.) |
| `create_runner` | Grants permission to create runners. |
-| `ai_features` | Grants permission to perform API actions for GitLab Duo. This scope is designed to work with the GitLab Duo Plugin for JetBrains. For all other extensions, see scope requirements. |
+| `ai_features` | Grants permission to perform API actions for GitLab Duo. This scope is designed to work with the GitLab Duo Plugin for JetBrains. For all other extensions, see scope requirements. |
| `k8s_proxy` | Grants permission to perform Kubernetes API calls using the agent for Kubernetes. |
+| `read_service_ping`| Grant access to download Service Ping payload via API when authenticated as an admin use. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107875) in GitLab 16.8. |
WARNING:
If you enabled [external authorization](../../administration/settings/external_authorization.md), personal access tokens cannot access container or package registries. If you use personal access tokens to access these registries, this measure breaks this use of these tokens. Disable external authorization to use personal access tokens with container or package registries.
diff --git a/doc/user/project/members/index.md b/doc/user/project/members/index.md
index ac1381e5358..66258c3873e 100644
--- a/doc/user/project/members/index.md
+++ b/doc/user/project/members/index.md
@@ -157,6 +157,7 @@ To add a group to a project:
The invited group is displayed on the **Groups** tab.
Private groups are masked from unauthorized users.
+With the feature flag `allow_members_to_see_invited_groups_in_access_dropdowns` enabled, private groups are displayed in project settings for protected branches, protected tags, and protected environments.
The members of the invited group are not displayed on the **Members** tab.
The **Members** tab shows:
diff --git a/doc/user/project/repository/code_suggestions/saas.md b/doc/user/project/repository/code_suggestions/saas.md
index 6c2c6fd4394..4b1cc762406 100644
--- a/doc/user/project/repository/code_suggestions/saas.md
+++ b/doc/user/project/repository/code_suggestions/saas.md
@@ -42,7 +42,17 @@ To use Code Suggestions:
1. Author your code. As you type, suggestions are displayed.
Code Suggestions provide code snippets or complete the current line, depending on the cursor position.
-1. Describe the requirements in natural language. Be concise and specific. Code Suggestions generates functions and code snippets as appropriate.
+1. Describe the requirements in natural language. Code Suggestions generates functions and code snippets based on the context provided. To get the best results from code generation:
+ - Be as specific as possible while remaining concise. State the outcome you want to generate (for example, a function) and provide details on what you want to achieve. Add additional information, such as the framework or library you want to use when applicable.
+ For example, to create a Python web service with some specific requirements, you might write something similar to the following:
+
+ ```plaintext
+ # Create a web service using Tornado that allows a user to log in, run a security scan, and review the scan results.
+ # Each action (log in, run a scan, and review results) should be its own resource in the web service
+ ...
+ ```
+
+ - Add a space or go to a new line after each comment. This tells the code generator that you have completed your instructions.
1. To accept a suggestion, press <kbd>Tab</kbd>.
1. To ignore a suggestion, keep typing as you usually would.
1. To explicitly reject a suggestion, press <kbd>Esc</kbd>.
diff --git a/go.work b/go.work
deleted file mode 100644
index 61be32bc68d..00000000000
--- a/go.work
+++ /dev/null
@@ -1,3 +0,0 @@
-go 1.20
-
-use ./workhorse
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 8e894be4fc4..bdd1aed4017 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -43,10 +43,13 @@ module Gitlab
WRITE_OBSERVABILITY_SCOPE = :write_observability
OBSERVABILITY_SCOPES = [READ_OBSERVABILITY_SCOPE, WRITE_OBSERVABILITY_SCOPE].freeze
+ # Scopes for Monitor access
+ READ_SERVICE_PING_SCOPE = :read_service_ping
+
# Scopes used for GitLab as admin
SUDO_SCOPE = :sudo
ADMIN_MODE_SCOPE = :admin_mode
- ADMIN_SCOPES = [SUDO_SCOPE, ADMIN_MODE_SCOPE].freeze
+ ADMIN_SCOPES = [SUDO_SCOPE, ADMIN_MODE_SCOPE, READ_SERVICE_PING_SCOPE].freeze
# Default scopes for OAuth applications that don't define their own
DEFAULT_SCOPES = [API_SCOPE].freeze
diff --git a/spec/frontend/ci/catalog/components/list/catalog_search_spec.js b/spec/frontend/ci/catalog/components/list/catalog_search_spec.js
index c6f8498f2fd..803deeb0d45 100644
--- a/spec/frontend/ci/catalog/components/list/catalog_search_spec.js
+++ b/spec/frontend/ci/catalog/components/list/catalog_search_spec.js
@@ -1,4 +1,4 @@
-import { GlSearchBoxByClick, GlSorting, GlSortingItem } from '@gitlab/ui';
+import { GlSearchBoxByClick, GlSorting } from '@gitlab/ui';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import CatalogSearch from '~/ci/catalog/components/list/catalog_search.vue';
import { SORT_ASC, SORT_DESC, SORT_OPTION_CREATED } from '~/ci/catalog/constants';
@@ -8,7 +8,7 @@ describe('CatalogSearch', () => {
const findSearchBar = () => wrapper.findComponent(GlSearchBoxByClick);
const findSorting = () => wrapper.findComponent(GlSorting);
- const findAllSortingItems = () => wrapper.findAllComponents(GlSortingItem);
+ const findAllSortingItems = () => findSorting().props('sortOptions');
const createComponent = () => {
wrapper = shallowMountExtended(CatalogSearch, {});
@@ -23,13 +23,14 @@ describe('CatalogSearch', () => {
expect(findSearchBar().exists()).toBe(true);
});
- it('renders the sorting options', () => {
- expect(findSorting().exists()).toBe(true);
- expect(findAllSortingItems()).toHaveLength(1);
+ it('sets sorting options', () => {
+ const sortOptionsProp = findAllSortingItems();
+ expect(sortOptionsProp).toHaveLength(1);
+ expect(sortOptionsProp[0].text).toBe('Created at');
});
it('renders the `Created at` option as the default', () => {
- expect(findAllSortingItems().at(0).text()).toBe('Created at');
+ expect(findSorting().props('text')).toBe('Created at');
});
});
diff --git a/spec/lib/gitlab/auth_spec.rb b/spec/lib/gitlab/auth_spec.rb
index 9974e24ad50..fd51ebbc8fa 100644
--- a/spec/lib/gitlab/auth_spec.rb
+++ b/spec/lib/gitlab/auth_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching, feature_cate
end
it 'ADMIN_SCOPES contains all scopes for ADMIN access' do
- expect(subject::ADMIN_SCOPES).to match_array %i[sudo admin_mode]
+ expect(subject::ADMIN_SCOPES).to match_array %i[sudo admin_mode read_service_ping]
end
it 'REPOSITORY_SCOPES contains all scopes for REPOSITORY access' do
@@ -42,7 +42,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching, feature_cate
end
it 'contains all non-default scopes' do
- expect(subject.all_available_scopes).to match_array %i[api read_user read_api read_repository write_repository read_registry write_registry sudo admin_mode read_observability write_observability create_runner k8s_proxy ai_features]
+ expect(subject.all_available_scopes).to match_array %i[api read_user read_api read_repository read_service_ping write_repository read_registry write_registry sudo admin_mode read_observability write_observability create_runner k8s_proxy ai_features]
end
it 'contains for non-admin user all non-default scopes without ADMIN access and without observability scopes' do
@@ -54,7 +54,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching, feature_cate
it 'contains for admin user all non-default scopes with ADMIN access and without observability scopes' do
user = build_stubbed(:user, admin: true)
- expect(subject.available_scopes_for(user)).to match_array %i[api read_user read_api read_repository write_repository read_registry write_registry sudo admin_mode create_runner k8s_proxy ai_features]
+ expect(subject.available_scopes_for(user)).to match_array %i[api read_user read_api read_repository read_service_ping write_repository read_registry write_registry sudo admin_mode create_runner k8s_proxy ai_features]
end
it 'contains for project all resource bot scopes' do
@@ -72,7 +72,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching, feature_cate
end
it 'optional_scopes contains all non-default scopes' do
- expect(subject.optional_scopes).to match_array %i[read_user read_api read_repository write_repository read_registry write_registry sudo admin_mode openid profile email read_observability write_observability create_runner k8s_proxy ai_features]
+ expect(subject.optional_scopes).to match_array %i[read_user read_api read_repository write_repository read_registry read_service_ping write_registry sudo admin_mode openid profile email read_observability write_observability create_runner k8s_proxy ai_features]
end
context 'with observability_tracing feature flag' do
@@ -118,7 +118,7 @@ RSpec.describe Gitlab::Auth, :use_clean_rails_memory_store_caching, feature_cate
it 'contains for admin user all non-default scopes with ADMIN access and without observability scopes' do
user = build_stubbed(:user, admin: true)
- expect(subject.available_scopes_for(user)).to match_array %i[api read_user read_api read_repository write_repository read_registry write_registry sudo admin_mode create_runner k8s_proxy ai_features]
+ expect(subject.available_scopes_for(user)).to match_array %i[api read_user read_api read_repository write_repository read_registry write_registry read_service_ping sudo admin_mode create_runner k8s_proxy ai_features]
end
it 'contains for project all resource bot scopes including observability scopes' do
diff --git a/spec/requests/openid_connect_spec.rb b/spec/requests/openid_connect_spec.rb
index 6573fe570db..168008b0eb9 100644
--- a/spec/requests/openid_connect_spec.rb
+++ b/spec/requests/openid_connect_spec.rb
@@ -273,7 +273,7 @@ RSpec.describe 'OpenID Connect requests', feature_category: :system_access do
let(:expected_scopes) do
%w[
admin_mode api read_user read_api read_repository write_repository sudo openid profile email
- read_observability write_observability create_runner k8s_proxy ai_features
+ read_observability write_observability create_runner k8s_proxy ai_features read_service_ping
]
end