Skip to content

Commit 47f3451

Browse files
Merge pull request #4 from phuongdnguyen/vscode-extension
Add Vscode extension
2 parents 1de6c8f + 2ed1f72 commit 47f3451

File tree

93 files changed

+15203
-883
lines changed

Some content is hidden

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

93 files changed

+15203
-883
lines changed

README.md

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,34 @@
44

55
# Introduction
66

7-
A comprehensive debugging solution that enables step-through debugging of [Temporal](https://github.com/temporalio/temporal) workflows. Unlike traditional debuggers that struggle with Temporal's distributed execution model, this debugger provides a seamless development experience by allowing you to set breakpoints, inspect variables, and trace execution flow within your workflow code.
7+
A comprehensive debugging solution that enables step-through debugging of [Temporal](https://github.com/temporalio/temporal) workflows. Unlike traditional debuggers that are not aware of the execution model of Temporal, this debugger provides a seamless development experience by allowing you to set breakpoints, inspect variables, and trace execution flow within your workflow code.
88

9-
## 🚀 Why This Debugger?
9+
## Why?
1010

11-
Debugging Temporal workflows has traditionally been challenging because:
11+
Debugging Temporal workflows has traditionally been challenging. Execution of a workflow is driven by history events rather than direct code execution. Workflow state is managed externally by the Temporal service, the progress of a workflow depends on interaction between Temporal server and a thick SDK that know how to use history event to trigger the actual workflow code execution.
1212

13-
- **Distributed Execution**: Workflows can pause, resume, and retry across multiple processes and machines
14-
- **Complex State Management**: Execution is driven by history events rather than direct code execution. Workflow state is managed externally by the Temporal service, the progress of a workflow depends on interaction between Temporal server and a thick SDK that know how to use history event to trigger the actual workflow code execution.
13+
This debugger solves these challenges by leveraging the **workflow replayer** - it reconstructs workflow execution from Temporal's event history, allowing you to debug exactly what happened during the original execution.
1514

16-
This debugger solves these challenges by implementing **deterministic replay debugging** - it reconstructs workflow execution from Temporal's event history, allowing you to debug exactly what happened during the original execution.
15+
## Key Features
1716

18-
## ✨ Key Features
17+
### **Seamless IDE Integration**
18+
- **Support multiple languages**: Provide the ability to debug in multiple SDK languages (there are Go, TypeScript & Python example provided, support for other languages it's coming when I have the bandwidth to implement it)
19+
- **JetBrains Plugin**: Native integration with Goland via a debugging plugin, use standard IDE debugging controls (breakpoints, step-over, step-into, variable inspection) or set breakpoint in workflow history
1920

20-
### 🎯 **Seamless IDE Integration**
21-
- **JetBrains Plugin**: Native integration with GoLand, IntelliJ IDEA, and other JetBrains IDEs
22-
- **Familiar Debugging Experience**: Use standard IDE debugging controls (breakpoints, step-over, step-into, variable inspection)
23-
- **Tool Window**: Dedicated panel for workflow history visualization and breakpoint management
2421

25-
### 🔍 **Workflow History Debugging**
26-
- **History Upload**: Load Temporal workflow execution history (JSON format)
27-
- **Event Visualization**: Browse through workflow events with timestamps and details
28-
- **Breakpoint Management**: Set breakpoints on specific workflow events or code locations
2922

30-
31-
32-
## 🏛 Architecture Overview
33-
34-
```
35-
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
36-
│ JetBrains │ │ Serving Layer │ │ Debugger Server │
37-
│ IDE Plugin │◄──►│ (tdlv) │◄──►│ + Workflow │
38-
│ │ │ │ │ Replayer │
39-
└─────────────────┘ └──────────────────┘ └─────────────────┘
40-
│ │ │
41-
│ ┌────────▼────────┐ │
42-
│ │ History Server │ │
43-
│ │ (Breakpoints + │ │
44-
└─────────────►│ Events) │◄─────────────┘
45-
└─────────────────┘
46-
```
47-
48-
The debugger consists of several integrated components:
49-
50-
1. **JetBrains Plugin**: Provides the user interface, manages workflow history, and integrates with IDE debugging
51-
2. **Servubg layer (`tdlv`)**: Intercepts debugging commands and enhances them with workflow-specific logic
52-
3. **Workflow Replayer**: Executes workflow code deterministically using Temporal's replayer
53-
4. **History Server**: Manages workflow event history and breakpoint state
54-
5. **Adapter Layer**: Connects the replay execution with the debugging infrastructure
55-
56-
## 👥 Who Is This For?
23+
## Who Is This For?
5724

5825
- **Temporal Workflow Developers**: Anyone building workflows with Temporal's SDK
5926

6027
Whether you're debugging a complex workflow that's failing in production or just want a better development experience while building new workflows, this debugger provides the tools you need to understand and fix your Temporal workflow code efficiently.
6128

6229

63-
# Usage
30+
## Usage
6431
You can run the debugger in:
65-
- Standalone mode: run the debugger with your workflow code and connect your IDE to it. This approach is lower-level and not recommended for end user. Install the debugger
66-
67-
```bash
68-
brew install tdlv
69-
```
32+
- Standalone mode: run the debugger with your workflow code and connect your IDE to it. This approach is lower-level and not recommended for end user. To install the debugger, download it from the [Github Release Page](https://github.com/phuongdnguyen/temporal-workflow-debugger/releases)
7033

71-
- IDE Integrated: install the plugin and debug your workflow via a debugging UI. This approach provides a more complete debugging experience and is the recommended approach.
34+
- IDE Integrated (only available for Go users on Goland): install the plugin and debug your workflow via a debugging UI. This approach provides a more complete debugging experience and is the recommended approach.
7235

7336
Install the plugin from:
7437
- [Jetbrains marketplace](https://plugins.jetbrains.com/search?excludeTags=internal&products=androidstudio&products=aqua&products=clion&products=dataspell&products=dbe&products=fleet&products=go&products=idea&products=idea_ce&products=mps&products=phpstorm&products=pycharm&products=rider&products=ruby&products=rust&products=webstorm&products=writerside&search=Temporal%20workflow%20debugger)
75-
- [Vscode marketplace](https://marketplace.visualstudio.com/search?term=Temporal%20workflow%20debugger&target=VSCode&category=All%20categories&sortBy=Relevance)

custom-debugger/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,13 @@ func startDebugPy(stopCh <-chan struct{}, install bool) {
165165
if install {
166166
// Install debugpy
167167
}
168+
workingDir, err := os.Getwd()
169+
if err != nil {
170+
log.Fatal(fmt.Errorf("error getting working directory: %w", err))
171+
}
168172
ctx := context.Background()
169-
cmd := exec.CommandContext(ctx, "python", "-m", "debugpy", "--listen", "2345", "--wait-for-client", "standalone_replay.py")
170-
cmd.Dir = "example/python" // Set working directory to the Python example
173+
cmd := exec.CommandContext(ctx, "python", "-m", "debugpy", "--listen", "2345", "--wait-for-client", "vscode-replay.py")
174+
cmd.Dir = workingDir // Set working directory to the Python example
171175
cmd.Stdout = os.Stdout
172176
cmd.Stderr = os.Stderr
173177
go func() {

custom-debugger/pkg/locators/locators.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func IsInAdapterCodeByPath(filePath string) bool {
2323
}
2424

2525
// Check for adapter code patterns in the file path
26-
return strings.Contains(filePath, "replayer-adapter/") ||
26+
return strings.Contains(filePath, "replayer-adapter-go/") ||
2727
strings.Contains(filePath, "replayer.go") ||
2828
strings.Contains(filePath, "outbound_interceptor.go") ||
2929
strings.Contains(filePath, "inbound_interceptor.go") ||
@@ -80,7 +80,7 @@ func IsUserCodeFile(filePath, workingDir string) bool {
8080

8181
// File is in working directory, but check if it's adapter/framework code
8282
// Exclude known adapter/framework paths even if they're in working directory
83-
if strings.Contains(filePath, "replayer-adapter/") ||
83+
if strings.Contains(filePath, "replayer-adapter-go") ||
8484
strings.Contains(filePath, "custom-debugger/") ||
8585
strings.Contains(filePath, "replayer-adapter-python/") ||
8686
strings.Contains(filePath, "replayer-adapter-nodejs/") ||

docs/CHANGELOG.md

Lines changed: 1 addition & 202 deletions
Original file line numberDiff line numberDiff line change
@@ -2,207 +2,6 @@
22

33
This document tracks user-facing changes, new features, and important updates to the Temporal Workflow Debugger.
44

5-
For detailed technical changes, see [Developer Changelog](./developer-changelog.md).
5+
## [0.0.1-rc.1] - 2025-08-05
66

7-
## [Unreleased] - 2025-01-15
87

9-
### 🎯 Enhanced
10-
11-
#### Improved Step-Over Experience
12-
**What's New**: Enhanced visual feedback when stepping over code that goes through adapter layers.
13-
14-
**Benefits**:
15-
- **Better Visual Feedback**: When you click "Step Over", the debugger cursor now visibly moves to the next line
16-
- **Intuitive Debugging**: Step-over operations feel more natural and provide clear visual confirmation
17-
- **Seamless Experience**: Auto-stepping through internal code now provides better user feedback
18-
19-
**How It Works**: After automatically stepping through Temporal SDK code, the debugger takes one additional step forward in your workflow code (only for step-over commands) to ensure you can see the debugging action has taken effect.
20-
21-
### 🐛 Fixed
22-
23-
#### More Reliable Command Detection
24-
**What Changed**: Fixed issues where continue vs step-over commands were sometimes misidentified.
25-
26-
**Benefits**:
27-
- **Accurate Behavior**: Continue commands now correctly stop at breakpoint locations without extra stepping
28-
- **Consistent Experience**: Step-over commands consistently provide visual feedback
29-
- **Better Auto-stepping**: Improved detection of user intent for better auto-stepping behavior
30-
31-
#### Enhanced Cross-Platform Support
32-
**What Changed**: Improved JSON-RPC message parsing for better compatibility across different operating systems.
33-
34-
**Benefits**:
35-
- **Windows Compatibility**: Better handling of line endings on Windows systems
36-
- **Robust Communication**: More reliable message parsing between IDE and debugger
37-
- **Fewer Connection Issues**: Reduced parsing errors that could cause debugging sessions to fail
38-
39-
---
40-
41-
## [v0.9.0] - 2024-12-20
42-
43-
### 🚀 New Features
44-
45-
#### VS Code Debug Adapter Protocol (DAP) Support
46-
**What's New**: Full support for debugging in VS Code using the Debug Adapter Protocol.
47-
48-
**Benefits**:
49-
- **VS Code Compatibility**: Native debugging support for VS Code users
50-
- **Multi-IDE Support**: Works with both GoLand/IntelliJ IDEA and VS Code
51-
- **Consistent Experience**: Same debugging features across different IDEs
52-
53-
**Setup**: Add the provided `launch.json` configuration to your VS Code workspace.
54-
55-
#### Smart Stack Trace Filtering
56-
**What's New**: Automatically hides internal Temporal SDK and adapter code from call stacks.
57-
58-
**Benefits**:
59-
- **Clean Call Stacks**: See only your workflow code and relevant runtime frames
60-
- **Reduced Confusion**: No more seeing internal `replayer.go` or SDK files in stack traces
61-
- **Better Focus**: Concentrate on debugging your workflow logic, not internal implementation
62-
63-
#### Automatic Variable Evaluation
64-
**What's New**: Variable inspection works correctly even with filtered stack traces.
65-
66-
**Benefits**:
67-
- **Accurate Variable Values**: Hover over variables to see correct values
68-
- **Working Watch Expressions**: Add variables to watch lists without issues
69-
- **Proper Frame Context**: Variable evaluation uses the correct stack frame context
70-
71-
### 🎯 Enhanced
72-
73-
#### Auto-stepping Through Adapter Code
74-
**What's New**: Debugger automatically steps through internal Temporal code to reach your workflow logic.
75-
76-
**Benefits**:
77-
- **Seamless Debugging**: No manual stepping through internal code
78-
- **Time Saving**: Automatically skips irrelevant code sections
79-
- **Better Focus**: Stops only at your workflow code and important runtime points
80-
81-
#### Multi-Protocol Architecture
82-
**What's New**: Single proxy supports both JSON-RPC (GoLand) and DAP (VS Code) protocols.
83-
84-
**Benefits**:
85-
- **Unified Experience**: Same features regardless of IDE choice
86-
- **Easy Switching**: Use different IDEs for the same project without reconfiguration
87-
- **Future-Proof**: Easy to add support for additional IDEs and protocols
88-
89-
---
90-
91-
## [v0.8.0] - 2024-11-15
92-
93-
### 🚀 New Features
94-
95-
#### JetBrains Plugin
96-
**What's New**: Enhanced IDE integration for GoLand and IntelliJ IDEA users.
97-
98-
**Benefits**:
99-
- **Simplified Setup**: Automatic configuration of debug settings
100-
- **Temporal Actions**: IDE actions specific to workflow debugging
101-
- **Enhanced UI**: Better integration with JetBrains IDE features
102-
103-
**Installation**: Build and install the plugin from the `jetbrains-plugin` directory.
104-
105-
#### Transparent Debugging Proxy
106-
**What's New**: Intelligent proxy that sits between your IDE and the Delve debugger.
107-
108-
**Benefits**:
109-
- **Non-Invasive**: Works with unmodified Delve and IDEs
110-
- **Protocol Transparency**: No changes needed to existing debugging workflows
111-
- **Full Compatibility**: Supports all standard debugging operations
112-
113-
### 🎯 Enhanced
114-
115-
#### Improved Connection Stability
116-
**What's New**: More robust handling of debugging connections and protocol communication.
117-
118-
**Benefits**:
119-
- **Fewer Disconnections**: More stable debugging sessions
120-
- **Better Error Recovery**: Graceful handling of connection issues
121-
- **Reliable Communication**: Improved message parsing and protocol handling
122-
123-
#### Frame Context Preservation
124-
**What's New**: Maintains accurate frame numbering for variable evaluation with filtered stacks.
125-
126-
**Benefits**:
127-
- **Working Variable Inspection**: Hover and watch expressions work correctly
128-
- **Accurate Debugging**: Stack frame operations use correct context
129-
- **Seamless Experience**: No difference from normal Go debugging
130-
131-
---
132-
133-
## [v0.7.0] - 2024-10-01
134-
135-
### 🚀 New Features
136-
137-
#### Initial Release
138-
**What's New**: First public release of the Temporal Workflow Debugger.
139-
140-
**Features**:
141-
- **Workflow Debugging**: Set breakpoints and step through Temporal workflow code
142-
- **GoLand Support**: Native integration with GoLand and IntelliJ IDEA
143-
- **Stack Filtering**: Hide internal adapter implementation details
144-
- **Variable Inspection**: Examine workflow variables and context
145-
146-
## 🔄 Upgrade Guide
147-
148-
### From v0.8.x to v0.9.x
149-
150-
**VS Code Users**:
151-
1. Add the new `launch.json` configuration for DAP support
152-
2. Install the Go extension if not already installed
153-
3. Use F5 to start debugging sessions
154-
155-
**GoLand Users**:
156-
- No changes required, existing configurations continue to work
157-
- Optionally install the updated JetBrains plugin for enhanced features
158-
159-
**Breaking Changes**: None
160-
161-
### From v0.7.x to v0.8.x
162-
163-
**All Users**:
164-
1. Update to the latest version: `git pull origin main`
165-
2. Rebuild the delve wrapper: `cd custom-debugger && go build`
166-
3. Restart your debugging sessions
167-
168-
**JetBrains Plugin Users**:
169-
1. Build and install the new plugin: `cd jetbrains-plugin && ./gradlew buildPlugin`
170-
2. Install from `build/distributions/` through IDE plugin manager
171-
172-
**Breaking Changes**: None
173-
174-
## 🐛 Known Issues
175-
176-
### Current Limitations
177-
178-
- **Single Workflow Focus**: Currently optimized for single workflow debugging
179-
- **Path Dependencies**: Stack filtering assumes workflow code is in `my-wf/` directory
180-
- **Protocol Overhead**: Small performance impact due to proxy layer
181-
182-
### Workarounds
183-
184-
- **Custom Workflow Paths**: Modify filtering rules in delve wrapper for different project structures
185-
- **Performance Optimization**: Disable verbose logging for better performance in production debugging
186-
187-
## 🔮 Planned Features
188-
189-
### Upcoming Releases
190-
191-
- **Multi-Workflow Support**: Debug multiple workflows simultaneously
192-
- **Custom Filtering Rules**: User-configurable stack filtering patterns
193-
- **History Integration**: Debug workflow replays with full history context
194-
- **Enhanced Visualization**: Real-time workflow state visualization
195-
- **Cloud Integration**: Integration with Temporal Cloud debugging tools
196-
197-
### Community Requests
198-
199-
- **Docker Support**: Enhanced debugging in containerized environments
200-
- **Language Extensions**: Support for other Temporal SDK languages
201-
- **Testing Integration**: Integration with workflow testing frameworks
202-
203-
## 📞 Support
204-
205-
- **Bug Reports**: [GitHub Issues](https://github.com/temporalio/temporal-goland-plugin/issues)
206-
- **Feature Requests**: [GitHub Discussions](https://github.com/temporalio/temporal-goland-plugin/discussions)
207-
- **Documentation**: [User Guide](./user-guide.md)
208-
- **Community**: [Temporal Community](https://community.temporal.io/)

docs/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Temporal GoLand Plugin
1+
# Temporal Workflow Debugger
22

3-
This plugin enables debugging of Temporal workflows in GoLand.
3+
This plugin enables debugging of Temporal workflows.
44

55
## Documentation
66

@@ -9,7 +9,6 @@ This plugin enables debugging of Temporal workflows in GoLand.
99
- [Developer Guide](./developer-guide.md): For contributors.
1010
- [Troubleshooting](./troubleshooting.md): Common issues.
1111
- [CHANGELOG.md](./CHANGELOG.md): Release notes.
12-
- [Developer Changelog](./developer-changelog.md): Internal changes.
1312

1413
## Quick Start
1514

0 commit comments

Comments
 (0)