Skip to content

Commit d98ea6f

Browse files
committed
Merge remote-tracking branch 'origin/main' into agent_resource_monitoring
2 parents fae8dc9 + a15f06a commit d98ea6f

File tree

16 files changed

+319
-72
lines changed

16 files changed

+319
-72
lines changed

.github/workflows/dependabot.yaml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
name: dependabot
2-
# Dependabot is annoying, but this makes it a bit less so.
32

43
on:
54
pull_request:
6-
types: [opened, closed]
5+
types:
6+
- opened
77

88
permissions:
99
contents: read
1010

11-
# Only run one instance per PR to ensure in-order execution.
12-
concurrency: pr-${{ github.ref }}
13-
1411
jobs:
1512
dependabot-automerge:
1613
runs-on: ubuntu-latest
@@ -46,16 +43,6 @@ jobs:
4643
PR_URL: ${{github.event.pull_request.html_url}}
4744
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
4845

49-
dependabot-automerge-notify:
50-
# Send a slack notification when a dependabot PR is merged.
51-
runs-on: ubuntu-latest
52-
if: >
53-
github.event_name == 'pull_request' &&
54-
github.event.action == 'closed' &&
55-
github.event.pull_request.merged == true &&
56-
github.event.pull_request.user.login == 'dependabot[bot]' &&
57-
github.repository == 'coder/coder'
58-
steps:
5946
- name: Send Slack notification
6047
env:
6148
PR_URL: ${{github.event.pull_request.html_url}}
@@ -71,7 +58,7 @@ jobs:
7158
"type": "header",
7259
"text": {
7360
"type": "plain_text",
74-
"text": ":pr-merged: Auto merged Dependabot PR #${{ env.PR_NUMBER }}",
61+
"text": ":pr-merged: Auto merge enabled for Dependabot PR #${{ env.PR_NUMBER }}",
7562
"emoji": true
7663
}
7764
},

cli/cliui/agent.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func Agent(ctx context.Context, writer io.Writer, agentID uuid.UUID, opts AgentO
120120
if agent.Status == codersdk.WorkspaceAgentTimeout {
121121
now := time.Now()
122122
sw.Log(now, codersdk.LogLevelInfo, "The workspace agent is having trouble connecting, wait for it to connect or restart your workspace.")
123-
sw.Log(now, codersdk.LogLevelInfo, troubleshootingMessage(agent, fmt.Sprintf("%s/templates#agent-connection-issues", opts.DocsURL)))
123+
sw.Log(now, codersdk.LogLevelInfo, troubleshootingMessage(agent, fmt.Sprintf("%s/admin/templates/troubleshooting#agent-connection-issues", opts.DocsURL)))
124124
for agent.Status == codersdk.WorkspaceAgentTimeout {
125125
if agent, err = fetch(); err != nil {
126126
return xerrors.Errorf("fetch: %w", err)
@@ -225,13 +225,13 @@ func Agent(ctx context.Context, writer io.Writer, agentID uuid.UUID, opts AgentO
225225
sw.Fail(stage, safeDuration(sw, agent.ReadyAt, agent.StartedAt))
226226
// Use zero time (omitted) to separate these from the startup logs.
227227
sw.Log(time.Time{}, codersdk.LogLevelWarn, "Warning: A startup script exited with an error and your workspace may be incomplete.")
228-
sw.Log(time.Time{}, codersdk.LogLevelWarn, troubleshootingMessage(agent, fmt.Sprintf("%s/templates#startup-script-exited-with-an-error", opts.DocsURL)))
228+
sw.Log(time.Time{}, codersdk.LogLevelWarn, troubleshootingMessage(agent, fmt.Sprintf("%s/admin/templates/troubleshooting#startup-script-exited-with-an-error", opts.DocsURL)))
229229
default:
230230
switch {
231231
case agent.LifecycleState.Starting():
232232
// Use zero time (omitted) to separate these from the startup logs.
233233
sw.Log(time.Time{}, codersdk.LogLevelWarn, "Notice: The startup scripts are still running and your workspace may be incomplete.")
234-
sw.Log(time.Time{}, codersdk.LogLevelWarn, troubleshootingMessage(agent, fmt.Sprintf("%s/templates#your-workspace-may-be-incomplete", opts.DocsURL)))
234+
sw.Log(time.Time{}, codersdk.LogLevelWarn, troubleshootingMessage(agent, fmt.Sprintf("%s/admin/templates/troubleshooting#your-workspace-may-be-incomplete", opts.DocsURL)))
235235
// Note: We don't complete or fail the stage here, it's
236236
// intentionally left open to indicate this stage didn't
237237
// complete.
@@ -253,7 +253,7 @@ func Agent(ctx context.Context, writer io.Writer, agentID uuid.UUID, opts AgentO
253253
stage := "The workspace agent lost connection"
254254
sw.Start(stage)
255255
sw.Log(time.Now(), codersdk.LogLevelWarn, "Wait for it to reconnect or restart your workspace.")
256-
sw.Log(time.Now(), codersdk.LogLevelWarn, troubleshootingMessage(agent, fmt.Sprintf("%s/templates#agent-connection-issues", opts.DocsURL)))
256+
sw.Log(time.Now(), codersdk.LogLevelWarn, troubleshootingMessage(agent, fmt.Sprintf("%s/admin/templates/troubleshooting#agent-connection-issues", opts.DocsURL)))
257257

258258
disconnectedAt := agent.DisconnectedAt
259259
for agent.Status == codersdk.WorkspaceAgentDisconnected {

docs/admin/integrations/platformx.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# DX PlatformX
2+
3+
[DX](https://getdx.com) is a developer intelligence platform used by engineering
4+
leaders and platform engineers. Coder notifications can be transformed to
5+
[PlatformX](https://getdx.com/platformx) events, allowing platform engineers to
6+
measure activity and send pulse surveys to subsets of Coder users to understand
7+
their experience.
8+
9+
![PlatformX Events in Coder](../../images/integrations/platformx-screenshot.png)
10+
11+
## Requirements
12+
13+
You'll need:
14+
15+
- Coder v2.19+
16+
- A PlatformX subscription from [DX](https://getdx.com/)
17+
- A platform to host the integration, such as:
18+
- AWS Lambda
19+
- Google Cloud Run
20+
- Heroku
21+
- Kubernetes
22+
- Or any other platform that can run Python web applications
23+
24+
## coder-platformx-events-middleware
25+
26+
Coder sends [notifications](../monitoring/notifications/index.md) via webhooks
27+
to coder-platformx-events-middleware, which processes and reformats the payload
28+
into a structure compatible with [PlatformX by DX](https://help.getdx.com/en/articles/7880779-getting-started).
29+
30+
For more information about coder-platformx-events-middleware and how to
31+
integrate it with your Coder deployment and PlatformX events, refer to the
32+
[coder-platformx-notifications](https://github.com/coder/coder-platformx-notifications)
33+
repository.
34+
35+
### Supported Notification Types
36+
37+
coder-platformx-events-middleware supports the following [Coder notifications](../monitoring/notifications/index.md):
38+
39+
- Workspace Created
40+
- Workspace Manually Updated
41+
- User Account Created
42+
- User Account Suspended
43+
- User Account Activated
44+
45+
### Environment Variables
46+
47+
The application expects the following environment variables when started.
48+
For local development, create a `.env` file in the project root with the following variables.
49+
A `.env.sample` file is included:
50+
51+
| Variable | Description | Example |
52+
|------------------|--------------------------------------------|----------------------------------------------|
53+
| `LOG_LEVEL` | Logging level (`DEBUG`, `INFO`, `WARNING`) | `INFO` |
54+
| `GETDX_API_KEY` | API key for PlatformX | `your-api-key` |
55+
| `EVENTS_TRACKED` | Comma-separated list of tracked events | `"Workspace Created,User Account Suspended"` |
56+
57+
### Logging
58+
59+
Logs are printed to the console and can be adjusted using the `LOG_LEVEL` variable. The available levels are:
60+
61+
| Level | Description |
62+
|-----------|---------------------------------------|
63+
| `DEBUG` | Most verbose, useful for debugging |
64+
| `INFO` | Standard logging for normal operation |
65+
| `WARNING` | Logs only warnings and errors |
66+
67+
### API Endpoints
68+
69+
- `GET /` - Health check endpoint
70+
- `POST /` - Webhook receiver

docs/admin/licensing/index.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ features, you can [request a trial](https://coder.com/trial) or
1212
1313
<!-- markdown-link-check-enable -->
1414

15+
![Licenses screen shows license information and seat consumption](../../images/admin/licenses/licenses-screen.png)
16+
1517
## Adding your license key
1618

1719
There are two ways to add a license to a Coder deployment:
@@ -20,37 +22,51 @@ There are two ways to add a license to a Coder deployment:
2022

2123
### Coder UI
2224

23-
First, ensure you have a license key
24-
([request a trial](https://coder.com/trial)).
25+
1. With an `Owner` account, go to **Admin settings** > **Deployment**.
2526

26-
With an `Owner` account, navigate to `Deployment -> Licenses`, `Add a license`
27-
then drag or select the license file with the `jwt` extension.
27+
1. Select **Licenses** from the sidebar, then **Add a license**:
2828

29-
![Add License UI](../../images/add-license-ui.png)
29+
![Add a license from the licenses screen](../../images/admin/licenses/licenses-nolicense.png)
3030

31-
### Coder CLI
31+
1. On the **Add a license** screen, drag your `.jwt` license file into the
32+
**Upload Your License** section, or paste your license in the
33+
**Paste Your License** text box, then select **Upload License**:
3234

33-
First, ensure you have a license key
34-
([request a trial](https://coder.com/trial)) and the
35-
[Coder CLI](../../install/cli.md) installed.
35+
![Add a license screen](../../images/admin/licenses/add-license-ui.png)
36+
37+
### Coder CLI
3638

37-
1. Save your license key to disk and make note of the path
38-
2. Open a terminal
39-
3. Ensure you are logged into your Coder deployment
39+
1. Ensure you have the [Coder CLI](../../install/cli.md) installed.
40+
1. Save your license key to disk and make note of the path.
41+
1. Open a terminal.
42+
1. Log in to your Coder deployment:
4043

41-
`coder login <access url>`
44+
```shell
45+
coder login <access url>
46+
```
4247

43-
4. Run
48+
1. Run `coder licenses add`:
4449

45-
`coder licenses add -f <path to your license key>`
50+
```shell
51+
coder licenses add -f <path to your license key>
52+
```
4653

4754
</div>
4855

49-
## Find your deployment ID
56+
## FAQ
57+
58+
### Find your deployment ID
5059

5160
You'll need your deployment ID to request a trial or license key.
5261

5362
From your Coder dashboard, select your user avatar, then select the **Copy to
5463
clipboard** icon at the bottom:
5564

5665
![Copy the deployment ID from the bottom of the user avatar dropdown](../../images/admin/deployment-id-copy-clipboard.png)
66+
67+
### How we calculate license seat consumption
68+
69+
Licenses are consumed based on the status of user accounts.
70+
Only users who have been active in the last 90 days consume license seats.
71+
72+
Consult the [user status documentation](../users/index.md#user-status) for more information about active, dormant, and suspended user statuses.

docs/admin/users/oidc-auth.md

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,7 @@ Your OIDC provider will ask you for the following parameter:
1111

1212
## Step 2: Configure Coder with the OpenID Connect credentials
1313

14-
Navigate to your Coder host and run the following command to start up the Coder
15-
server:
16-
17-
```shell
18-
coder server --oidc-issuer-url="https://issuer.corp.com" --oidc-email-domain="your-domain-1,your-domain-2" --oidc-client-id="533...des" --oidc-client-secret="G0CSP...7qSM"
19-
```
20-
21-
If you are running Coder as a system service, you can achieve the same result as
22-
the command above by adding the following environment variables to the
23-
`/etc/coder.d/coder.env` file:
14+
Set the following environment variables on your Coder deployment and restart Coder:
2415

2516
```env
2617
CODER_OIDC_ISSUER_URL="https://issuer.corp.com"
@@ -29,30 +20,6 @@ CODER_OIDC_CLIENT_ID="533...des"
2920
CODER_OIDC_CLIENT_SECRET="G0CSP...7qSM"
3021
```
3122

32-
Once complete, run `sudo service coder restart` to reboot Coder.
33-
34-
If deploying Coder via Helm, you can set the above environment variables in the
35-
`values.yaml` file as such:
36-
37-
```yaml
38-
coder:
39-
env:
40-
- name: CODER_OIDC_ISSUER_URL
41-
value: "https://issuer.corp.com"
42-
- name: CODER_OIDC_EMAIL_DOMAIN
43-
value: "your-domain-1,your-domain-2"
44-
- name: CODER_OIDC_CLIENT_ID
45-
value: "533...des"
46-
- name: CODER_OIDC_CLIENT_SECRET
47-
value: "G0CSP...7qSM"
48-
```
49-
50-
To upgrade Coder, run:
51-
52-
```shell
53-
helm upgrade <release-name> coder-v2/coder -n <namespace> -f values.yaml
54-
```
55-
5623
## OIDC Claims
5724

5825
When a user logs in for the first time via OIDC, Coder will merge both the

docs/images/add-license-ui.png

-207 KB
Binary file not shown.
83.5 KB
Loading
Loading
131 KB
Loading
Loading

docs/manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,11 @@
504504
"description": "Integrate Coder with Island's Secure Browser",
505505
"path": "./admin/integrations/island.md"
506506
},
507+
{
508+
"title": "DX PlatformX",
509+
"description": "Integrate Coder with DX PlatformX",
510+
"path": "./admin/integrations/platformx.md"
511+
},
507512
{
508513
"title": "Hashicorp Vault",
509514
"description": "Integrate Coder with Hashicorp Vault",

site/pnpm-lock.yaml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import type { Meta, StoryObj } from "@storybook/react";
2+
import {
3+
Table,
4+
TableBody,
5+
TableCell,
6+
TableHead,
7+
TableHeader,
8+
TableRow,
9+
} from "./Table";
10+
11+
const invoices = [
12+
{
13+
invoice: "INV001",
14+
paymentStatus: "Paid",
15+
totalAmount: "$250.00",
16+
paymentMethod: "Credit Card",
17+
},
18+
{
19+
invoice: "INV002",
20+
paymentStatus: "Pending",
21+
totalAmount: "$150.00",
22+
paymentMethod: "PayPal",
23+
},
24+
{
25+
invoice: "INV003",
26+
paymentStatus: "Unpaid",
27+
totalAmount: "$350.00",
28+
paymentMethod: "Bank Transfer",
29+
},
30+
{
31+
invoice: "INV004",
32+
paymentStatus: "Paid",
33+
totalAmount: "$450.00",
34+
paymentMethod: "Credit Card",
35+
},
36+
{
37+
invoice: "INV005",
38+
paymentStatus: "Paid",
39+
totalAmount: "$550.00",
40+
paymentMethod: "PayPal",
41+
},
42+
{
43+
invoice: "INV006",
44+
paymentStatus: "Pending",
45+
totalAmount: "$200.00",
46+
paymentMethod: "Bank Transfer",
47+
},
48+
{
49+
invoice: "INV007",
50+
paymentStatus: "Unpaid",
51+
totalAmount: "$300.00",
52+
paymentMethod: "Credit Card",
53+
},
54+
];
55+
56+
const meta: Meta<typeof Table> = {
57+
title: "components/Table",
58+
component: Table,
59+
args: {
60+
children: (
61+
<>
62+
<TableHeader>
63+
<TableRow>
64+
<TableHead className="w-[100px]">Invoice</TableHead>
65+
<TableHead>Status</TableHead>
66+
<TableHead>Method</TableHead>
67+
<TableHead className="text-right">Amount</TableHead>
68+
</TableRow>
69+
</TableHeader>
70+
<TableBody>
71+
{invoices.map((invoice) => (
72+
<TableRow key={invoice.invoice}>
73+
<TableCell className="font-medium">{invoice.invoice}</TableCell>
74+
<TableCell>{invoice.paymentStatus}</TableCell>
75+
<TableCell>{invoice.paymentMethod}</TableCell>
76+
<TableCell className="text-right">
77+
{invoice.totalAmount}
78+
</TableCell>
79+
</TableRow>
80+
))}
81+
</TableBody>
82+
</>
83+
),
84+
},
85+
};
86+
87+
export default meta;
88+
type Story = StoryObj<typeof Table>;
89+
90+
export const Default: Story = {};

0 commit comments

Comments
 (0)