You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: memory-bank/.clinerules
+46-10
Original file line number
Diff line number
Diff line change
@@ -26,19 +26,35 @@ This file captures important patterns, preferences, and project intelligence tha
26
26
27
27
## Development Workflow
28
28
29
-
- **Build System**: Use Leeway for building components
30
-
- `leeway build` to build specific components
31
-
- `leeway exec` to run commands across components
29
+
- **Build Approaches**:
30
+
- **In-tree builds** (primary for local development):
31
+
- TypeScript components: Use `yarn` commands defined in package.json
32
+
- `yarn build`: Compile the component
33
+
- `yarn test`: Run tests
34
+
- `yarn lint`: Check code style
35
+
- `yarn watch`: Watch for changes and rebuild
36
+
- Go components: Use standard Go tools
37
+
- `go build ./...`: Build all packages
38
+
- `go test ./...`: Test all packages
39
+
- `go run main.go`: Build and run
40
+
41
+
- **Out-of-tree builds** (Leeway, primary for CI):
42
+
- `leeway build components/component-name:app`: Build a specific component
43
+
- `leeway build -D components/component-name:app`: Build with dependencies
44
+
- `leeway exec --package components/component-name:app -- command`: Run a command for a package
32
45
33
46
- **Testing**:
34
47
- Unit tests alongside code
35
48
- Integration tests in separate directories
36
49
- End-to-end tests in the `test/` directory
50
+
- Component-specific test commands in package.json (for TypeScript)
51
+
- Go tests use standard `go test` command
37
52
38
53
- **Local Development**:
39
54
- Use Gitpod workspaces for development (dogfooding)
40
55
- Components can be run individually for testing
41
56
- Preview environments for testing changes
57
+
- Use in-tree builds for rapid iteration during development
42
58
43
59
## Critical Implementation Paths
44
60
@@ -76,9 +92,12 @@ This file captures important patterns, preferences, and project intelligence tha
76
92
- **Memory Bank Documentation**:
77
93
- Component-specific documentation is stored in `memory-bank/components/` directory
78
94
- Each component gets its own markdown file with detailed information about its purpose, architecture, and implementation
79
-
- API components (with "*-api" suffix) should NOT be documented separately as they are typically just interface definitions
80
-
- Component documentation should focus on the main service components that implement business logic
95
+
- Component documentation should focus on both service components that implement business logic and API components that define interfaces
81
96
- Documentation follows a consistent structure with sections for Overview, Purpose, Architecture, Key Features, etc.
97
+
- API component documentation should include a "Code Generation and Building" section that explains:
98
+
- How to regenerate code from protobuf definitions
99
+
- The implementation details of the generation process
100
+
- How to build components that depend on the API after regeneration
82
101
83
102
## Evolution of Project Decisions
84
103
@@ -92,16 +111,33 @@ This section will be updated as I learn about how and why certain architectural
92
111
3. Make it easier to find information about specific components
93
112
4. Enable incremental updates to component documentation without affecting other files
94
113
95
-
- **API Component Exclusion**: The decision to exclude "*-api" components from separate documentation was made because:
96
-
1. API components primarily contain interface definitions, not implementation logic
97
-
2. The interfaces are typically documented within the main service component that implements them
98
-
3. Documenting API components separately would create redundancy
99
-
4. The focus should be on documenting the service components that implement business logic
114
+
- **API Component Documentation**: The decision to include "*-api" components in separate documentation was made because:
115
+
1. API components define critical interfaces between services
116
+
2. Understanding these interfaces is essential for developers working across components
117
+
3. API documentation helps clarify system boundaries and communication patterns
118
+
4. Separate documentation makes it easier to track API changes and versioning
100
119
101
120
## User Preferences
102
121
103
122
This section will be updated as I learn about specific user preferences for working with the codebase.
104
123
124
+
## Build and Test Information
125
+
126
+
When working with components, I should always document:
127
+
128
+
- **Build Commands**: Document any new or component-specific build commands I encounter
129
+
- **Test Commands**: Document how to run tests for each component
130
+
- **Dependencies**: Note any special dependencies required for building or testing
131
+
- **Common Issues**: Document common build or test issues and their solutions
132
+
- **Performance Considerations**: Note any performance considerations for builds
133
+
134
+
Whenever I encounter new build patterns or commands, I should update:
135
+
1. The relevant component documentation in `memory-bank/components/`
136
+
2. The `.clinerules` file with general patterns
137
+
3. The `techContext.md` file if it represents a significant pattern
138
+
139
+
This information is critical for effective development work, as being able to build and test components is fundamental to making changes and verifying their correctness.
140
+
105
141
---
106
142
107
143
Note: This file will be continuously updated as I work with the Gitpod codebase and discover new patterns, preferences, and insights.
The Content Service API defines the gRPC interfaces for the Content Service, which is responsible for managing various types of content within the Gitpod platform, including workspace files, blobs, logs, and IDE plugins.
5
+
6
+
## Purpose
7
+
This API provides a standardized interface for other components to interact with the Content Service, enabling operations such as:
The Content Service API is implemented as a set of gRPC services defined in Protocol Buffer files. These definitions are used to generate client and server code in various languages (Go, TypeScript) for use by other components in the system.
16
+
17
+
## Key Services
18
+
19
+
### ContentService
20
+
Provides core content management functionality:
21
+
-`DeleteUserContent`: Deletes all content associated with a user
22
+
23
+
### WorkspaceService
24
+
Manages workspace content:
25
+
-`WorkspaceDownloadURL`: Provides a URL from which workspace content can be downloaded
26
+
-`DeleteWorkspace`: Deletes the content of a single workspace
27
+
-`WorkspaceSnapshotExists`: Checks whether a workspace snapshot exists
28
+
29
+
### BlobService
30
+
Handles blob storage operations:
31
+
-`UploadUrl`: Provides a URL to which clients can upload content via HTTP PUT
32
+
-`DownloadUrl`: Provides a URL from which clients can download content via HTTP GET
33
+
-`Delete`: Deletes uploaded content
34
+
35
+
### HeadlessLogService
36
+
Manages access to headless logs:
37
+
-`LogDownloadURL`: Provides a URL from which logs can be downloaded
38
+
-`ListLogs`: Returns a list of task IDs for a specified workspace instance
39
+
40
+
### IDEPluginService
41
+
Manages IDE plugins:
42
+
-`UploadURL`: Provides a URL for uploading plugin content
43
+
-`DownloadURL`: Provides a URL for downloading plugin content
44
+
-`PluginHash`: Provides a hash of a plugin
45
+
46
+
## Key Data Structures
47
+
48
+
### WorkspaceInitializer
49
+
Defines how a workspace is initialized, with several initialization methods:
50
+
-`EmptyInitializer`: Creates an empty workspace
51
+
-`GitInitializer`: Initializes from a Git repository
52
+
-`SnapshotInitializer`: Initializes from a snapshot
53
+
-`PrebuildInitializer`: Combines snapshots with Git
54
+
-`CompositeInitializer`: Uses multiple initializers in sequence
55
+
-`FileDownloadInitializer`: Downloads files for workspace content
56
+
-`FromBackupInitializer`: Initializes from a backup
57
+
58
+
### GitStatus
59
+
Describes the current Git working copy status, similar to a combination of "git status" and "git branch".
60
+
61
+
## Communication Patterns
62
+
- The API uses gRPC for efficient, typed communication between services
63
+
- Many operations return URLs rather than content directly, allowing for efficient transfer of large files
64
+
- Authentication information is passed in request messages
65
+
66
+
## Dependencies
67
+
- Used by various components that need to interact with workspace content
68
+
- Depends on underlying storage systems (not specified in the API)
69
+
70
+
## Usage Examples
71
+
- Workspace Manager uses this API to initialize workspaces
72
+
- Dashboard uses this API to provide download links for workspace content
73
+
- IDE components use this API to access plugins
74
+
75
+
## Version Compatibility
76
+
The API uses Protocol Buffers version 3 (proto3) syntax, which provides forward and backward compatibility features.
77
+
78
+
## Code Generation and Building
79
+
80
+
### Regenerating Code from Protobuf Definitions
81
+
The Content Service API uses Protocol Buffers and gRPC for defining interfaces. When changes are made to the `.proto` files, the corresponding code in various languages needs to be regenerated.
- Generates Go code using `protoc-gen-go` and `protoc-gen-go-grpc`
98
+
- Generates TypeScript code
99
+
- Updates license headers
100
+
101
+
### Implementation Details
102
+
The `generate.sh` script uses functions from the shared script at `scripts/protoc-generator.sh`, which provides common functionality for all API components:
0 commit comments