Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
dff0f3475c
commit
12c5065f1f
|
|
@ -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,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Fixed repository browser not working with parentheses in branch name
|
||||
merge_request: 41591
|
||||
author:
|
||||
type: fixed
|
||||
|
|
@ -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) |
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
Loading…
Reference in New Issue