Skip to content

Instantly share code, notes, and snippets.

@shikanime
Last active January 8, 2024 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shikanime/fa49344fba032d242921a010795e096e to your computer and use it in GitHub Desktop.
Save shikanime/fa49344fba032d242921a010795e096e to your computer and use it in GitHub Desktop.
SonarQube configuration for Airbyte
spec:
type: Spec
documentation_url: https://docs.sonarsource.com/
connection_specification:
type: object
$schema: http://json-schema.org/draft-07/schema#
required:
- user_token
- qualifiers
- component_keys
properties:
end_date:
type: string
order: 3
title: End date
description: To retrieve issues created before the given date (inclusive).
qualifiers:
type: array
order: 1
title: Qualifiers
description: Comma-separated list of component qualifiers.
start_date:
type: string
order: 4
title: Start Date
description: To retrieve issues created after the given date (inclusive).
user_token:
type: string
order: 0
title: User Token
description: Your User Token. The token is case sensitive.
airbyte_secret: true
component_keys:
type: array
order: 2
title: Component Keys
description: Comma-separated list of component keys.
additionalProperties: true
type: DeclarativeSource
check:
type: CheckStream
stream_names:
- Issues
streams:
- name: Components
type: DeclarativeStream
retriever:
type: SimpleRetriever
paginator:
type: DefaultPaginator
page_size_option:
type: RequestOption
field_name: ps
inject_into: request_parameter
page_token_option:
type: RequestOption
field_name: p
inject_into: request_parameter
pagination_strategy:
type: PageIncrement
page_size: 100
requester:
path: /components/search
type: HttpRequester
url_base: https://sonar.sfeirfactory.com/api
http_method: GET
authenticator:
type: BearerAuthenticator
api_token: '{{ config[''user_token''] }}'
request_headers: {}
request_body_json: {}
request_parameters:
qualifiers: '{{ config[''qualifiers''] }}'
createdAfter: '{{ config[''start_date''] }}'
createdBefore: '{{ config[''end_date''] }}'
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- components
primary_key:
- key
schema_loader:
type: InlineSchemaLoader
schema:
type: object
$schema: http://json-schema.org/schema#
properties:
key:
type: string
name:
type: string
project:
type: string
qualifier:
type: string
- name: Issues
type: DeclarativeStream
retriever:
type: SimpleRetriever
paginator:
type: DefaultPaginator
page_size_option:
type: RequestOption
field_name: ps
inject_into: request_parameter
page_token_option:
type: RequestOption
field_name: p
inject_into: request_parameter
pagination_strategy:
type: PageIncrement
page_size: 100
requester:
path: /issues/search
type: HttpRequester
url_base: https://sonar.sfeirfactory.com/api
http_method: GET
authenticator:
type: BearerAuthenticator
api_token: '{{ config[''user_token''] }}'
request_headers: {}
request_body_json: {}
request_parameters:
createdAfter: '{{ config[''start_date''] }}'
componentKeys: '{{ '',''.join(config.get(''component_keys'', [])) }}'
createdBefore: '{{ config[''end_date''] }}'
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- issues
primary_key:
- key
schema_loader:
type: InlineSchemaLoader
schema:
type: object
$schema: http://json-schema.org/schema#
properties:
key:
type: string
debt:
type: string
hash:
type: string
line:
type: number
rule:
type: string
tags:
type: array
items:
type: string
type:
type: string
flows:
type: array
items:
type: object
properties:
locations:
type: array
items:
type: object
properties:
msg:
type: string
component:
type: string
textRange:
type: object
properties:
endLine:
type: number
endOffset:
type: number
startLine:
type: number
startOffset:
type: number
msgFormattings:
type: array
scope:
type: string
author:
type: string
effort:
type: string
status:
type: string
message:
type: string
project:
type: string
assignee:
type: string
severity:
type: string
closeDate:
type: string
component:
type: string
textRange:
type: object
properties:
endLine:
type: number
endOffset:
type: number
startLine:
type: number
startOffset:
type: number
resolution:
type: string
updateDate:
type: string
creationDate:
type: string
quickFixAvailable:
type: boolean
externalRuleEngine:
type: string
messageFormattings:
type: array
- name: Metrics
type: DeclarativeStream
retriever:
type: SimpleRetriever
paginator:
type: DefaultPaginator
page_size_option:
type: RequestOption
field_name: ps
inject_into: request_parameter
page_token_option:
type: RequestOption
field_name: p
inject_into: request_parameter
pagination_strategy:
type: PageIncrement
page_size: 100
requester:
path: /metrics/search
type: HttpRequester
url_base: https://sonar.sfeirfactory.com/api
http_method: GET
authenticator:
type: BearerAuthenticator
api_token: '{{ config[''user_token''] }}'
request_headers: {}
request_body_json: {}
request_parameters:
qualifiers: '{{ config[''qualifiers''] }}'
createdAfter: '{{ config[''start_date''] }}'
createdBefore: '{{ config[''end_date''] }}'
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- metrics
primary_key:
- id
schema_loader:
type: InlineSchemaLoader
schema:
type: object
$schema: http://json-schema.org/schema#
properties:
id:
type: string
key:
type: string
name:
type: string
type:
type: string
domain:
type: string
hidden:
type: boolean
direction:
type: number
description:
type: string
qualitative:
type: boolean
decimalScale:
type: number
version: 0.51.16
metadata:
autoImportSchema:
Issues: true
Metrics: true
Components: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment