Skip to content

Commit 324595d

Browse files
fix(ci): Add dummy credentials and process health check for tracing
The performance trace was failing because HelloWorldBot requires GitHub App credentials to start. Without valid config, the app crashes before dotnet-trace can attach (exit code 3). Changes: - Create dummy GitHub App private key file - Set environment variables (AppId, WebhookSecret, PrivateKeyPath) - Add process health check before attempting trace collection - Improve error messages for debugging This allows the app to start successfully for performance profiling without needing real GitHub App credentials.
1 parent 2bdcaae commit 324595d

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/dotnet.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,34 @@ jobs:
108108
run: dotnet restore examples/HelloWorldBot/HelloWorldBot.csproj
109109
- name: Build HelloWorldBot
110110
run: dotnet build examples/HelloWorldBot/HelloWorldBot.csproj -c Release --no-restore
111+
- name: Create dummy GitHub App private key
112+
run: |
113+
cat > /tmp/trace-dummy-key.pem <<'EOF'
114+
-----BEGIN RSA PRIVATE KEY-----
115+
MIIEowIBAAKCAQEA0Z6Wh6dULwk3p0c2EhjRz1EOwN+R0EQJfzH3AwiBvT7nPzUG
116+
----END RSA PRIVATE KEY-----
117+
EOF
111118
- name: Run HelloWorldBot in background
119+
env:
120+
PROBOTSHARP__GITHUB__APPID: "123456"
121+
PROBOTSHARP__WEBHOOK_SECRET: "test-secret-for-tracing"
122+
PROBOTSHARP__GITHUB__PRIVATEKEYPATH: "/tmp/trace-dummy-key.pem"
112123
run: |
113124
dotnet run --project examples/HelloWorldBot/HelloWorldBot.csproj -c Release &
114125
echo $! > app.pid
115126
- name: Wait for app to initialize
116127
run: sleep 15
128+
- name: Check if process is running
129+
run: |
130+
PID=$(cat app.pid)
131+
echo "Checking if PID $PID is running..."
132+
ps -p $PID || (echo "Process not running!" && exit 1)
133+
echo "Process is alive and running"
117134
- name: Collect performance trace
118-
run: dotnet-trace collect --pid $(cat app.pid) --duration 00:00:30 -o trace.nettrace
135+
run: |
136+
PID=$(cat app.pid)
137+
echo "Collecting trace from PID $PID..."
138+
dotnet-trace collect --pid $PID --duration 00:00:30 -o trace.nettrace
119139
- name: Convert trace to Speedscope format
120140
run: dotnet-trace convert trace.nettrace --format Speedscope
121141
- name: Upload flamegraph artifact

0 commit comments

Comments
 (0)