diff options
-rw-r--r-- | app/assets/javascripts/repository/router.js | 3 | ||||
-rw-r--r-- | changelogs/unreleased/ph-212785-fixRepositoryBrowserBranchWithParentheses.yml | 5 | ||||
-rw-r--r-- | doc/api/epics.md | 4 | ||||
-rw-r--r-- | doc/api/graphql/reference/gitlab_schema.graphql | 4 | ||||
-rw-r--r-- | doc/api/graphql/reference/gitlab_schema.json | 4 | ||||
-rw-r--r-- | doc/user/group/epics/manage_epics.md | 12 | ||||
-rw-r--r-- | lib/api/internal/kubernetes.rb | 7 | ||||
-rw-r--r-- | spec/frontend/repository/router_spec.js | 13 | ||||
-rw-r--r-- | spec/requests/api/internal/kubernetes_spec.rb | 30 |
9 files changed, 52 insertions, 30 deletions
diff --git a/app/assets/javascripts/repository/router.js b/app/assets/javascripts/repository/router.js index c5646c32850..38a596e229e 100644 --- a/app/assets/javascripts/repository/router.js +++ b/app/assets/javascripts/repository/router.js @@ -1,5 +1,6 @@ import Vue from 'vue'; import VueRouter from 'vue-router'; +import { escapeRegExp } from 'lodash'; import { joinPaths } from '../lib/utils/url_utility'; import IndexPage from './pages/index.vue'; import TreePage from './pages/tree.vue'; @@ -27,7 +28,7 @@ export default function createRouter(base, baseRef) { { name: 'treePath', // Support without decoding as well just in case the ref doesn't need to be decoded - path: `(/-)?/tree/${baseRef}/:path*`, + path: `(/-)?/tree/${escapeRegExp(baseRef)}/:path*`, ...treePathRoute, }, { diff --git a/changelogs/unreleased/ph-212785-fixRepositoryBrowserBranchWithParentheses.yml b/changelogs/unreleased/ph-212785-fixRepositoryBrowserBranchWithParentheses.yml new file mode 100644 index 00000000000..4ec1bfa62ef --- /dev/null +++ b/changelogs/unreleased/ph-212785-fixRepositoryBrowserBranchWithParentheses.yml @@ -0,0 +1,5 @@ +--- +title: Fixed repository browser not working with parentheses in branch name +merge_request: 41591 +author: +type: fixed diff --git a/doc/api/epics.md b/doc/api/epics.md index c3ba42c6efd..45bf406dec2 100644 --- a/doc/api/epics.md +++ b/doc/api/epics.md @@ -266,7 +266,7 @@ POST /groups/:id/epics | `title` | string | yes | The title of the epic | | `labels` | string | no | The comma separated list of labels | | `description` | string | no | The description of the epic. Limited to 1,048,576 characters. | -| `confidential` | boolean | no | Whether the epic should be confidential | +| `confidential` | boolean | no | Whether the epic should be confidential. Will be ignored if `confidential_epics` feature flag is disabled. | | `start_date_is_fixed` | boolean | no | Whether start date should be sourced from `start_date_fixed` or from milestones (since 11.3) | | `start_date_fixed` | string | no | The fixed start date of an epic (since 11.3) | | `due_date_is_fixed` | boolean | no | Whether due date should be sourced from `due_date_fixed` or from milestones (since 11.3) | @@ -347,7 +347,7 @@ PUT /groups/:id/epics/:epic_iid | `epic_iid` | integer/string | yes | The internal ID of the epic | | `title` | string | no | The title of an epic | | `description` | string | no | The description of an epic. Limited to 1,048,576 characters. | -| `confidential` | boolean | no | Whether the epic should be confidential | +| `confidential` | boolean | no | Whether the epic should be confidential. Will be ignored if `confidential_epics` feature flag is disabled. | | `labels` | string | no | The comma separated list of labels | | `start_date_is_fixed` | boolean | no | Whether start date should be sourced from `start_date_fixed` or from milestones (since 11.3) | | `start_date_fixed` | string | no | The fixed start date of an epic (since 11.3) | diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql index b66277e71e1..492bcfe952b 100644 --- a/doc/api/graphql/reference/gitlab_schema.graphql +++ b/doc/api/graphql/reference/gitlab_schema.graphql @@ -2614,7 +2614,7 @@ input CreateEpicInput { clientMutationId: String """ - Indicates if the epic is confidential + Indicates if the epic is confidential. Will be ignored if `confidential_epics` feature flag is disabled """ confidential: Boolean @@ -16864,7 +16864,7 @@ input UpdateEpicInput { clientMutationId: String """ - Indicates if the epic is confidential + Indicates if the epic is confidential. Will be ignored if `confidential_epics` feature flag is disabled """ confidential: Boolean diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json index 1a64472d636..ff30c1455e4 100644 --- a/doc/api/graphql/reference/gitlab_schema.json +++ b/doc/api/graphql/reference/gitlab_schema.json @@ -7089,7 +7089,7 @@ }, { "name": "confidential", - "description": "Indicates if the epic is confidential", + "description": "Indicates if the epic is confidential. Will be ignored if `confidential_epics` feature flag is disabled", "type": { "kind": "SCALAR", "name": "Boolean", @@ -49621,7 +49621,7 @@ }, { "name": "confidential", - "description": "Indicates if the epic is confidential", + "description": "Indicates if the epic is confidential. Will be ignored if `confidential_epics` feature flag is disabled", "type": { "kind": "SCALAR", "name": "Boolean", diff --git a/doc/user/group/epics/manage_epics.md b/doc/user/group/epics/manage_epics.md index c09032bffb2..3dfa6a33255 100644 --- a/doc/user/group/epics/manage_epics.md +++ b/doc/user/group/epics/manage_epics.md @@ -164,6 +164,18 @@ To make an epic confidential: - **In an existing epic:** in the epic's sidebar, select **Edit** next to **Confidentiality** then select **Turn on**. +### Disable confidential epics **(PREMIUM ONLY)** + +The confidential epics feature is deployed behind a feature flag that is **enabled by default**. +[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md) +can disable it for your self-managed instance. + +To disable it: + +```ruby +Feature.disable(:confidential_epics) +``` + ## Manage issues assigned to an epic ### Add a new issue to an epic diff --git a/lib/api/internal/kubernetes.rb b/lib/api/internal/kubernetes.rb index bab829a609e..4db2ee85362 100644 --- a/lib/api/internal/kubernetes.rb +++ b/lib/api/internal/kubernetes.rb @@ -5,6 +5,7 @@ module API module Internal class Kubernetes < Grape::API::Instance before do + check_feature_enabled authenticate_gitlab_kas_request! end @@ -55,7 +56,6 @@ module API namespace 'internal' do namespace 'kubernetes' do before do - check_feature_enabled check_agent_token end @@ -96,15 +96,16 @@ module API gitaly_repository: gitaly_repository(project) } end + end + namespace 'kubernetes/usage_metrics' do desc 'POST usage metrics' do detail 'Updates usage metrics for agent' end - route_setting :authentication, cluster_agent_token_allowed: true params do requires :gitops_sync_count, type: Integer, desc: 'The count to increment the gitops_sync metric by' end - post '/usage_metrics' do + post '/' do gitops_sync_count = params[:gitops_sync_count] if gitops_sync_count < 0 diff --git a/spec/frontend/repository/router_spec.js b/spec/frontend/repository/router_spec.js index f2f3dda41d9..3c7dda05ca3 100644 --- a/spec/frontend/repository/router_spec.js +++ b/spec/frontend/repository/router_spec.js @@ -4,12 +4,13 @@ import createRouter from '~/repository/router'; describe('Repository router spec', () => { it.each` - path | branch | component | componentName - ${'/'} | ${'master'} | ${IndexPage} | ${'IndexPage'} - ${'/tree/master'} | ${'master'} | ${TreePage} | ${'TreePage'} - ${'/-/tree/master'} | ${'master'} | ${TreePage} | ${'TreePage'} - ${'/-/tree/master/app/assets'} | ${'master'} | ${TreePage} | ${'TreePage'} - ${'/-/tree/123/app/assets'} | ${'master'} | ${null} | ${'null'} + path | branch | component | componentName + ${'/'} | ${'master'} | ${IndexPage} | ${'IndexPage'} + ${'/tree/master'} | ${'master'} | ${TreePage} | ${'TreePage'} + ${'/tree/feat(test)'} | ${'feat(test)'} | ${TreePage} | ${'TreePage'} + ${'/-/tree/master'} | ${'master'} | ${TreePage} | ${'TreePage'} + ${'/-/tree/master/app/assets'} | ${'master'} | ${TreePage} | ${'TreePage'} + ${'/-/tree/123/app/assets'} | ${'master'} | ${null} | ${'null'} `('sets component as $componentName for path "$path"', ({ path, component, branch }) => { const router = createRouter('', branch); diff --git a/spec/requests/api/internal/kubernetes_spec.rb b/spec/requests/api/internal/kubernetes_spec.rb index ae5b6a9c4c6..f669483b5a4 100644 --- a/spec/requests/api/internal/kubernetes_spec.rb +++ b/spec/requests/api/internal/kubernetes_spec.rb @@ -24,20 +24,6 @@ RSpec.describe API::Internal::Kubernetes do end end - context 'authenticated' do - it 'returns 403 if Authorization header not sent' do - send_request - - expect(response).to have_gitlab_http_status(:forbidden) - end - - it 'returns 404 if Authorization is for non-existent agent' do - send_request(headers: { 'Authorization' => 'Bearer NONEXISTENT' }) - - expect(response).to have_gitlab_http_status(:forbidden) - end - end - context 'kubernetes_agent_internal_api feature flag disabled' do before do stub_feature_flags(kubernetes_agent_internal_api: false) @@ -51,6 +37,20 @@ RSpec.describe API::Internal::Kubernetes do end end + shared_examples 'agent authentication' do + it 'returns 403 if Authorization header not sent' do + send_request + + expect(response).to have_gitlab_http_status(:forbidden) + end + + it 'returns 403 if Authorization is for non-existent agent' do + send_request(headers: { 'Authorization' => 'Bearer NONEXISTENT' }) + + expect(response).to have_gitlab_http_status(:forbidden) + end + end + describe 'POST /internal/kubernetes/usage_metrics' do def send_request(headers: {}, params: {}) post api('/internal/kubernetes/usage_metrics'), params: params, headers: headers.reverse_merge(jwt_auth_headers) @@ -93,6 +93,7 @@ RSpec.describe API::Internal::Kubernetes do end include_examples 'authorization' + include_examples 'agent authentication' context 'an agent is found' do let!(:agent_token) { create(:cluster_agent_token) } @@ -133,6 +134,7 @@ RSpec.describe API::Internal::Kubernetes do end include_examples 'authorization' + include_examples 'agent authentication' context 'an agent is found' do let!(:agent_token) { create(:cluster_agent_token) } |