Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
690cef72
Commit
690cef72
authored
Feb 07, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
4bb20633
6e73c383
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
204 additions
and
8 deletions
+204
-8
app/assets/javascripts/lib/utils/file_upload.js
app/assets/javascripts/lib/utils/file_upload.js
+3
-0
changelogs/unreleased/56014-api-merge-request-squash-commit-messages.yml
...leased/56014-api-merge-request-squash-commit-messages.yml
+5
-0
changelogs/unreleased/fix-repo-settings-file-upload-error.yml
...gelogs/unreleased/fix-repo-settings-file-upload-error.yml
+5
-0
changelogs/unreleased/jlenny-NewAndroidTemplate.yml
changelogs/unreleased/jlenny-NewAndroidTemplate.yml
+5
-0
doc/api/merge_requests.md
doc/api/merge_requests.md
+2
-0
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+2
-0
lib/gitlab/ci/templates/Android-Fastlane.gitlab-ci.yml
lib/gitlab/ci/templates/Android-Fastlane.gitlab-ci.yml
+121
-0
lib/gitlab/ci/templates/Android.gitlab-ci.yml
lib/gitlab/ci/templates/Android.gitlab-ci.yml
+2
-0
spec/javascripts/lib/utils/file_upload_spec.js
spec/javascripts/lib/utils/file_upload_spec.js
+36
-8
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+23
-0
No files found.
app/assets/javascripts/lib/utils/file_upload.js
View file @
690cef72
export
default
(
buttonSelector
,
fileSelector
)
=>
{
const
btn
=
document
.
querySelector
(
buttonSelector
);
const
fileInput
=
document
.
querySelector
(
fileSelector
);
if
(
!
btn
||
!
fileInput
)
return
;
const
form
=
btn
.
closest
(
'
form
'
);
btn
.
addEventListener
(
'
click
'
,
()
=>
{
...
...
changelogs/unreleased/56014-api-merge-request-squash-commit-messages.yml
0 → 100644
View file @
690cef72
---
title
:
API allows setting the squash commit message when squashing a merge request
merge_request
:
24784
author
:
type
:
added
changelogs/unreleased/fix-repo-settings-file-upload-error.yml
0 → 100644
View file @
690cef72
---
title
:
Fix bug causing repository mirror settings UI to break
merge_request
:
23712
author
:
type
:
fixed
changelogs/unreleased/jlenny-NewAndroidTemplate.yml
0 → 100644
View file @
690cef72
---
title
:
Add template for Android with Fastlane
merge_request
:
24722
author
:
type
:
changed
doc/api/merge_requests.md
View file @
690cef72
...
...
@@ -1009,6 +1009,8 @@ Parameters:
-
`id`
(required) - The ID or
[
URL-encoded path of the project
](
README.md#namespaced-path-encoding
)
owned by the authenticated user
-
`merge_request_iid`
(required) - Internal ID of MR
-
`merge_commit_message`
(optional) - Custom merge commit message
-
`squash_commit_message`
(optional) - Custom squash commit message
-
`squash`
(optional) - if
`true`
the commits will be squashed into a single commit on merge
-
`should_remove_source_branch`
(optional) - if
`true`
removes the source branch
-
`merge_when_pipeline_succeeds`
(optional) - if
`true`
the MR is merged when the pipeline succeeds
-
`sha`
(optional) - if present, then this SHA must match the HEAD of the source branch, otherwise the merge will fail
...
...
lib/api/merge_requests.rb
View file @
690cef72
...
...
@@ -345,6 +345,7 @@ module API
end
params
do
optional
:merge_commit_message
,
type:
String
,
desc:
'Custom merge commit message'
optional
:squash_commit_message
,
type:
String
,
desc:
'Custom squash commit message'
optional
:should_remove_source_branch
,
type:
Boolean
,
desc:
'When true, the source branch will be deleted if possible'
optional
:merge_when_pipeline_succeeds
,
type:
Boolean
,
...
...
@@ -372,6 +373,7 @@ module API
merge_params
=
{
commit_message:
params
[
:merge_commit_message
],
squash_commit_message:
params
[
:squash_commit_message
],
should_remove_source_branch:
params
[
:should_remove_source_branch
]
}
...
...
lib/gitlab/ci/templates/Android-Fastlane.gitlab-ci.yml
0 → 100644
View file @
690cef72
# Read more about how to use this script on this blog post https://about.gitlab.com/2019/01/28/android-publishing-with-gitlab-and-fastlane/
# You will also need to configure your build.gradle, Dockerfile, and fastlane configuration to make this work.
# If you are looking for a simpler template that does not publish, see the Android template.
stages
:
-
environment
-
build
-
test
-
internal
-
alpha
-
beta
-
production
.updateContainerJob
:
image
:
docker:stable
stage
:
environment
services
:
-
docker:dind
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
-
docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG ||
true
-
docker build --cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG .
-
docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
updateContainer
:
extends
:
.updateContainerJob
only
:
changes
:
-
Dockerfile
ensureContainer
:
extends
:
.updateContainerJob
allow_failure
:
true
before_script
:
-
"
mkdir
-p
~/.docker
&&
echo
'{
\"
experimental
\"
:
\"
enabled
\"
}'
>
~/.docker/config.json"
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# Skip update container `script` if the container already exists
# via https://gitlab.com/gitlab-org/gitlab-ce/issues/26866#note_97609397 -> https://stackoverflow.com/a/52077071/796832
-
docker manifest inspect $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG > /dev/null && exit ||
true
.build_job
:
image
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
stage
:
build
before_script
:
# We store this binary file in a variable as hex with this command: `xxd -p android-app.jks`
# Then we convert the hex back to a binary file
-
echo "$signing_jks_file_hex" | xxd -r -p - > android-signing-keystore.jks
-
"
export
VERSION_CODE=$CI_PIPELINE_IID
&&
echo
$VERSION_CODE"
-
"
export
VERSION_SHA=`echo
${CI_COMMIT_SHA:0:8}`
&&
echo
$VERSION_SHA"
after_script
:
-
rm -f android-signing-keystore.jks ||
true
artifacts
:
paths
:
-
app/build/outputs
buildDebug
:
extends
:
.build_job
script
:
-
bundle exec fastlane buildDebug
buildRelease
:
extends
:
.build_job
script
:
-
bundle exec fastlane buildRelease
environment
:
name
:
production
testDebug
:
image
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
stage
:
test
dependencies
:
-
buildDebug
script
:
-
bundle exec fastlane test
publishInternal
:
image
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
stage
:
internal
dependencies
:
-
buildRelease
when
:
manual
before_script
:
-
echo $google_play_service_account_api_key_json > ~/google_play_api_key.json
after_script
:
-
rm ~/google_play_api_key.json
script
:
-
bundle exec fastlane internal
.promote_job
:
image
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
when
:
manual
dependencies
:
[]
before_script
:
-
echo $google_play_service_account_api_key_json > ~/google_play_api_key.json
after_script
:
-
rm ~/google_play_api_key.json
promoteAlpha
:
extends
:
.promote_job
stage
:
alpha
script
:
-
bundle exec fastlane promote_internal_to_alpha
promoteBeta
:
extends
:
.promote_job
stage
:
beta
script
:
-
bundle exec fastlane promote_alpha_to_beta
promoteProduction
:
extends
:
.promote_job
stage
:
production
# We only allow production promotion on `master` because
# it has its own production scoped secret variables
only
:
-
master
script
:
-
bundle exec fastlane promote_beta_to_production
\ No newline at end of file
lib/gitlab/ci/templates/Android.gitlab-ci.yml
View file @
690cef72
# Read more about this script on this blog post https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/, by Jason Lenny
# If you are interested in using Android with FastLane for publishing take a look at the Android-Fastlane template.
image
:
openjdk:8-jdk
variables
:
...
...
spec/javascripts/lib/utils/file_upload_spec.js
View file @
690cef72
...
...
@@ -9,28 +9,56 @@ describe('File upload', () => {
<span class="js-filename"></span>
</form>
`
);
});
describe
(
'
when there is a matching button and input
'
,
()
=>
{
beforeEach
(()
=>
{
fileUpload
(
'
.js-button
'
,
'
.js-input
'
);
});
it
(
'
clicks file input after clicking button
'
,
()
=>
{
const
btn
=
document
.
querySelector
(
'
.js-button
'
);
const
input
=
document
.
querySelector
(
'
.js-input
'
);
spyOn
(
input
,
'
click
'
);
btn
.
click
();
expect
(
input
.
click
).
toHaveBeenCalled
();
});
it
(
'
updates file name text
'
,
()
=>
{
const
input
=
document
.
querySelector
(
'
.js-input
'
);
fileUpload
(
'
.js-button
'
,
'
.js-input
'
);
input
.
value
=
'
path/to/file/index.js
'
;
input
.
dispatchEvent
(
new
CustomEvent
(
'
change
'
));
expect
(
document
.
querySelector
(
'
.js-filename
'
).
textContent
).
toEqual
(
'
index.js
'
);
});
});
it
(
'
clicks file input after clicking button
'
,
()
=>
{
const
btn
=
document
.
querySelector
(
'
.js-button
'
);
it
(
'
fails gracefully when there is no matching button
'
,
()
=>
{
const
input
=
document
.
querySelector
(
'
.js-input
'
);
const
btn
=
document
.
querySelector
(
'
.js-button
'
);
fileUpload
(
'
.js-not-button
'
,
'
.js-input
'
);
spyOn
(
input
,
'
click
'
);
btn
.
click
();
expect
(
input
.
click
).
toHaveBeenCalled
();
expect
(
input
.
click
).
not
.
toHaveBeenCalled
();
});
it
(
'
updates file name tex
t
'
,
()
=>
{
it
(
'
fails gracefully when there is no matching inpu
t
'
,
()
=>
{
const
input
=
document
.
querySelector
(
'
.js-input
'
);
const
btn
=
document
.
querySelector
(
'
.js-button
'
);
fileUpload
(
'
.js-button
'
,
'
.js-not-input
'
);
input
.
value
=
'
path/to/file/index.js
'
;
spyOn
(
input
,
'
click
'
)
;
input
.
dispatchEvent
(
new
CustomEvent
(
'
change
'
)
);
btn
.
click
(
);
expect
(
document
.
querySelector
(
'
.js-filename
'
).
textContent
).
toEqual
(
'
index.js
'
);
expect
(
input
.
click
).
not
.
toHaveBeenCalled
(
);
});
});
spec/requests/api/merge_requests_spec.rb
View file @
690cef72
...
...
@@ -972,6 +972,29 @@ describe API::MergeRequests do
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
describe
"the squash_commit_message param"
do
let
(
:squash_commit
)
do
project
.
repository
.
commits_between
(
json_response
[
'diff_refs'
][
'start_sha'
],
json_response
[
'merge_commit_sha'
]).
first
end
it
"results in a specific squash commit message when set"
do
squash_commit_message
=
'My custom squash commit message'
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
/merge"
,
user
),
params:
{
squash:
true
,
squash_commit_message:
squash_commit_message
}
expect
(
squash_commit
.
message
.
chomp
).
to
eq
(
squash_commit_message
)
end
it
"results in a default squash commit message when not set"
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
/merge"
,
user
),
params:
{
squash:
true
}
expect
(
squash_commit
.
message
).
to
eq
(
merge_request
.
default_squash_commit_message
)
end
end
end
describe
"PUT /projects/:id/merge_requests/:merge_request_iid"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment