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
5fbf7682
Commit
5fbf7682
authored
Jul 24, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
867671f9
2a072751
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
app/assets/javascripts/cycle_analytics/cycle_analytics_service.js
...ts/javascripts/cycle_analytics/cycle_analytics_service.js
+6
-2
app/controllers/import/github_controller.rb
app/controllers/import/github_controller.rb
+6
-2
spec/controllers/import/github_controller_spec.rb
spec/controllers/import/github_controller_spec.rb
+10
-0
No files found.
app/assets/javascripts/cycle_analytics/cycle_analytics_service.js
View file @
5fbf7682
...
...
@@ -8,22 +8,26 @@ export default class CycleAnalyticsService {
}
fetchCycleAnalyticsData
(
options
=
{
startDate
:
30
})
{
const
{
startDate
,
projectIds
}
=
options
;
return
this
.
axios
.
get
(
''
,
{
params
:
{
'
cycle_analytics[start_date]
'
:
options
.
startDate
,
'
cycle_analytics[start_date]
'
:
startDate
,
'
cycle_analytics[project_ids]
'
:
projectIds
,
},
})
.
then
(
x
=>
x
.
data
);
}
fetchStageData
(
options
)
{
const
{
stage
,
startDate
}
=
options
;
const
{
stage
,
startDate
,
projectIds
}
=
options
;
return
this
.
axios
.
get
(
`events/
${
stage
.
name
}
.json`
,
{
params
:
{
'
cycle_analytics[start_date]
'
:
startDate
,
'
cycle_analytics[project_ids]
'
:
projectIds
,
},
})
.
then
(
x
=>
x
.
data
);
...
...
app/controllers/import/github_controller.rb
View file @
5fbf7682
...
...
@@ -10,7 +10,7 @@ class Import::GithubController < Import::BaseController
rescue_from
Octokit
::
Unauthorized
,
with: :provider_unauthorized
def
new
if
github_import_configured?
&&
logged_in_with_provider?
if
!
ci_cd_only?
&&
github_import_configured?
&&
logged_in_with_provider?
go_to_provider_for_permissions
elsif
session
[
access_token_key
]
redirect_to
status_import_url
...
...
@@ -169,11 +169,15 @@ class Import::GithubController < Import::BaseController
# rubocop: enable CodeReuse/ActiveRecord
def
provider_auth
if
session
[
access_token_key
].
blank?
if
!
ci_cd_only?
&&
session
[
access_token_key
].
blank?
go_to_provider_for_permissions
end
end
def
ci_cd_only?
%w[1 true]
.
include?
(
params
[
:ci_cd_only
])
end
def
client_options
{}
end
...
...
spec/controllers/import/github_controller_spec.rb
View file @
5fbf7682
...
...
@@ -33,6 +33,16 @@ describe Import::GithubController do
expect
(
response
).
to
have_http_status
(
200
)
end
context
'when importing a CI/CD project'
do
it
'always prompts for an access token'
do
allow
(
controller
).
to
receive
(
:github_import_configured?
).
and_return
(
true
)
get
:new
,
params:
{
ci_cd_only:
true
}
expect
(
response
).
to
render_template
(
:new
)
end
end
end
describe
"GET callback"
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