Commit 8dc91cde authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Minor alignment adjustments / comments / unnecessary code removal

parent d8c746f4
...@@ -19,7 +19,6 @@ Rails.application.routes.draw do ...@@ -19,7 +19,6 @@ Rails.application.routes.draw do
controllers applications: 'oauth/applications', controllers applications: 'oauth/applications',
authorized_applications: 'oauth/authorized_applications', authorized_applications: 'oauth/authorized_applications',
authorizations: 'oauth/authorizations' authorizations: 'oauth/authorizations'
end end
scope path: '/-/jira/login/oauth', controller: 'oauth/jira/authorizations', as: :oauth_jira do scope path: '/-/jira/login/oauth', controller: 'oauth/jira/authorizations', as: :oauth_jira do
......
...@@ -5,9 +5,6 @@ module API ...@@ -5,9 +5,6 @@ module API
allow_access_with_scope :api allow_access_with_scope :api
prefix :api prefix :api
NO_SLASH_URL_PART_REGEX = %r{[^/]+}
PROJECT_ENDPOINT_REQUIREMENTS = { id: NO_SLASH_URL_PART_REGEX }.freeze
version %w(v3 v4), using: :path version %w(v3 v4), using: :path
version 'v3', using: :path do version 'v3', using: :path do
...@@ -15,8 +12,6 @@ module API ...@@ -15,8 +12,6 @@ module API
helpers ::API::Helpers::CommonHelpers helpers ::API::Helpers::CommonHelpers
mount ::API::V3::AwardEmoji mount ::API::V3::AwardEmoji
mount ::API::V3::GithubRepos
mount ::API::V3::Boards mount ::API::V3::Boards
mount ::API::V3::Branches mount ::API::V3::Branches
mount ::API::V3::BroadcastMessages mount ::API::V3::BroadcastMessages
...@@ -54,6 +49,11 @@ module API ...@@ -54,6 +49,11 @@ module API
mount ::API::V3::Triggers mount ::API::V3::Triggers
mount ::API::V3::Users mount ::API::V3::Users
mount ::API::V3::Variables mount ::API::V3::Variables
# Although the following endpoints are kept behind V3 namespace, they're not
# deprecated neither should be removed when V3 get removed.
# They're needed as a layer to integrate with Jira development panel.
mount ::API::V3::GithubRepos
end end
before { header['X-Frame-Options'] = 'SAMEORIGIN' } before { header['X-Frame-Options'] = 'SAMEORIGIN' }
...@@ -95,6 +95,9 @@ module API ...@@ -95,6 +95,9 @@ module API
helpers ::API::Helpers helpers ::API::Helpers
helpers ::API::Helpers::CommonHelpers helpers ::API::Helpers::CommonHelpers
NO_SLASH_URL_PART_REGEX = %r{[^/]+}
PROJECT_ENDPOINT_REQUIREMENTS = { id: NO_SLASH_URL_PART_REGEX }.freeze
# Keep in alphabetical order # Keep in alphabetical order
mount ::API::AccessRequests mount ::API::AccessRequests
mount ::API::AwardEmoji mount ::API::AwardEmoji
......
...@@ -42,10 +42,6 @@ module API ...@@ -42,10 +42,6 @@ module API
project = params[:project] project = params[:project]
user_project = find_project!("#{namespace}/#{project}") user_project = find_project!("#{namespace}/#{project}")
branches = ::API::Entities::Github::Branch
.represent(user_project.repository.branches.sort_by(&:name), project: user_project)
.as_json
branches = ::Kaminari.paginate_array(user_project.repository.branches.sort_by(&:name)) branches = ::Kaminari.paginate_array(user_project.repository.branches.sort_by(&:name))
present paginate(branches), present paginate(branches),
...@@ -65,9 +61,6 @@ module API ...@@ -65,9 +61,6 @@ module API
not_found! 'Commit' unless commit not_found! 'Commit' unless commit
json_commit = ::API::Entities::Github::RepoCommit.represent(commit).as_json
Rails.logger.info("JSON COMMIT: #{json_commit}")
present commit, with: ::API::Entities::Github::RepoCommit present commit, with: ::API::Entities::Github::RepoCommit
end end
end end
......
...@@ -64,11 +64,6 @@ module API ...@@ -64,11 +64,6 @@ module API
end end
end end
# desc ':org/repos' do
# Rails.logger.info("Requesting /users/#{params[:org]}/repos with params #{params}")
# Rails.logger.info("User: #{current_user.name}")
# end
desc 'Get the SSH keys of a specified user. Available only for admins.' do desc 'Get the SSH keys of a specified user. Available only for admins.' do
success ::API::Entities::SSHKey success ::API::Entities::SSHKey
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment