Skip to content

Commit

Permalink
[Integration][SonarQube] Added support for querying projects via the …
Browse files Browse the repository at this point in the history
…GA API (#1146)
  • Loading branch information
lordsarcastic authored Dec 23, 2024
1 parent 40d2ff4 commit 0ac08ec
Show file tree
Hide file tree
Showing 18 changed files with 2,332 additions and 348 deletions.
16 changes: 13 additions & 3 deletions integrations/sonarqube/.port/resources/blueprints.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,19 @@
"icon": "Git",
"title": "Main Branch"
},
"tags": {
"type": "array",
"title": "Tags"
"mainBranchLastAnalysisDate": {
"type": "string",
"format": "date-time",
"icon": "Clock",
"title": "Main Branch Last Analysis Date"
},
"revision": {
"type": "string",
"title": "Revision"
},
"managed": {
"type": "boolean",
"title": "Managed"
}
},
"required": []
Expand Down
12 changes: 7 additions & 5 deletions integrations/sonarqube/.port/resources/port-app-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: projects
- kind: projects_ga
selector:
query: 'true'
apiFilters:
filter:
qualifier: TRK
qualifier:
- TRK
metrics:
- code_smells
- coverage
Expand All @@ -27,15 +27,17 @@ resources:
organization: .organization
link: .__link
qualityGateStatus: .__branch.status.qualityGateStatus
lastAnalysisDate: .__branch.analysisDate
lastAnalysisDate: .analysisDate
numberOfBugs: .__measures[]? | select(.metric == "bugs") | .value
numberOfCodeSmells: .__measures[]? | select(.metric == "code_smells") | .value
numberOfVulnerabilities: .__measures[]? | select(.metric == "vulnerabilities") | .value
numberOfHotSpots: .__measures[]? | select(.metric == "security_hotspots") | .value
numberOfDuplications: .__measures[]? | select(.metric == "duplicated_files") | .value
coverage: .__measures[]? | select(.metric == "coverage") | .value
mainBranch: .__branch.name
tags: .tags
mainBranchLastAnalysisDate: .__branch.analysisDate
revision: .revision
managed: .managed
- kind: analysis
selector:
query: 'true'
Expand Down
1 change: 1 addition & 0 deletions integrations/sonarqube/.port/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ features:
section: Code Quality & Security
resources:
- kind: projects
- kind: projects_ga
- kind: saas_analysis
- kind: onprem_analysis
- kind: issues
Expand Down
15 changes: 15 additions & 0 deletions integrations/sonarqube/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- towncrier release notes start -->


## 0.1.122 (2024-12-23)


### Improvements

- Increased logs presence in integration
- Replaced calls to internal API for projects to GA version, making the use of internal APIs optional


### Bug Fixes

- Fixed a bug in the pagination logic to use total record count instead of response size, preventing early termination (0.1.121)


## 0.1.121 (2024-12-22)


Expand Down
Loading

0 comments on commit 0ac08ec

Please sign in to comment.