Skip to content

Commit

Permalink
Create a new tile for Mergify built-in integration
Browse files Browse the repository at this point in the history
  • Loading branch information
DouglasBlackwood committed Oct 3, 2024
1 parent e169599 commit 0a59fb8
Show file tree
Hide file tree
Showing 10 changed files with 394 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
/modal/ @modal-labs [email protected] @irfansharif [email protected]
/mendix/ @mendix/cloud @DataDog/agent-integrations @DataDog/ecosystems-review
/mergify/ @Mergifyio/oss-integrations
/mergify_oauth/ @Mergifyio/oss-integrations
/n2ws/ @eliadeini [email protected] @DataDog/ecosystems-review
/neo4j/ @davidfauth [email protected] @DataDog/ecosystems-review
/neoload/ @Neotys-Labs/r-d @DataDog/ecosystems-review
Expand Down
7 changes: 7 additions & 0 deletions mergify_oauth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CHANGELOG - Mergify

## 1.0.0 / 2024-10-02

***Added***:

* Initial Release
69 changes: 69 additions & 0 deletions mergify_oauth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Mergify

## Overview

This integration monitors merge queue length for each configured repository in
[Mergify][1] and tracks Mergify's global availability. By sending metrics to your
Datadog account, you can set up monitors for anomaly alerts and analyze merge
queue performance. You can maintain awareness of Mergify service availability
and optimize your development workflow using this Datadog integration.

## Setup

1. Go to the [Mergify dashboard][3], log in, and navigate to **Integrations**.
2. Click the **Connect** button in the **Datadog** tile and you will be redirected to the Datadog authorization page.
![Screenshot showing the Mergify dashboard][5]
3. Log in to Datadog to complete setup.

Your Mergify statistics now appear in Datadog.

## Uninstallation

1. Go to the [Mergify dashboard][3], log in, and navigate to **Integrations**.
2. 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][4].

## Data Collected

### Metrics

See [metadata.csv][2] 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
- `PR_WITH_HIGHER_PRIORITY_QUEUED`: The number of PRs that have been removed from the queue because a PR with higher priority has been queued
- `PR_QUEUED_TWICE`: The number of PRs that have been removed from the queue because they have been queued twice
- `SPECULATIVE_CHECK_NUMBER_REDUCED`: The number of PRs that have been removed from the queue because the number of speculative checks in the config was changed
- `CHECKS_TIMEOUT`: The number of PRs that have been removed from the queue because the speculative checks have timed out
- `CHECKS_FAILED`: The number of PRs that have been removed from the queue because the speculative checks have failed
- `QUEUE_RULE_MISSING`: The number of PRs that have been removed from the queue because the queue rule that was used to queue the PR has been removed from the config
- `UNEXPECTED_QUEUE_CHANGE`: The number of PRs that have been removed from the queue because a user made an operation on the queued pull request
- `PR_FROZEN_NO_CASCADING`: The number of PRs that have been removed from the queue because they were frozen by a freeze with no cascading effect
- `TARGET_BRANCH_CHANGED`: The number of PRs that have been removed from the queue because the PR's target branch was changed
- `TARGET_BRANCH_MISSING`: The number of PRs that have been removed from the queue because the PR's target branch does not exist anymore
- `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

Mergify does not include any service checks.

### Events

Mergify does not include any events.

## Support

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

[1]: https://mergify.com
[2]: https://github.com/DataDog/integrations-extras/blob/master/mergify/metadata.csv
[3]: https://dashboard.mergify.com
[4]: https://app.datadoghq.com/organization-settings/api-keys?filter=Mergify
[5]: https://raw.githubusercontent.com/DataDog/integrations-extras/master/mergify/images/setup_integration.png
225 changes: 225 additions & 0 deletions mergify_oauth/assets/dashboards/mergify_overview.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
{
"title": "Mergify Overview",
"description": "# Faster and Safer Code Merge\n\n**Merge Queue**: Queue, Update and Merge your Pull Requests.\n**Workflow Automation**: Automate your code merge processes.\n\nSave Time. Save Money. Secure your code.\nImprove your developer experience.\n\nThis is an example of Datadog merge queue dashboard you can get from https://mergify.com/.",
"widgets": [
{
"id": 6714248528946580,
"definition": {
"type": "image",
"url": "https://uploads-ssl.webflow.com/638f4ec77f1bd063218863f7/63d3fc51cc7a5229e8d897f2_mergify-logo-title-horizontal-white-p-500.png",
"sizing": "scale-down",
"has_background": true,
"has_border": true,
"vertical_align": "center",
"horizontal_align": "center"
},
"layout": {
"x": 0,
"y": 0,
"width": 4,
"height": 2
}
},
{
"id": 6680129273384530,
"definition": {
"type": "note",
"content": "# Faster and Safer Code Merge\n\n**Merge Queue**: Queue, Update and Merge your Pull Requests.\n\n**Workflow Automation**: Automate your code merge processes.\n\nSave Time. Save Money. Secure your code.\nImprove your developer experience.\n\nThis is an example of Datadog merge queue dashboard you can get from https://mergify.com/.",
"background_color": "white",
"font_size": "14",
"text_align": "left",
"vertical_align": "top",
"show_tick": false,
"tick_pos": "50%",
"tick_edge": "left",
"has_padding": true
},
"layout": {
"x": 4,
"y": 0,
"width": 8,
"height": 2
}
},
{
"id": 4473883965068244,
"definition": {
"title": "Merge Queue Length",
"title_size": "16",
"title_align": "left",
"show_legend": true,
"legend_layout": "horizontal",
"legend_columns": [
"avg",
"min",
"max",
"value",
"sum"
],
"type": "timeseries",
"requests": [
{
"formulas": [
{
"formula": "query1"
}
],
"queries": [
{
"name": "query1",
"data_source": "metrics",
"query": "max:mergify.merge_queue_length{$repository} by {branch,repository}"
}
],
"response_format": "timeseries",
"style": {
"palette": "dog_classic",
"line_type": "solid",
"line_width": "normal"
},
"display_type": "line"
}
]
},
"layout": {
"x": 0,
"y": 2,
"width": 12,
"height": 2
}
},
{
"id": 295070581551368,
"definition": {
"title": "Median Time to Merge Per Repository, Per Branch, and Per Queue",
"type": "treemap",
"requests": [
{
"response_format": "scalar",
"queries": [
{
"name": "query2",
"data_source": "metrics",
"query": "avg:mergify.time_to_merge.median{$repository} by {repository,branch,queue}",
"aggregator": "last"
}
],
"formulas": [
{
"formula": "query2"
}
]
}
]
},
"layout": {
"x": 0,
"y": 4,
"width": 12,
"height": 3
}
},
{
"id": 5619028571653368,
"definition": {
"title": "Queue Checks Outcomes",
"title_size": "16",
"title_align": "left",
"requests": [
{
"response_format": "scalar",
"formulas": [
{
"formula": "query1",
"limit": {
"order": "desc"
}
}
],
"queries": [
{
"query": "sum:mergify.queue_checks_outcome{$repository} by {outcome_type}",
"data_source": "metrics",
"name": "query1",
"aggregator": "last"
}
],
"style": {
"palette": "datadog16"
}
}
],
"type": "sunburst",
"legend": {
"type": "automatic"
}
},
"layout": {
"x": 0,
"y": 7,
"width": 12,
"height": 4
}
},
{
"id": 5315420267683440,
"definition": {
"title": "Queue Freeze Duration",
"title_size": "16",
"title_align": "left",
"show_legend": true,
"legend_layout": "auto",
"legend_columns": [
"avg",
"min",
"max",
"value",
"sum"
],
"time": {},
"type": "timeseries",
"requests": [
{
"formulas": [
{
"formula": "query1"
}
],
"queries": [
{
"name": "query1",
"data_source": "metrics",
"query": "avg:mergify.queue_freeze.duration{$repository} by {queue,repository}"
}
],
"response_format": "timeseries",
"style": {
"palette": "dog_classic",
"order_by": "values",
"line_type": "solid",
"line_width": "normal"
},
"display_type": "line"
}
]
},
"layout": {
"x": 0,
"y": 11,
"width": 12,
"height": 3
}
}
],
"template_variables": [
{
"name": "repository",
"prefix": "repository",
"available_values": [],
"default": "*"
}
],
"layout_type": "ordered",
"notify_list": [],
"reflow_type": "fixed"
}
20 changes: 20 additions & 0 deletions mergify_oauth/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"
}
}
1 change: 1 addition & 0 deletions mergify_oauth/assets/service_checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Binary file added mergify_oauth/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_oauth/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.
Loading

0 comments on commit 0a59fb8

Please sign in to comment.