Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
12af3e15befd
Commit
12af3e15
authored
Feb 04, 2020
by
GitLab Bot
Browse files
Add latest changes from gitlab-org/gitlab@master
parent
f237f071babd
Changes
83
Hide whitespace changes
Inline
Side-by-side
.gitlab/ci/cache-repo.gitlab-ci.yml
View file @
12af3e15
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-cache-credentials-schedule
:
&if-cache-credentials-schedule
if
:
'
$CI_REPO_CACHE_CREDENTIALS
&&
$CI_PIPELINE_SOURCE
==
"schedule"'
# Builds a cached .tar.gz of the master branch with full history and
# uploads it to Google Cloud Storage. This archive is downloaded by a
# script defined by a CI/CD variable named CI_PRE_CLONE_SCRIPT. This has
...
...
@@ -33,8 +37,6 @@
-
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
only
:
variables
:
-
$CI_REPO_CACHE_CREDENTIALS
refs
:
-
schedules
rules
:
-
<<
:
*if-cache-credentials-schedule
when
:
on_success
.gitlab/ci/cng.gitlab-ci.yml
View file @
12af3e15
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab-tag
:
&if-canonical-gitlab-tag
if
:
'
$CI_SERVER_HOST
==
"gitlab.com"
&&
$CI_PROJECT_NAMESPACE
=~
/^gitlab-org($|\/)/
&&
$CI_COMMIT_TAG'
cloud-native-image
:
...
...
@@ -1,8 +5,7 @@
cloud-native-image
:
extends
:
.only:variables-canonical-dot-com
image
:
ruby:2.6-alpine
dependencies
:
[]
stage
:
post-test
allow_failure
:
true
variables
:
GIT_DEPTH
:
"
1"
...
...
@@ -3,10 +6,9 @@
image
:
ruby:2.6-alpine
dependencies
:
[]
stage
:
post-test
allow_failure
:
true
variables
:
GIT_DEPTH
:
"
1"
when
:
manual
script
:
-
install_gitlab_gem
-
CNG_PROJECT_PATH="gitlab-org/build/CNG" BUILD_TRIGGER_TOKEN=$CI_JOB_TOKEN ./scripts/trigger-build cng
...
...
@@ -10,6 +12,6 @@
script
:
-
install_gitlab_gem
-
CNG_PROJECT_PATH="gitlab-org/build/CNG" BUILD_TRIGGER_TOKEN=$CI_JOB_TOKEN ./scripts/trigger-build cng
only
:
refs
:
-
tags
rules
:
-
<<
:
*if-canonical-gitlab-tag
when
:
manual
app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue
View file @
12af3e15
...
...
@@ -306,5 +306,5 @@
</
script
>
<
template
>
<form
name=
"eks-cluster-configuration-form"
>
<h
2
>
<h
4
>
{{
s__
(
'
ClusterIntegration|Enter the details for your Amazon EKS Kubernetes cluster
'
)
}}
...
...
@@ -310,5 +310,5 @@
{{
s__
(
'
ClusterIntegration|Enter the details for your Amazon EKS Kubernetes cluster
'
)
}}
</h
2
>
</h
4
>
<div
class=
"mb-3"
v-html=
"kubernetesIntegrationHelpText"
></div>
<div
class=
"form-group"
>
<label
class=
"label-bold"
for=
"eks-cluster-name"
>
{{
...
...
app/assets/javascripts/create_cluster/eks_cluster/components/service_credentials_form.vue
View file @
12af3e15
...
...
@@ -83,7 +83,7 @@
</
script
>
<
template
>
<form
name=
"service-credentials-form"
>
<h
2
>
{{
s__
(
'
ClusterIntegration|Authenticate with Amazon Web Services
'
)
}}
</h
2
>
<h
4
>
{{
s__
(
'
ClusterIntegration|Authenticate with Amazon Web Services
'
)
}}
</h
4
>
<p>
{{
s__
(
...
...
app/assets/javascripts/jobs/components/job_app.vue
View file @
12af3e15
...
...
@@ -8,7 +8,6 @@
import
CiHeader
from
'
~/vue_shared/components/header_ci_component.vue
'
;
import
Callout
from
'
~/vue_shared/components/callout.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
createStore
from
'
../store
'
;
import
EmptyState
from
'
./empty_state.vue
'
;
import
EnvironmentsBlock
from
'
./environments_block.vue
'
;
import
ErasedBlock
from
'
./erased_block.vue
'
;
...
...
@@ -22,7 +21,6 @@
export
default
{
name
:
'
JobPageApp
'
,
store
:
createStore
(),
components
:
{
CiHeader
,
Callout
,
...
...
@@ -60,12 +58,8 @@
required
:
false
,
default
:
null
,
},
endpoint
:
{
type
:
String
,
required
:
true
,
},
terminalPath
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
...
...
@@ -67,13 +61,9 @@
terminalPath
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
pagePath
:
{
type
:
String
,
required
:
true
,
},
projectPath
:
{
type
:
String
,
required
:
true
,
},
...
...
@@ -76,11 +66,7 @@
projectPath
:
{
type
:
String
,
required
:
true
,
},
logState
:
{
type
:
String
,
required
:
true
,
},
subscriptionsMoreMinutesUrl
:
{
type
:
String
,
required
:
false
,
...
...
@@ -161,18 +147,9 @@
created
()
{
this
.
throttled
=
_
.
throttle
(
this
.
toggleScrollButtons
,
100
);
this
.
setJobEndpoint
(
this
.
endpoint
);
this
.
setTraceOptions
({
logState
:
this
.
logState
,
pagePath
:
this
.
pagePath
,
});
this
.
fetchJob
();
this
.
fetchTrace
();
window
.
addEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
addEventListener
(
'
scroll
'
,
this
.
updateScroll
);
},
mounted
()
{
this
.
updateSidebar
();
},
...
...
@@ -173,12 +150,14 @@
window
.
addEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
addEventListener
(
'
scroll
'
,
this
.
updateScroll
);
},
mounted
()
{
this
.
updateSidebar
();
},
destroyed
()
{
beforeDestroy
()
{
this
.
stopPollingTrace
();
this
.
stopPolling
();
window
.
removeEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
removeEventListener
(
'
scroll
'
,
this
.
updateScroll
);
},
methods
:
{
...
mapActions
([
...
...
@@ -180,12 +159,9 @@
window
.
removeEventListener
(
'
resize
'
,
this
.
onResize
);
window
.
removeEventListener
(
'
scroll
'
,
this
.
updateScroll
);
},
methods
:
{
...
mapActions
([
'
setJobEndpoint
'
,
'
setTraceOptions
'
,
'
fetchJob
'
,
'
fetchJobsForStage
'
,
'
hideSidebar
'
,
'
showSidebar
'
,
'
toggleSidebar
'
,
...
...
@@ -188,7 +164,6 @@
'
fetchJobsForStage
'
,
'
hideSidebar
'
,
'
showSidebar
'
,
'
toggleSidebar
'
,
'
fetchTrace
'
,
'
scrollBottom
'
,
'
scrollTop
'
,
...
...
@@ -193,5 +168,7 @@
'
scrollBottom
'
,
'
scrollTop
'
,
'
stopPollingTrace
'
,
'
stopPolling
'
,
'
toggleScrollButtons
'
,
'
toggleScrollAnimation
'
,
]),
...
...
@@ -223,7 +200,7 @@
<div>
<gl-loading-icon
v-if=
"isLoading"
:
size=
"
2
"
size=
"
lg
"
class=
"js-job-loading qa-loading-animation prepend-top-20"
/>
...
...
app/assets/javascripts/jobs/index.js
View file @
12af3e15
import
Vue
from
'
vue
'
;
import
JobApp
from
'
./components/job_app.vue
'
;
import
createStore
from
'
./store
'
;
export
default
()
=>
{
const
element
=
document
.
getElementById
(
'
js-job-vue-app
'
);
...
...
@@ -3,6 +4,11 @@
export
default
()
=>
{
const
element
=
document
.
getElementById
(
'
js-job-vue-app
'
);
const
store
=
createStore
();
// Let's start initializing the store (i.e. fetching data) right away
store
.
dispatch
(
'
init
'
,
element
.
dataset
);
return
new
Vue
({
el
:
element
,
...
...
@@ -7,5 +13,6 @@
return
new
Vue
({
el
:
element
,
store
,
components
:
{
JobApp
,
},
...
...
app/assets/javascripts/jobs/store/actions.js
View file @
12af3e15
...
...
@@ -14,6 +14,16 @@
scrollUp
,
}
from
'
~/lib/utils/scroll_utils
'
;
export
const
init
=
({
dispatch
},
{
endpoint
,
logState
,
pagePath
})
=>
{
dispatch
(
'
setJobEndpoint
'
,
endpoint
);
dispatch
(
'
setTraceOptions
'
,
{
logState
,
pagePath
,
});
return
Promise
.
all
([
dispatch
(
'
fetchJob
'
),
dispatch
(
'
fetchTrace
'
)]);
};
export
const
setJobEndpoint
=
({
commit
},
endpoint
)
=>
commit
(
types
.
SET_JOB_ENDPOINT
,
endpoint
);
export
const
setTraceOptions
=
({
commit
},
options
)
=>
commit
(
types
.
SET_TRACE_OPTIONS
,
options
);
...
...
@@ -147,7 +157,6 @@
export
const
requestTrace
=
({
commit
})
=>
commit
(
types
.
REQUEST_TRACE
);
let
traceTimeout
;
export
const
fetchTrace
=
({
dispatch
,
state
})
=>
axios
.
get
(
`
${
state
.
traceEndpoint
}
/trace.json`
,
{
...
...
@@ -157,9 +166,5 @@
dispatch
(
'
toggleScrollisInBottom
'
,
isScrolledToBottom
());
dispatch
(
'
receiveTraceSuccess
'
,
data
);
if
(
!
data
.
complete
)
{
traceTimeout
=
setTimeout
(()
=>
{
dispatch
(
'
fetchTrace
'
);
},
4000
);
}
else
{
if
(
data
.
complete
)
{
dispatch
(
'
stopPollingTrace
'
);
...
...
@@ -165,5 +170,7 @@
dispatch
(
'
stopPollingTrace
'
);
}
else
if
(
!
state
.
traceTimeout
)
{
dispatch
(
'
startPollingTrace
'
);
}
})
.
catch
(()
=>
dispatch
(
'
receiveTraceError
'
));
...
...
@@ -166,8 +173,12 @@
}
})
.
catch
(()
=>
dispatch
(
'
receiveTraceError
'
));
export
const
stopPollingTrace
=
({
commit
})
=>
{
commit
(
types
.
STOP_POLLING_TRACE
);
clearTimeout
(
traceTimeout
);
export
const
startPollingTrace
=
({
dispatch
,
commit
})
=>
{
const
traceTimeout
=
setTimeout
(()
=>
{
commit
(
types
.
SET_TRACE_TIMEOUT
,
0
);
dispatch
(
'
fetchTrace
'
);
},
4000
);
commit
(
types
.
SET_TRACE_TIMEOUT
,
traceTimeout
);
};
...
...
@@ -173,2 +184,9 @@
};
export
const
stopPollingTrace
=
({
state
,
commit
})
=>
{
clearTimeout
(
state
.
traceTimeout
);
commit
(
types
.
SET_TRACE_TIMEOUT
,
0
);
commit
(
types
.
STOP_POLLING_TRACE
);
};
export
const
receiveTraceSuccess
=
({
commit
},
log
)
=>
commit
(
types
.
RECEIVE_TRACE_SUCCESS
,
log
);
...
...
@@ -174,7 +192,6 @@
export
const
receiveTraceSuccess
=
({
commit
},
log
)
=>
commit
(
types
.
RECEIVE_TRACE_SUCCESS
,
log
);
export
const
receiveTraceError
=
({
commit
})
=>
{
commit
(
types
.
RECEIVE_TRACE_ERROR
);
clearTimeout
(
traceTimeout
);
export
const
receiveTraceError
=
({
dispatch
})
=>
{
dispatch
(
'
stopPollingTrace
'
);
flash
(
__
(
'
An error occurred while fetching the job log.
'
));
};
/**
...
...
app/assets/javascripts/jobs/store/mutation_types.js
View file @
12af3e15
...
...
@@ -10,7 +10,6 @@
export
const
DISABLE_SCROLL_TOP
=
'
DISABLE_SCROLL_TOP
'
;
export
const
ENABLE_SCROLL_BOTTOM
=
'
ENABLE_SCROLL_BOTTOM
'
;
export
const
ENABLE_SCROLL_TOP
=
'
ENABLE_SCROLL_TOP
'
;
// TODO
export
const
TOGGLE_SCROLL_ANIMATION
=
'
TOGGLE_SCROLL_ANIMATION
'
;
export
const
TOGGLE_IS_SCROLL_IN_BOTTOM_BEFORE_UPDATING_TRACE
=
'
TOGGLE_IS_SCROLL_IN_BOTTOM
'
;
...
...
@@ -20,6 +19,7 @@
export
const
RECEIVE_JOB_ERROR
=
'
RECEIVE_JOB_ERROR
'
;
export
const
REQUEST_TRACE
=
'
REQUEST_TRACE
'
;
export
const
SET_TRACE_TIMEOUT
=
'
SET_TRACE_TIMEOUT
'
;
export
const
STOP_POLLING_TRACE
=
'
STOP_POLLING_TRACE
'
;
export
const
RECEIVE_TRACE_SUCCESS
=
'
RECEIVE_TRACE_SUCCESS
'
;
export
const
RECEIVE_TRACE_ERROR
=
'
RECEIVE_TRACE_ERROR
'
;
...
...
app/assets/javascripts/jobs/store/mutations.js
View file @
12af3e15
...
...
@@ -53,13 +53,10 @@
state
.
isTraceComplete
=
log
.
complete
||
state
.
isTraceComplete
;
},
/**
* Will remove loading animation
*/
[
types
.
STOP_POLLING_TRACE
](
state
)
{
state
.
isTraceComplete
=
true
;
[
types
.
SET_TRACE_TIMEOUT
](
state
,
id
)
{
state
.
traceTimeout
=
id
;
},
/**
* Will remove loading animation
*/
...
...
@@ -61,9 +58,9 @@
},
/**
* Will remove loading animation
*/
[
types
.
RECEIVE_TRACE_ERROR
](
state
)
{
[
types
.
STOP_POLLING_TRACE
](
state
)
{
state
.
isTraceComplete
=
true
;
},
...
...
app/assets/javascripts/jobs/store/state.js
View file @
12af3e15
...
...
@@ -22,6 +22,7 @@
isTraceComplete
:
false
,
traceSize
:
0
,
isTraceSizeVisible
:
false
,
traceTimeout
:
0
,
// used as a query parameter to fetch the trace
traceState
:
null
,
...
...
app/assets/javascripts/registry/settings/components/settings_form.vue
View file @
12af3e15
<
script
>
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
GlCard
,
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
Tracking
from
'
~/tracking
'
;
import
{
UPDATE_SETTINGS_ERROR_MESSAGE
,
UPDATE_SETTINGS_SUCCESS_MESSAGE
,
}
from
'
../../shared/constants
'
;
import
{
mapComputed
}
from
'
~/vuex_shared/bindings
'
;
...
...
@@ -3,10 +4,10 @@
import
Tracking
from
'
~/tracking
'
;
import
{
UPDATE_SETTINGS_ERROR_MESSAGE
,
UPDATE_SETTINGS_SUCCESS_MESSAGE
,
}
from
'
../../shared/constants
'
;
import
{
mapComputed
}
from
'
~/vuex_shared/bindings
'
;
import
ExpirationPolicyF
orm
from
'
../../shared/components/expiration_policy_f
orm
.vue
'
;
import
ExpirationPolicyF
ields
from
'
../../shared/components/expiration_policy_f
ields
.vue
'
;
export
default
{
components
:
{
...
...
@@ -10,7 +11,10 @@
export
default
{
components
:
{
ExpirationPolicyForm
,
GlCard
,
GlButton
,
GlLoadingIcon
,
ExpirationPolicyFields
,
},
mixins
:
[
Tracking
.
mixin
()],
labelsConfig
:
{
...
...
@@ -22,9 +26,10 @@
tracking
:
{
label
:
'
docker_container_retention_and_expiration_policies
'
,
},
formIsValid
:
true
,
};
},
computed
:
{
...
mapState
([
'
formOptions
'
,
'
isLoading
'
]),
...
mapGetters
({
isEdited
:
'
getIsEdited
'
}),
...
mapComputed
([{
key
:
'
settings
'
,
getter
:
'
getSettings
'
}],
'
updateSettings
'
),
...
...
@@ -25,9 +30,15 @@
};
},
computed
:
{
...
mapState
([
'
formOptions
'
,
'
isLoading
'
]),
...
mapGetters
({
isEdited
:
'
getIsEdited
'
}),
...
mapComputed
([{
key
:
'
settings
'
,
getter
:
'
getSettings
'
}],
'
updateSettings
'
),
isSubmitButtonDisabled
()
{
return
!
this
.
formIsValid
||
this
.
isLoading
;
},
isCancelButtonDisabled
()
{
return
!
this
.
isEdited
||
this
.
isLoading
;
},
},
methods
:
{
...
mapActions
([
'
resetSettings
'
,
'
saveSettings
'
]),
...
...
@@ -46,12 +57,42 @@
</
script
>
<
template
>
<expiration-policy-form
v-model=
"settings"
:form-options=
"formOptions"
:is-loading=
"isLoading"
:disable-cancel-button=
"!isEdited"
@
submit=
"submit"
@
reset=
"reset"
/>
<form
ref=
"form-element"
@
submit.prevent=
"submit"
@
reset.prevent=
"reset"
>
<gl-card>
<template
#header
>
{{
s__
(
'
ContainerRegistry|Tag expiration policy
'
)
}}
</
template
>
<
template
#default
>
<expiration-policy-fields
v-model=
"settings"
:form-options=
"formOptions"
:is-loading=
"isLoading"
@
validated=
"formIsValid = true"
@
invalidated=
"formIsValid = false"
/>
</
template
>
<
template
#footer
>
<div
class=
"d-flex justify-content-end"
>
<gl-button
ref=
"cancel-button"
type=
"reset"
class=
"mr-2 d-block"
:disabled=
"isCancelButtonDisabled"
>
{{
__
(
'
Cancel
'
)
}}
</gl-button>
<gl-button
ref=
"save-button"
type=
"submit"
:disabled=
"isSubmitButtonDisabled"
variant=
"success"
class=
"d-flex justify-content-center align-items-center js-no-auto-disable"
>
{{
__
(
'
Save expiration policy
'
)
}}
<gl-loading-icon
v-if=
"isLoading"
class=
"ml-2"
/>
</gl-button>
</div>
</
template
>
</gl-card>
</form>
</template>
app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue
0 → 100644
View file @
12af3e15
<
script
>
import
{
uniqueId
}
from
'
lodash
'
;
import
{
GlFormGroup
,
GlToggle
,
GlFormSelect
,
GlFormTextarea
}
from
'
@gitlab/ui
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
import
{
NAME_REGEX_LENGTH
}
from
'
../constants
'
;
import
{
mapComputedToEvent
}
from
'
../utils
'
;
export
default
{
components
:
{
GlFormGroup
,
GlToggle
,
GlFormSelect
,
GlFormTextarea
,
},
props
:
{
formOptions
:
{
type
:
Object
,
required
:
false
,
default
:
()
=>
({}),
},
isLoading
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
value
:
{
type
:
Object
,
required
:
false
,
default
:
()
=>
({}),
},
labelCols
:
{
type
:
[
Number
,
String
],
required
:
false
,
default
:
3
,
},
labelAlign
:
{
type
:
String
,
required
:
false
,
default
:
'
right
'
,
},
},
nameRegexPlaceholder
:
'
.*
'
,
selectList
:
[
{
name
:
'
expiration-policy-interval
'
,
label
:
s__
(
'
ContainerRegistry|Expiration interval:
'
),
model
:
'
older_than
'
,
optionKey
:
'
olderThan
'
,
},
{
name
:
'
expiration-policy-schedule
'
,
label
:
s__
(
'
ContainerRegistry|Expiration schedule:
'
),
model
:
'
cadence
'
,
optionKey
:
'
cadence
'
,
},
{
name
:
'
expiration-policy-latest
'
,
label
:
s__
(
'
ContainerRegistry|Number of tags to retain:
'
),
model
:
'
keep_n
'
,
optionKey
:
'
keepN
'
,
},
],
data
()
{
return
{
uniqueId
:
uniqueId
(),
};
},
computed
:
{
...
mapComputedToEvent
([
'
enabled
'
,
'
cadence
'
,
'
older_than
'
,
'
keep_n
'
,
'
name_regex
'
],
'
value
'
),
policyEnabledText
()
{
return
this
.
enabled
?
__
(
'
enabled
'
)
:
__
(
'
disabled
'
);
},
toggleDescriptionText
()
{
return
sprintf
(
s__
(
'
ContainerRegistry|Docker tag expiration policy is %{toggleStatus}
'
),
{
toggleStatus
:
`<strong>
${
this
.
policyEnabledText
}
</strong>`
,
},
false
,
);
},
regexHelpText
()
{
return
sprintf
(
s__
(
'
ContainerRegistry|Wildcards such as %{codeStart}*-stable%{codeEnd} or %{codeStart}production/*%{codeEnd} are supported. To select all tags, use %{codeStart}.*%{codeEnd}
'
,
),
{
codeStart
:
'
<code>
'
,
codeEnd
:
'
</code>
'
,
},
false
,
);
},
nameRegexState
()
{
return
this
.
name_regex
?
this
.
name_regex
.
length
<=
NAME_REGEX_LENGTH
:
null
;
},
fieldsValidity
()
{
return
this
.
nameRegexState
!==
false
;
},
isFormElementDisabled
()
{
return
!
this
.
enabled
||
this
.
isLoading
;
},
},
watch
:
{
fieldsValidity
:
{
immediate
:
true
,
handler
(
valid
)
{
if
(
valid
)
{
this
.
$emit
(
'
validated
'
);
}
else
{
this
.
$emit
(
'
invalidated
'
);
}
},
},
},
methods
:
{
idGenerator
(
id
)
{
return
`
${
id
}
_
${
this
.
uniqueId
}
`
;
},
updateModel
(
value
,
key
)
{
this
[
key
]
=
value
;
},
},
};
</
script
>
<
template
>
<div
ref=
"form-elements"
class=
"lh-2"
>
<gl-form-group
:id=