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

Commit56e1c14

Browse files
authored
Merge branch 'main' into tag-coder-users-dx
2 parents23b4eeb +b0d23ca commit56e1c14

File tree

822 files changed

+31093
-11849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

822 files changed

+31093
-11849
lines changed

‎.cursorrules

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ This project is called "Coder" - an application for managing remote development
44

55
Coder provides a platform for creating, managing, and using remote development environments (also known as Cloud Development Environments or CDEs). It leverages Terraform to define and provision these environments, which are referred to as "workspaces" within the project. The system is designed to be extensible, secure, and provide developers with a seamless remote development experience.
66

7-
# Core Architecture
7+
## Core Architecture
88

99
The heart of Coder is a control plane that orchestrates the creation and management of workspaces. This control plane interacts with separate Provisioner processes over gRPC to handle workspace builds. The Provisioners consume workspace definitions and use Terraform to create the actual infrastructure.
1010

1111
The CLI package serves dual purposes - it can be used to launch the control plane itself and also provides client functionality for users to interact with an existing control plane instance. All user-facing frontend code is developed in TypeScript using React and lives in the `site/` directory.
1212

1313
The database layer uses PostgreSQL with SQLC for generating type-safe database code. Database migrations are carefully managed to ensure both forward and backward compatibility through paired `.up.sql` and `.down.sql` files.
1414

15-
# API Design
15+
## API Design
1616

1717
Coder's API architecture combines REST and gRPC approaches. The REST API is defined in `coderd/coderd.go` and uses Chi for HTTP routing. This provides the primary interface for the frontend and external integrations.
1818

1919
Internal communication with Provisioners occurs over gRPC, with service definitions maintained in `.proto` files. This separation allows for efficient binary communication with the components responsible for infrastructure management while providing a standard REST interface for human-facing applications.
2020

21-
# Network Architecture
21+
## Network Architecture
2222

2323
Coder implements a secure networking layer based on Tailscale's Wireguard implementation. The `tailnet` package provides connectivity between workspace agents and clients through DERP (Designated Encrypted Relay for Packets) servers when direct connections aren't possible. This creates a secure overlay network allowing access to workspaces regardless of network topology, firewalls, or NAT configurations.
2424

25-
## Tailnet and DERP System
25+
### Tailnet and DERP System
2626

2727
The networking system has three key components:
2828

@@ -35,7 +35,7 @@ The networking system has three key components:
3535

3636
3. **Direct Connections**: When possible, the system establishes peer-to-peer connections between clients and workspaces using STUN for NAT traversal. This requires both endpoints to send UDP traffic on ephemeral ports.
3737

38-
## Workspace Proxies
38+
### Workspace Proxies
3939

4040
Workspace proxies (in the Enterprise edition) provide regional relay points for browser-based connections, reducing latency for geo-distributed teams. Key characteristics:
4141

@@ -45,9 +45,10 @@ Workspace proxies (in the Enterprise edition) provide regional relay points for
4545
- Managed through the `coder wsproxy` commands
4646
- Implemented primarily in the `enterprise/wsproxy/` package
4747

48-
# Agent System
48+
## Agent System
4949

5050
The workspace agent runs within each provisioned workspace and provides core functionality including:
51+
5152
- SSH access to workspaces via the `agentssh` package
5253
- Port forwarding
5354
- Terminal connectivity via the `pty` package for pseudo-terminal support
@@ -57,7 +58,7 @@ The workspace agent runs within each provisioned workspace and provides core fun
5758

5859
Agents communicate with the control plane using the tailnet system and authenticate using secure tokens.
5960

60-
# Workspace Applications
61+
## Workspace Applications
6162

6263
Workspace applications (or "apps") provide browser-based access to services running within workspaces. The system supports:
6364

@@ -69,17 +70,17 @@ Workspace applications (or "apps") provide browser-based access to services runn
6970

7071
The implementation is primarily in the `coderd/workspaceapps/` directory with components for URL generation, proxying connections, and managing application state.
7172

72-
# Implementation Details
73+
## Implementation Details
7374

7475
The project structure separates frontend and backend concerns. React components and pages are organized in the `site/src/` directory, with Jest used for testing. The backend is primarily written in Go, with a strong emphasis on error handling patterns and test coverage.
7576

7677
Database interactions are carefully managed through migrations in `coderd/database/migrations/` and queries in `coderd/database/queries/`. All new queries require proper database authorization (dbauthz) implementation to ensure that only users with appropriate permissions can access specific resources.
7778

78-
# Authorization System
79+
## Authorization System
7980

8081
The database authorization (dbauthz) system enforces fine-grained access control across all database operations. It uses role-based access control (RBAC) to validate user permissions before executing database operations. The `dbauthz` package wraps the database store and performs authorization checks before returning data. All database operations must pass through this layer to ensure security.
8182

82-
# Testing Framework
83+
## Testing Framework
8384

8485
The codebase has a comprehensive testing approach with several key components:
8586

@@ -91,7 +92,7 @@ The codebase has a comprehensive testing approach with several key components:
9192

9293
4. **Enterprise Testing**: Enterprise features have dedicated test utilities in the `coderdenttest` package.
9394

94-
# Open Source and Enterprise Components
95+
## Open Source and Enterprise Components
9596

9697
The repository contains both open source and enterprise components:
9798

@@ -100,9 +101,10 @@ The repository contains both open source and enterprise components:
100101
- The boundary between open source and enterprise is managed through a licensing system
101102
- The same core codebase supports both editions, with enterprise features conditionally enabled
102103

103-
# Development Philosophy
104+
## Development Philosophy
104105

105106
Coder emphasizes clear error handling, with specific patterns required:
107+
106108
- Concise error messages that avoid phrases like "failed to"
107109
- Wrapping errors with `%w` to maintain error chains
108110
- Using sentinel errors with the "err" prefix (e.g., `errNotFound`)
@@ -111,7 +113,7 @@ All tests should run in parallel using `t.Parallel()` to ensure efficient testin
111113

112114
Git contributions follow a standard format with commit messages structured as `type: <message>`, where type is one of `feat`, `fix`, or `chore`.
113115

114-
# Development Workflow
116+
## Development Workflow
115117

116118
Development can be initiated using `scripts/develop.sh` to start the application after making changes. Database schema updates should be performed through the migration system using `create_migration.sh <name>` to generate migration files, with each `.up.sql` migration paired with a corresponding `.down.sql` that properly reverts all changes.
117119

‎.github/ISSUE_TEMPLATE/1-bug.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: "🐞 Bug"
22
description:"File a bug report."
33
title:"bug:"
44
labels:["needs-triage"]
5+
type:"Bug"
56
body:
67
-type:checkboxes
78
id:existing_issues
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name:"Setup Go Paths"
2+
description:Overrides Go paths like GOCACHE and GOMODCACHE to use temporary directories.
3+
outputs:
4+
gocache:
5+
description:"Value of GOCACHE"
6+
value:${{ steps.paths.outputs.gocache }}
7+
gomodcache:
8+
description:"Value of GOMODCACHE"
9+
value:${{ steps.paths.outputs.gomodcache }}
10+
gopath:
11+
description:"Value of GOPATH"
12+
value:${{ steps.paths.outputs.gopath }}
13+
gotmp:
14+
description:"Value of GOTMPDIR"
15+
value:${{ steps.paths.outputs.gotmp }}
16+
cached-dirs:
17+
description:"Go directories that should be cached between CI runs"
18+
value:${{ steps.paths.outputs.cached-dirs }}
19+
runs:
20+
using:"composite"
21+
steps:
22+
-name:Override Go paths
23+
id:paths
24+
uses:actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea# v7
25+
with:
26+
script:|
27+
const path = require('path');
28+
29+
// RUNNER_TEMP should be backed by a RAM disk on Windows if
30+
// coder/setup-ramdisk-action was used
31+
const runnerTemp = process.env.RUNNER_TEMP;
32+
const gocacheDir = path.join(runnerTemp, 'go-cache');
33+
const gomodcacheDir = path.join(runnerTemp, 'go-mod-cache');
34+
const gopathDir = path.join(runnerTemp, 'go-path');
35+
const gotmpDir = path.join(runnerTemp, 'go-tmp');
36+
37+
core.exportVariable('GOCACHE', gocacheDir);
38+
core.exportVariable('GOMODCACHE', gomodcacheDir);
39+
core.exportVariable('GOPATH', gopathDir);
40+
core.exportVariable('GOTMPDIR', gotmpDir);
41+
42+
core.setOutput('gocache', gocacheDir);
43+
core.setOutput('gomodcache', gomodcacheDir);
44+
core.setOutput('gopath', gopathDir);
45+
core.setOutput('gotmp', gotmpDir);
46+
47+
const cachedDirs = `${gocacheDir}\n${gomodcacheDir}`;
48+
core.setOutput('cached-dirs', cachedDirs);
49+
50+
-name:Create directories
51+
shell:bash
52+
run:|
53+
set -e
54+
mkdir -p "$GOCACHE"
55+
mkdir -p "$GOMODCACHE"
56+
mkdir -p "$GOPATH"
57+
mkdir -p "$GOTMPDIR"

‎.github/actions/setup-go/action.yaml

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,25 @@ inputs:
88
use-preinstalled-go:
99
description:"Whether to use preinstalled Go."
1010
default:"false"
11-
use-temp-cache-dirs:
12-
description:"Whether to usetemporary GOCACHE and GOMODCACHE directories."
13-
default:"false"
11+
use-cache:
12+
description:"Whether to usethe cache."
13+
default:"true"
1414
runs:
1515
using:"composite"
1616
steps:
17-
-name:Override GOCACHE and GOMODCACHE
18-
shell:bash
19-
if:inputs.use-temp-cache-dirs == 'true'
20-
run:|
21-
# cd to another directory to ensure we're not inside a Go project.
22-
# That'd trigger Go to download the toolchain for that project.
23-
cd "$RUNNER_TEMP"
24-
# RUNNER_TEMP should be backed by a RAM disk on Windows if
25-
# coder/setup-ramdisk-action was used
26-
export GOCACHE_DIR="$RUNNER_TEMP""\go-cache"
27-
export GOMODCACHE_DIR="$RUNNER_TEMP""\go-mod-cache"
28-
export GOPATH_DIR="$RUNNER_TEMP""\go-path"
29-
export GOTMP_DIR="$RUNNER_TEMP""\go-tmp"
30-
mkdir -p "$GOCACHE_DIR"
31-
mkdir -p "$GOMODCACHE_DIR"
32-
mkdir -p "$GOPATH_DIR"
33-
mkdir -p "$GOTMP_DIR"
34-
go env -w GOCACHE="$GOCACHE_DIR"
35-
go env -w GOMODCACHE="$GOMODCACHE_DIR"
36-
go env -w GOPATH="$GOPATH_DIR"
37-
go env -w GOTMPDIR="$GOTMP_DIR"
3817
-name:Setup Go
3918
uses:actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32# v5.0.2
4019
with:
4120
go-version:${{ inputs.use-preinstalled-go == 'false' && inputs.version || '' }}
21+
cache:${{ inputs.use-cache }}
4222

4323
-name:Install gotestsum
4424
shell:bash
45-
run:go install gotest.tools/gotestsum@3f7ff0ec4aeb6f95f5d67c998b71f272aa8a8b41# v1.12.1
25+
run:go install gotest.tools/gotestsum@0d9599e513d70e5792bb9334869f82f6e8b53d4d# main as of 2025-05-15
26+
27+
-name:Install mtimehash
28+
shell:bash
29+
run:go install github.com/slsyy/mtimehash/cmd/mtimehash@a6b5da4ed2c4a40e7b805534b004e9fde7b53ce0# v1.0.0
4630

4731
# It isn't necessary that we ever do this, but it helps
4832
# separate the "setup" from the "run" times.

‎.github/actions/setup-imdisk/action.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎.github/dependabot.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,21 @@ updates:
104104
update-types:
105105
-version-update:semver-major
106106
open-pull-requests-limit:15
107+
108+
-package-ecosystem:"terraform"
109+
directories:
110+
-"dogfood/*/"
111+
-"examples/templates/*/"
112+
schedule:
113+
interval:"weekly"
114+
commit-message:
115+
prefix:"chore"
116+
groups:
117+
coder:
118+
patterns:
119+
-"registry.coder.com/coder/*/coder"
120+
labels:[]
121+
ignore:
122+
-dependency-name:"*"
123+
update-types:
124+
-version-update:semver-major

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp