Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

On-demand report generation docs#56

Merged
Spikatrix merged 4 commits intomainfromondemand-reports
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file addeddocs/guides/images/api_keys.png
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletionsdocs/guides/ondemand-reports.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
---
title: On-demand Reports
sidebar_label: On-demand Reports (Beta)
description:
CodeRabbit offers a way to generate on-demand reports using a simple API request
sidebar_position: 5
---

```mdx-code-block
import ReportSchema from "@site/src/components/ReportSchema";
```

:::info

This feature is in beta

:::

CodeRabbit offers a way to generate on-demand reports using the [CodeRabbit API](https://api.coderabbit.ai/api/swagger/).
You will need an API Key to access the CodeRabbit API and generate an on-demand report.

## Create an API key

Sign in to your CodeRabbit account and navigate to the [**API Keys**](https://app.coderabbit.ai/settings/api-keys) page under 'Organization Settings' in the left sidebar.
Click on the **Create API Key** button and enter a name for the API Key.
Copy the API key, and keep it safe as it won't be visible again.

![API Keys](./images/api_keys.png)

## Generate an On-demand report

Once you have the API key, pass it in the `x-coderabbitai-api-key` header when calling the API:

```sh
curl -X 'POST' \
'https://api.coderabbit.ai/api/v1/report.generate' \
-H 'accept: application/json' \
-H 'x-coderabbitai-api-key: cr-xxxxxxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"from": "2024-05-01",
"to": "2024-05-15"
}'
```

Sample output:

```sh
[
{
"group": "Developer Activity",
"report": "*Developer Activity*:\n\n 🟢 **Update README.md** [#10](https://gitlab.com/master-group123/sub-group/project1/-/merge_requests/10)\n• Summary: The change updates the project description and modifies a section header for clearer instructions.\n• Last activity: 1 day ago, mergeable\n• Insights:\n - :magnifying_glass: @user2 Suggested updating the wording to make it clearer"
}
]
```


:::info

If you get a 401 UNAUTHORIZED error, check if you're passing the right API key in the `x-coderabbitai-api-key` header

:::

The on-demand report generation endpoints take in inputs as per the schema shown below:

```mdx-code-block
<ReportSchema />
```

[API Reference](https://api.coderabbit.ai/api/swagger/)
6 changes: 6 additions & 0 deletionssrc/components/ReportSchema.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
import Schema from "@site/static/schema/reporting.json";
import JSONSchemaViewer from "@theme/JSONSchemaViewer";

export default function Viewer(): JSX.Element {
return <JSONSchemaViewer schema={Schema} />;
}
93 changes: 93 additions & 0 deletionsstatic/schema/reporting.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
{
"type": "object",
"properties": {
"scheduleRange": {
"type": "string",
"enum": [
"Dates"
]
},
"from": {
"type": "string",
"format": "date"
},
"to": {
"type": "string",
"format": "date"
},
"prompt": {
"type": "string"
},
"promptTemplate": {
"type": "string",
"enum": [
"Daily Standup Report",
"Sprint Report",
"Release Notes",
"Custom"
]
},
"parameters": {
"type": "array",
"items": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"REPOSITORY",
"LABEL",
"TEAM",
"USER"
]
},
"operator": {
"type": "string",
"enum": [
"IN",
"ALL"
]
},
"values": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"parameter",
"operator",
"values"
],
"additionalProperties": false
}
},
"groupBy": {
"type": "string",
"enum": [
"NONE",
"REPOSITORY",
"LABEL",
"TEAM",
"USER"
]
},
"subgroupBy": {
"type": "string",
"enum": [
"NONE",
"REPOSITORY",
"LABEL",
"TEAM",
"USER"
]
}
},
"required": [
"from",
"to"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}

[8]ページ先頭

©2009-2025 Movatter.jp