-
Notifications
You must be signed in to change notification settings - Fork 85
feat(catalog): SonarQube integration #3477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7886b7f
Add sonarqube tile and svg
cloudjumpercat 50f04da
Start drafting API how to
cloudjumpercat 0fa7cc5
Finish draft, appease vale
cloudjumpercat 3d2e0c6
SonarQube links, apply feedback changes
cloudjumpercat ec417a6
Apply suggestions from code review
cloudjumpercat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -741,6 +741,7 @@ slos | |
| SLT_Enc | ||
| sni | ||
| snis | ||
| sonarqube | ||
| Splunk | ||
| Splunk | ||
| ssl | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,6 +163,7 @@ | |
| "slack", | ||
| "slsa", | ||
| "solace", | ||
| "sonarqube", | ||
| "sso", | ||
| "statsd", | ||
| "status", | ||
|
|
||
167 changes: 167 additions & 0 deletions
167
app/_how-tos/monitor-sonarqube-projects-with-konnect-api.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,167 @@ | ||
| --- | ||
| title: Monitor SonarQube projects in Catalog with the Konnect API | ||
| content_type: how_to | ||
| description: Learn how to connect a SonarQube project to your {{site.konnect_catalog}} service in {{site.konnect_short_name}} using the API. | ||
| products: | ||
| - catalog | ||
| works_on: | ||
| - konnect | ||
| tools: | ||
| - konnect-api | ||
| tags: | ||
| - integrations | ||
| - sonarqube | ||
| search_aliases: | ||
| - projects | ||
| - service catalog | ||
| related_resources: | ||
| - text: "{{site.konnect_catalog}}" | ||
| url: /catalog/ | ||
| - text: Integrations | ||
| url: /catalog/integrations/ | ||
| - text: SonarQube reference | ||
| url: /catalog/integrations/sonarqube/ | ||
| - text: "Monitor SonarQube projects {{site.konnect_catalog}} with the {{site.konnect_short_name}} UI" | ||
| url: /how-to/monitor-sonarqube-projects-with-konnect-ui/ | ||
| automated_tests: false | ||
| tldr: | ||
| q: How do I monitor SonarQube projects in {{site.konnect_short_name}}? | ||
| a: Install the SonarQube integration in {{site.konnect_short_name}} and authorize access with your SonarQube personal access token, then link a project to your {{site.konnect_catalog}} service. | ||
| prereqs: | ||
| inline: | ||
| - title: "{{site.konnect_short_name}} roles" | ||
| include_content: prereqs/service-catalog-integration-role | ||
| icon_url: /assets/icons/kogo-white.svg | ||
| - title: SonarQube | ||
| content: | | ||
| You need to configure the following in [SonarQube Cloud](https://www.sonarsource.com/products/sonarcloud/): | ||
| * A [SonarQube personal access token](https://docs.sonarsource.com/sonarqube-cloud/managing-your-account/managing-tokens). | ||
|
|
||
| {:.warning} | ||
| > SonarQube Server isn't supported. | ||
|
|
||
| Export your SonarQube personal access token: | ||
| ```sh | ||
| export SONARQUBE_PAT='YOUR SONARQUBE PERSONAL ACCESS TOKEN' | ||
| ``` | ||
| icon_url: /assets/icons/third-party/sonarqube.svg | ||
| --- | ||
|
|
||
| ## Configure the SonarQube integration | ||
|
|
||
| Before you can discover [SonarQube projects](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects) in {{site.konnect_catalog}}, you must configure the SonarQube integration. | ||
|
|
||
| First, install the SonarQube integration: | ||
|
|
||
| <!--vale off--> | ||
| {% konnect_api_request %} | ||
| url: /v1/integration-instances | ||
| method: POST | ||
| status_code: 201 | ||
| region: us | ||
| body: | ||
| integration_name: sonarqube | ||
| name: sonarqube | ||
| display_name: SonarQube | ||
| config: {} | ||
| {% endkonnect_api_request %} | ||
| <!--vale on--> | ||
|
|
||
| Export the ID of your SonarQube integration: | ||
|
|
||
| ```sh | ||
| export SONARQUBE_INTEGRATION_ID='YOUR-INTEGRATION-ID' | ||
| ``` | ||
|
|
||
| Next, authorize the SonarQube integration with your SonarQube personal access token: | ||
|
|
||
| <!--vale off--> | ||
| {% konnect_api_request %} | ||
| url: /v1/integration-instances/$SONARQUBE_INTEGRATION_ID/auth-credential | ||
| method: POST | ||
| status_code: 201 | ||
| region: us | ||
| body: | ||
| type: multi_key_auth | ||
| config: | ||
| headers: | ||
| - name: authorization | ||
| key: $SONARQUBE_PAT | ||
| {% endkonnect_api_request %} | ||
| <!--vale on--> | ||
|
|
||
| Once authorized, resources from your SonarQube account will be discoverable in the UI. | ||
|
|
||
| ## Create a service in {{site.konnect_catalog}} | ||
|
|
||
| Create a service that you'll map to your SonarQube resources: | ||
|
|
||
| <!--vale off--> | ||
| {% konnect_api_request %} | ||
| url: /v1/catalog-services | ||
| method: POST | ||
| status_code: 201 | ||
| region: us | ||
| body: | ||
| name: billing | ||
| display_name: Billing Service | ||
| {% endkonnect_api_request %} | ||
| <!--vale on--> | ||
|
|
||
| Export the service ID: | ||
|
|
||
| ```sh | ||
| export SONARQUBE_SERVICE_ID='YOUR-SERVICE-ID' | ||
| ``` | ||
|
|
||
| ## List SonarQube resources | ||
|
|
||
| Before you can map your SonarQube resources to a service in {{site.konnect_catalog}}, you first need to find the resources that are pulled in from SonarQube: | ||
|
|
||
| <!--vale off--> | ||
| {% konnect_api_request %} | ||
| url: /v1/resources?filter%5Bintegration.name%5D=sonarqube | ||
| method: GET | ||
| region: us | ||
| status_code: 200 | ||
| {% endkonnect_api_request %} | ||
| <!--vale on--> | ||
|
|
||
| {:.info} | ||
| > You might need to manually sync your SonarQube integration for resources to appear. From the {{site.konnect_short_name}} UI by navigating to the SonarQube integration you just installed and selecting **Sync Now** from the **Actions** dropdown menu. | ||
|
|
||
| Export the resource ID you want to map to the service: | ||
|
|
||
| ```sh | ||
| export SONARQUBE_RESOURCE_ID='YOUR-RESOURCE-ID' | ||
| ``` | ||
|
|
||
| ## Map resources to a service | ||
|
|
||
| Now, you can map the SonarQube resource to the service: | ||
|
|
||
| <!--vale off--> | ||
| {% konnect_api_request %} | ||
| url: /v1/resource-mappings | ||
| method: POST | ||
| status_code: 201 | ||
| region: us | ||
| body: | ||
| service: billing | ||
| resource: $SONARQUBE_RESOURCE_ID | ||
| {% endkonnect_api_request %} | ||
| <!--vale on--> | ||
|
|
||
|
|
||
| ## Validate the mapping | ||
|
|
||
| To confirm that the SonarQube resource is now mapped to the intended service, list the service’s mapped resources: | ||
|
|
||
| <!--vale off--> | ||
| {% konnect_api_request %} | ||
| url: /v1/catalog-services/$SONARQUBE_SERVICE_ID/resources | ||
| method: GET | ||
| status_code: 200 | ||
| region: us | ||
| {% endkonnect_api_request %} | ||
| <!--vale on--> | ||
87 changes: 87 additions & 0 deletions
87
app/_how-tos/monitor-sonarqube-projects-with-konnect-ui.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| --- | ||
| title: Monitor SonarQube projects in Catalog with the Konnect UI | ||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| content_type: how_to | ||
| description: Learn how to connect a SonarQube project to your {{site.konnect_catalog}} service in {{site.konnect_short_name}} using the UI. | ||
| products: | ||
| - catalog | ||
| works_on: | ||
| - konnect | ||
| tags: | ||
| - integrations | ||
| - sonarqube | ||
| search_aliases: | ||
| - project | ||
| - service catalog | ||
| related_resources: | ||
| - text: "{{site.konnect_catalog}}" | ||
| url: /catalog/ | ||
| - text: Integrations | ||
| url: /catalog/integrations/ | ||
| - text: SonarQube reference | ||
| url: /catalog/integrations/sonarqube/ | ||
| - text: "Monitor SonarQube projects {{site.konnect_catalog}} with the {{site.konnect_short_name}} API" | ||
| url: /how-to/monitor-sonarqube-projects-with-konnect-api/ | ||
| automated_tests: false | ||
| tldr: | ||
| q: How do I monitor SonarQube projects in {{site.konnect_short_name}}? | ||
| a: Install the SonarQube integration in {{site.konnect_short_name}} and authorize access with your SonarQube personal access token, then link a project to your {{site.konnect_catalog}} service. | ||
| prereqs: | ||
| inline: | ||
| - title: "{{site.konnect_short_name}} roles" | ||
| include_content: prereqs/service-catalog-integration-role | ||
| icon_url: /assets/icons/kogo-white.svg | ||
| - title: SonarQube | ||
| content: | | ||
| You need to configure the following in [SonarQube Cloud](https://www.sonarsource.com/products/sonarcloud/): | ||
| * A [SonarQube personal access token](https://docs.sonarsource.com/sonarqube-cloud/managing-your-account/managing-tokens). | ||
|
|
||
| {:.warning} | ||
| > SonarQube Server isn't supported. | ||
| icon_url: /assets/icons/third-party/sonarqube.svg | ||
| --- | ||
|
|
||
| ## Configure the SonarQube integration | ||
|
|
||
| Before you can discover [SonarQube projects](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects) in {{site.konnect_catalog}}, you must configure the SonarQube integration. | ||
|
|
||
| 1. In the {{site.konnect_short_name}} sidebar, click **Catalog**. | ||
| 1. In the Catalog sidebar, click **[Integrations](https://cloud.konghq.com/us/service-catalog/integrations)**. | ||
| 1. Click **SonarQube**. | ||
| 1. Click **Add SonarQube instance**. | ||
| 1. In the **SonarQube API key** field, enter your SonarQube personal access token. | ||
| 1. In the **Display name** field, enter `SonarQube`. | ||
| 1. In the **Instance name** field, enter `sonarqube`. | ||
| 1. Click **Save**. | ||
|
|
||
| ## Create a {{site.konnect_catalog}} service and map the SLO resources | ||
|
|
||
| Now that your integration is configured, you can create a {{site.konnect_catalog}} service to map the ingested projects. | ||
|
|
||
| {:.info} | ||
| > In this tutorial, we'll refer to your ingested SonarQube project as `billing-project`. | ||
|
|
||
| 1. In the {{site.konnect_short_name}} sidebar, click [**{{site.konnect_catalog}}**](https://cloud.konghq.com/service-catalog/). | ||
| 1. In the Catalog sidebar, click **Services**. | ||
| 1. Click **New service**. | ||
| 1. In the **Display Name** field, enter `Billing Service`. | ||
| 1. In the **Name** field, enter `billing-service`. | ||
| 1. Click **Create**. | ||
| 1. Click **Map Resources**. | ||
| 1. Select `billing-project`. | ||
| 1. Click **Map 1 Resource**. | ||
|
|
||
| Your integration projects are now discoverable from one {{site.konnect_catalog}} service. | ||
|
|
||
| {:.info} | ||
| > You might need to manually sync your SonarQube integration for resources to appear. From the {{site.konnect_short_name}} UI by navigating to the SonarQube integration you just installed and selecting **Sync Now** from the **Actions** dropdown menu. | ||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Validate the mapping | ||
|
|
||
| To confirm that the SonarQube resource is now mapped to the intended service, navigate to the service: | ||
|
|
||
| 1. In the {{site.konnect_short_name}} sidebar, click [**{{site.konnect_catalog}}**](https://cloud.konghq.com/service-catalog/). | ||
| 1. In the {{site.konnect_catalog}} sidebar, click **Services**. | ||
| 1. Click the **Billing Service** service. | ||
| 1. Click the **Resources** tab. | ||
|
|
||
| You should see the `billing-project` resource listed. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.