-
Notifications
You must be signed in to change notification settings - Fork 6
chore: update docs #93
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,13 +1,13 @@ | ||||||
| --- | ||||||
| title: Open Source | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Page title contradicts the brand guidelines added in this same PR The body of this page (correctly) now says Sweetr is "fair source, not open source", and the new However, the page Consider renaming to something like
Suggested change
|
||||||
| icon: "gear-code" | ||||||
| icon: "brand-open-source" | ||||||
| --- | ||||||
|
|
||||||
| At Sweetr, we are huge fans of open source and its community. We believe in the power of community-driven development and the positive impact it has on innovation and progress. Our source code is freely available for everyone, and we allow self-hosting to ensure accessibility and flexibility. | ||||||
|
|
||||||
| ## License | ||||||
|
|
||||||
| Our projects are licensed under the <a href="https://fsl.software/" target="_blank" rel="nofollow">Functional Source License (FSL)</a>. While this license is not OSI-approved, it combines the benefits of open source with safeguards against harmful free-riding. The FSL ensures that the software remains open for use, modification, and distribution, but prevents commercial users to use our code to compete against us. After two years, the FSL license automatically converts to the Apache License. | ||||||
| Our projects are licensed under the <a href="https://fsl.software/" target="_blank" rel="nofollow">Functional Source License (FSL)</a>. While this license is not OSI-approved, it combines the benefits of open source with safeguards against harmful free-riding. The FSL ensures that the software remains open for use, modification, and distribution, but prevents commercial users from using our code to compete against us. After two years, the FSL license automatically converts to the Apache License. | ||||||
|
|
||||||
| We believe this license strikes a good balance between freedom for our users and sustainability to our business. | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- | ||
| title: Authentication | ||
| description: Authenticate requests to the Sweetr API using API keys. | ||
| icon: "key" | ||
| --- | ||
|
|
||
| All API requests must include a valid API key in the `Authorization` header using the Bearer scheme: | ||
|
|
||
| ```bash | ||
| Authorization: Bearer YOUR_API_KEY | ||
| ``` | ||
|
|
||
| ## Generating API keys | ||
|
|
||
| API keys are scoped to a workspace. To generate one: | ||
|
|
||
| 1. Open the Sweetr dashboard. | ||
| 2. Navigate to **Settings > Workspace**. | ||
| 3. Scroll down to the **API** section. | ||
| 4. Click **Regenerate** and copy the generated key. | ||
|
|
||
| <Warning> | ||
| API keys are only displayed once at creation time. Store them securely — for | ||
| example, as a secret in your CI/CD provider. | ||
| </Warning> | ||
|
|
||
| ## Security best practices | ||
|
|
||
| - **Never commit API keys** to source control. | ||
| - **Use CI/CD secrets** (e.g., GitHub Actions secrets, GitLab CI variables) to inject keys at runtime. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| title: Create Deployment | ||
| api: "POST /v1/deployments" | ||
| --- | ||
|
|
||
| Track a new deployment for an application. If the application doesn't exist, it will be created automatically. | ||
|
|
||
| The request is processed asynchronously. A `202 Accepted` response means the deployment has been queued for processing. | ||
|
|
||
| ## Body | ||
|
|
||
| <ParamField body="repositoryFullName" type="string" required> | ||
| Full name of the GitHub repository (e.g., `owner/repo-name`). Max 255 characters. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="environment" type="string" required> | ||
| Target environment name (e.g., `production`, `staging`). Created automatically if it doesn't exist. Max 255 characters. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="app" type="string" required> | ||
| Application name. Created automatically if it doesn't exist. Max 255 characters. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="version" type="string" required> | ||
| Version identifier for this deployment (e.g., `v1.2.3`, `build-456`). Max 70 characters. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="commitHash" type="string" required> | ||
| The full Git commit SHA being deployed. Max 70 characters. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="description" type="string"> | ||
| A short description of the deployment. Max 255 characters. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="author" type="string"> | ||
| The person who triggered the deployment. Max 255 characters. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="deployedAt" type="string"> | ||
| ISO 8601 datetime of when the deployment occurred. Defaults to the current time if not provided. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="monorepoPath" type="string"> | ||
| Subdirectory path within the repository for monorepo setups. Max 255 characters. | ||
| </ParamField> | ||
|
|
||
| ## Response | ||
|
|
||
| <ResponseField name="status" type="number"> | ||
| `202` — The deployment has been accepted and queued for processing. | ||
| </ResponseField> | ||
|
|
||
| <RequestExample> | ||
| ```bash cURL | ||
| curl -X POST https://api.sweetr.dev/v1/deployments \ | ||
| -H "Authorization: Bearer YOUR_API_KEY" \ | ||
| -H "Content-Type: application/json" \ | ||
|
waltergalvao marked this conversation as resolved.
|
||
| -d '{ | ||
| "repositoryFullName": "acme/backend", | ||
| "environment": "production", | ||
| "app": "backend-api", | ||
| "version": "v1.4.2", | ||
| "commitHash": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2", | ||
| "description": "Release v1.4.2", | ||
| "author": "jane-doe" | ||
| }' | ||
| ``` | ||
|
|
||
| ```bash GitHub Actions | ||
| - name: Track deployment | ||
| run: | | ||
| curl -X POST https://api.sweetr.dev/v1/deployments \ | ||
| -H "Authorization: Bearer ${{ secrets.SWEETR_API_KEY }}" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "repositoryFullName": "${{ github.repository }}", | ||
| "environment": "production", | ||
| "app": "my-app", | ||
| "version": "${{ github.sha }}", | ||
| "commitHash": "${{ github.sha }}" | ||
| }' | ||
| ``` | ||
| </RequestExample> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| title: Introduction | ||
| description: Integrate your CI/CD pipeline with Sweetr using the REST API. | ||
| icon: "article" | ||
| --- | ||
|
|
||
| The Sweetr API lets you programmatically send data to Sweetr from your CI/CD pipelines and external tools. | ||
|
|
||
| ## Base URL | ||
|
|
||
| All API requests are made to: | ||
|
|
||
| ``` | ||
| https://api.sweetr.dev | ||
| ``` | ||
|
|
||
| ## Available endpoints | ||
|
|
||
| <CardGroup cols={1}> | ||
| <Card | ||
| title="POST /v1/deployments" | ||
| icon="rocket" | ||
| href="/api-reference/deployments/create-deployment" | ||
| > | ||
| Track a new deployment for an application. | ||
| </Card> | ||
| </CardGroup> | ||
|
|
||
| ## Related | ||
|
|
||
| <CardGroup cols={2}> | ||
| <Card | ||
| title="Authentication" | ||
| icon="key" | ||
| href="/api-reference/authentication" | ||
| /> | ||
| <Card | ||
| title="Rate Limits" | ||
| icon="gauge" | ||
| href="/api-reference/rate-limit" | ||
| /> | ||
| </CardGroup> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| title: Rate Limits | ||
| description: Understand the rate limits applied to the Sweetr API. | ||
| icon: "gauge" | ||
| --- | ||
|
|
||
| All API endpoints are rate limited to **100 requests per minute**, scoped to your API key. Requests that exceed the limit receive a `429 Too Many Requests` response. | ||
|
|
||
| ## Handling rate limits | ||
|
|
||
| If you hit a rate limit, wait before retrying. The recommended approach is exponential backoff — wait 1 second, then 2, then 4, and so on. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,78 @@ | ||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||
| title: Incident Detection | ||||||||||||||||||||||||||||||
| description: Automatically create incident records from rollbacks, hotfixes and reverts. | ||||||||||||||||||||||||||||||
| icon: "circle-dot" | ||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| import { CtaGetStarted } from "/snippets/cta-get-started.mdx"; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Demo | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| <Frame> | ||||||||||||||||||||||||||||||
| <img src="/images/incident-detection.png" /> | ||||||||||||||||||||||||||||||
| </Frame> | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## How it works | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Incident Detection automatically creates incidents when it detects problematic deployments. Incident Detection is enabled and pre-configured by default for every workspace. You can disable or customize the detection rules as needed. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### Rollback detection | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Detects when a deployment reverts to a previously deployed version. Sweetr compares the commit history between deployments to identify rollbacks automatically. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| | Incident field | Value | | ||||||||||||||||||||||||||||||
| | -------------------- | --------------------------------------------------------------- | | ||||||||||||||||||||||||||||||
| | **Cause deployment** | The first deployment after the version that was rolled back to. | | ||||||||||||||||||||||||||||||
| | **Fix deployment** | The rollback deployment itself. | | ||||||||||||||||||||||||||||||
| | **Detected at** | The time of the rollback deployment. | | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| For example, given deployments `A → B → C → D`, if you roll back to `B`: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - **Cause deployment**: `C` (the first deployment after `B`, where the problem was introduced) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### Hotfix detection | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Detects incidents based on patterns in pull request titles, branch names, or labels. Configure regular expressions to match your team's conventions. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| | Pattern | Description | | ||||||||||||||||||||||||||||||
| | ------------------ | -------------------------------------------------------- | | ||||||||||||||||||||||||||||||
| | **PR title regex** | Match pull request titles (e.g., `hotfix`, `emergency`). | | ||||||||||||||||||||||||||||||
| | **Branch regex** | Match branch names (e.g., `hotfix/*`). | | ||||||||||||||||||||||||||||||
|
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
waltergalvao marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||
| | **PR label regex** | Match pull request labels. | | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
Comment on lines
+30
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify that hotfix regex fields are optional. At Line 30 and the table (Lines 32-36), this reads as if all regexes must be configured. Please add that each field can be left empty to disable that matcher. ✏️ Suggested doc patch-Detects incidents based on patterns in pull request titles, branch names, or labels. Configure regular expressions to match your team's conventions.
+Detects incidents based on patterns in pull request titles, branch names, or labels. Configure regular expressions to match your team's conventions. Each regex is optional—leave it empty to skip that matcher.Based on learnings: in 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| | Incident field | Value | | ||||||||||||||||||||||||||||||
| | -------------------- | -------------------------------------------------------- | | ||||||||||||||||||||||||||||||
| | **Cause deployment** | The deployment immediately before the hotfix deployment. | | ||||||||||||||||||||||||||||||
| | **Fix deployment** | The deployment containing the hotfix pull request. | | ||||||||||||||||||||||||||||||
| | **Detected at** | The time of the hotfix deployment. | | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### Revert detection | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Detects when a pull request is a revert of a previous change. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| | Incident field | Value | | ||||||||||||||||||||||||||||||
| | -------------------- | ----------------------------------------------------------------------- | | ||||||||||||||||||||||||||||||
| | **Cause deployment** | The deployment that contained the original (now-reverted) pull request. | | ||||||||||||||||||||||||||||||
| | **Fix deployment** | The deployment containing the revert pull request. | | ||||||||||||||||||||||||||||||
|
waltergalvao marked this conversation as resolved.
|
||||||||||||||||||||||||||||||
| | **Detected at** | The time of the revert deployment. | | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Benefits | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| <Card horizontal title="Improves data accuracy" icon="database"> | ||||||||||||||||||||||||||||||
| Precise failure rate on your DORA metrics. Remove manual work from incident | ||||||||||||||||||||||||||||||
| reporting. | ||||||||||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Related | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| <CardGroup cols={2}> | ||||||||||||||||||||||||||||||
| <Card | ||||||||||||||||||||||||||||||
| title="DORA Metrics" | ||||||||||||||||||||||||||||||
| icon="chart-line" | ||||||||||||||||||||||||||||||
| href="/metrics-and-insights/dora" | ||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||
| <Card title="Incidents" icon="flame" href="/platform/incidents" /> | ||||||||||||||||||||||||||||||
| <Card title="Deployments" icon="rocket" href="/platform/deployments" /> | ||||||||||||||||||||||||||||||
| </CardGroup> | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| <CtaGetStarted /> | ||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.