Skip to content

Commit

Permalink
Prepare for Mergify built-in integration
Browse files Browse the repository at this point in the history
Update README.md to conform to [integration documentation](https://docs.datadoghq.com/developers/integrations/oauth_for_integrations/#publish-the-oauth-client).

Add OAuth client details.

Fix some outdated data.

Add some screenshots to illustrate the integration setup.
  • Loading branch information
DouglasBlackwood committed Sep 28, 2024
1 parent 3615c30 commit cc69477
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 58 deletions.
45 changes: 37 additions & 8 deletions mergify/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Agent Check: Mergify
# Mergify

## Overview

Expand All @@ -10,13 +10,29 @@ and optimize your development workflow using this Datadog integration.

## Setup

### Installation
You can either install the built-in integration, or install the agent.

#### From release
### Setup Built-In Integration

- **In Mergify dashboard**: Go to [Mergify dashboard][10], log in and navigate to **Integrations**.

- Click the **Connect** button in the **Datadog** tile.

![Mergify Screenshot][12]

- You will be redirected to the Datadog authorization page.

- Log in to Datadog to complete setup.

Your Mergify statistics now appear in Datadog.

### Setup Agent

#### From Release

Run `datadog-agent integration install -t datadog-mergify==<INTEGRATION_VERSION>`.

#### From source
#### From Source

To install the Mergify check on your host:

Expand All @@ -30,25 +46,36 @@ To install the Mergify check on your host:
run `datadog-agent integration install -w
path/to/mergify/dist/<ARTIFACT_NAME>.whl`.

### Configuration
#### Configuration

1. Edit the `mergify.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory][9] to start collecting your Mergify [metrics](#metrics).

See the sample [mergify.d/conf.yaml.example][3] file for all available configuration options.

2. [Restart the Agent][4].

### Validation
#### Validation

Run the [Agent's status subcommand][5] and look for `mergify` under the Checks section.

## Uninstallation

- **In Mergify dashboard**: Go to [Mergify dashboard][10], log in and navigate to **Integrations**.

- Click the **Disconnect** button in the **Datadog** tile.

Once this integration has been uninstalled, any previous authorizations are revoked.

Additionally, ensure that all API keys associated with this integration have been disabled by searching for the integration name on the [API Keys page][11].

## Data Collected

### Metrics

See [metadata.csv][6] for a list of metrics provided by this check.

For the metric `mergify.queue_checks_outcome`, the available `outcome_type` tags are :

- `PR_DEQUEUED`: The number of PRs that have been manually removed from the queue
- `PR_AHEAD_DEQUEUED`: The number of PRs that have been removed from the queue because a PR ahead of it was removed from the queue
- `PR_AHEAD_FAILED_TO_MERGE`: The number of PRs that have been removed from the queue because a PR ahead of it failed to merge
Expand All @@ -65,7 +92,6 @@ For the metric `mergify.queue_checks_outcome`, the available `outcome_type` tags
- `PR_UNEXPECTEDLY_FAILED_TO_MERGE`: The number of PRs that have been removed from the queue because they unexpectedly failed to get merged
- `BATCH_MAX_FAILURE_RESOLUTION_ATTEMPTS`: The number of PRs that have been removed from the queue because the maximum batch failure resolution attempts have been reached


### Service Checks

See [service_checks.json][7] for a list of service checks provided by this integration.
Expand All @@ -74,7 +100,7 @@ See [service_checks.json][7] for a list of service checks provided by this integ

Mergify does not include any events.

## Troubleshooting
## Support

Need help? Contact [Mergify support][1].

Expand All @@ -87,3 +113,6 @@ Need help? Contact [Mergify support][1].
[7]: https://github.com/DataDog/integrations-extras/blob/master/mergify/assets/service_checks.json
[8]: https://docs.datadoghq.com/developers/integrations/new_check_howto/#configure-the-developer-tool
[9]: https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory
[10]: https://dashboard.mergify.com
[11]: https://app.datadoghq.com/organization-settings/api-keys?filter=Mergify
[12]: https://raw.githubusercontent.com/DataDog/integrations-extras/master/mergify/images/setup_integration.png
20 changes: 20 additions & 0 deletions mergify/assets/oauth_clients.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"integration": {
"scopes": [
"api_keys_write"
],
"client_role": "integration",
"name": "Mergify Integration OAuth Client",
"onboarding_url": "https://dashboard.mergify.com/datadog-oauth",
"description": "Mergify Integration OAuth Client",
"redirect_uris": [
"https://dashboard.mergify.com/front/integrations/callback/datadog-US1",
"https://dashboard.mergify.com/front/integrations/callback/datadog-US3",
"https://dashboard.mergify.com/front/integrations/callback/datadog-US5",
"https://dashboard.mergify.com/front/integrations/callback/datadog-EU1",
"https://dashboard.mergify.com/front/integrations/callback/datadog-US1-FED",
"https://dashboard.mergify.com/front/integrations/callback/datadog-AP1"
],
"id": "7e609702-7d7d-11ef-9fee-da7ad0900002"
}
}
46 changes: 0 additions & 46 deletions mergify/images/IMAGES_README.md

This file was deleted.

Binary file added mergify/images/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mergify/images/setup_integration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 17 additions & 4 deletions mergify/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
"overview": "README.md#Overview",
"configuration": "README.md#Setup",
"support": "README.md#Support",
"uninstallation": "README.md#Uninstallation",
"changelog": "CHANGELOG.md",
"description": "Mergify merge queue statistics integration",
"title": "Mergify",
"media": [],
"media": [
{
"media_type": "image",
"caption": "Mergify - Dashboard",
"image_url": "images/dashboard.png"
}
],
"classifier_tags": [
"Supported OS::Linux",
"Supported OS::Windows",
Expand All @@ -31,7 +38,12 @@
},
"metrics": {
"prefix": "mergify.",
"check": "mergify.queue_checks_outcome",
"check": [
"mergify.merge_queue_length",
"mergify.time_to_merge.median",
"mergify.time_to_merge.mean",
"mergify.queue_checks_outcome"
],
"metadata_path": "metadata.csv"
},
"service_checks": {
Expand All @@ -42,12 +54,13 @@
},
"dashboards": {
"Mergify merge queue overview": "assets/dashboards/mergify_overview.json"
}
},
"oauth": "assets/oauth_clients.json"
},
"author": {
"support_email": "[email protected]",
"name": "Community",
"homepage": "https://mergify.com",
"sales_email": "[email protected]"
}
}
}

0 comments on commit cc69477

Please sign in to comment.