add sonarqube
This commit is contained in:
parent
61ca57e4e0
commit
ad085fcddc
3
Gemfile
3
Gemfile
|
@ -26,7 +26,7 @@ gem 'roo-xls'
|
|||
gem 'simple_xlsx_reader', '~>1.0.4'
|
||||
|
||||
gem 'rubyzip'
|
||||
|
||||
gem 'sonarqube', :git => 'https://gitlink.org.cn/KingChan/sonarqube.git'
|
||||
gem 'spreadsheet'
|
||||
gem 'ruby-ole'
|
||||
# 导出为xlsx
|
||||
|
@ -114,7 +114,6 @@ gem 'aasm'
|
|||
gem 'enumerize'
|
||||
|
||||
gem 'diffy'
|
||||
|
||||
gem 'deep_cloneable', '~> 3.0.0'
|
||||
|
||||
# oauth2
|
||||
|
|
34
Gemfile.lock
34
Gemfile.lock
|
@ -1,3 +1,11 @@
|
|||
GIT
|
||||
remote: https://gitlink.org.cn/KingChan/sonarqube.git
|
||||
revision: 80f07d427322ef02c0714c77a382e87aed0bef81
|
||||
specs:
|
||||
sonarqube (1.3.0)
|
||||
httparty (~> 0.14, >= 0.14.0)
|
||||
terminal-table (~> 1.5, >= 1.5.1)
|
||||
|
||||
GEM
|
||||
remote: https://mirrors.cloud.tencent.com/rubygems/
|
||||
specs:
|
||||
|
@ -135,7 +143,7 @@ GEM
|
|||
fugit (1.4.1)
|
||||
et-orbi (~> 1.1, >= 1.1.8)
|
||||
raabro (~> 1.4)
|
||||
gitea-client (1.4.2)
|
||||
gitea-client (1.4.6)
|
||||
rest-client (~> 2.1.0)
|
||||
globalid (0.4.2)
|
||||
activesupport (>= 4.2.0)
|
||||
|
@ -150,6 +158,9 @@ GEM
|
|||
http-accept (1.7.0)
|
||||
http-cookie (1.0.5)
|
||||
domain_name (~> 0.5)
|
||||
httparty (0.21.0)
|
||||
mini_mime (>= 1.0.0)
|
||||
multi_xml (>= 0.5.2)
|
||||
i18n (1.8.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
io-like (0.3.1)
|
||||
|
@ -187,9 +198,9 @@ GEM
|
|||
mimemagic (~> 0.3.2)
|
||||
maruku (0.7.3)
|
||||
method_source (0.9.2)
|
||||
mime-types (3.4.1)
|
||||
mime-types (3.5.2)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2023.0218.1)
|
||||
mime-types-data (3.2024.0507)
|
||||
mimemagic (0.3.10)
|
||||
nokogiri (~> 1)
|
||||
rake
|
||||
|
@ -245,13 +256,12 @@ GEM
|
|||
powerpack (0.1.2)
|
||||
prettier (0.18.2)
|
||||
public_suffix (4.0.3)
|
||||
puma (3.12.2)
|
||||
puma (5.6.8)
|
||||
nio4r (~> 2.0)
|
||||
raabro (1.4.0)
|
||||
rack (2.0.9)
|
||||
rack-cors (1.1.1)
|
||||
rack (>= 2.0.0)
|
||||
rack-mini-profiler (2.0.1)
|
||||
rack (>= 1.2.0)
|
||||
rack-protection (2.0.8.1)
|
||||
rack
|
||||
rack-test (1.1.0)
|
||||
|
@ -438,6 +448,8 @@ GEM
|
|||
actionpack (>= 4.0)
|
||||
activesupport (>= 4.0)
|
||||
sprockets (>= 3.0.0)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
thor (1.0.1)
|
||||
thread_safe (0.3.6)
|
||||
tilt (2.0.10)
|
||||
|
@ -450,7 +462,7 @@ GEM
|
|||
execjs (>= 0.3.0, < 3)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.8.2)
|
||||
unf_ext (0.0.9.1)
|
||||
unicode-display_width (1.6.1)
|
||||
web-console (3.7.0)
|
||||
actionview (>= 5.0)
|
||||
|
@ -492,7 +504,7 @@ DEPENDENCIES
|
|||
enumerize
|
||||
faraday (~> 0.15.4)
|
||||
font-awesome-sass (= 4.7.0)
|
||||
gitea-client (~> 1.4.2)
|
||||
gitea-client (~> 1.4.3)
|
||||
grape-entity (~> 0.7.1)
|
||||
groupdate (~> 4.1.0)
|
||||
harmonious_dictionary (~> 0.0.1)
|
||||
|
@ -514,9 +526,8 @@ DEPENDENCIES
|
|||
parallel (~> 1.19, >= 1.19.1)
|
||||
pdfkit
|
||||
prettier
|
||||
puma (~> 3.11)
|
||||
puma (~> 5.6.5)
|
||||
rack-cors
|
||||
rack-mini-profiler
|
||||
rails (~> 5.2.0)
|
||||
rails-i18n (~> 5.1)
|
||||
ransack
|
||||
|
@ -538,9 +549,10 @@ DEPENDENCIES
|
|||
sidekiq-cron (= 1.2.0)
|
||||
sidekiq-failures
|
||||
simple_form
|
||||
simple_xlsx_reader
|
||||
simple_xlsx_reader (~> 1.0.4)
|
||||
sinatra
|
||||
solargraph (~> 0.38.0)
|
||||
sonarqube!
|
||||
spreadsheet
|
||||
spring
|
||||
spring-watcher-listen (~> 2.0.0)
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
// Place all the behaviors and hooks related to the matching controller here.
|
||||
// All this logic will automatically be available in application.js.
|
|
@ -0,0 +1,3 @@
|
|||
// Place all the styles related to the api/v1/sonarqube/issues controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
@ -0,0 +1,6 @@
|
|||
class Api::V1::Sonarqubes::IssuesController < ApplicationController
|
||||
def index
|
||||
data = Sonarqube.client.get("/api/issues/search",params)
|
||||
render_ok data
|
||||
end
|
||||
end
|
|
@ -0,0 +1,2 @@
|
|||
module Api::V1::Sonarqube::IssuesHelper
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
Sonarqube.configure do |config|
|
||||
config.endpoint = 'http://172.20.32.202:9999' # API endpoint URL, default: ENV['SONARQUBE_API_ENDPOINT']
|
||||
config.private_token = 'squ_fb81f52a7b2c2db00c71c29f71c9595f48c2ff3f' # user's private token, default: ENV['SONARQUBE_API_PRIVATE_TOKEN']
|
||||
# Optional
|
||||
# config.user_agent = 'Custom User Agent' # user agent, default: 'Sonarqube Ruby Gem [version]'
|
||||
end
|
|
@ -48,6 +48,12 @@ defaults format: :json do
|
|||
end
|
||||
end
|
||||
|
||||
resources :sonarqubes ,only: [:index] do
|
||||
collection do
|
||||
resource :issues
|
||||
end
|
||||
end
|
||||
|
||||
scope ':owner' do
|
||||
resource :users, path: '/', only: [:update, :edit, :destroy] do
|
||||
collection do
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Api::V1::Sonarqube::IssuesController, type: :controller do
|
||||
|
||||
end
|
|
@ -0,0 +1,15 @@
|
|||
require 'rails_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
# the Api::V1::Sonarqube::IssuesHelper. For example:
|
||||
#
|
||||
# describe Api::V1::Sonarqube::IssuesHelper do
|
||||
# describe "string concat" do
|
||||
# it "concats two strings with spaces" do
|
||||
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
RSpec.describe Api::V1::Sonarqube::IssuesHelper, type: :helper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in New Issue