Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
PROBOTSHARP_GITHUB_APPID=123456

# Webhook secret for validating webhook payloads
PROBOTSHARP_GITHUB_WEBHOOKSECRET=your-webhook-secret-here
PROBOTSHARP_WEBHOOK_SECRET=your-webhook-secret-here

# GitHub App Private Key - use one of these methods:
# Option 1: Path to private key file (mounted as volume in docker-compose.yml)
Expand Down
67 changes: 66 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,75 @@ jobs:
retention-days: 7
if-no-files-found: ignore

performance-trace:
name: Performance Trace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dotnet-trace
run: dotnet tool install --global dotnet-trace
- name: Restore Dependencies
run: dotnet restore ProbotSharp.sln
- name: Restore HelloWorldBot
run: dotnet restore examples/HelloWorldBot/HelloWorldBot.csproj
- name: Build HelloWorldBot
run: dotnet build examples/HelloWorldBot/HelloWorldBot.csproj -c Release --no-restore
- name: Create dummy GitHub App private key
run: |
cat > /tmp/trace-dummy-key.pem <<'EOF'
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA0Z6Wh6dULwk3p0c2EhjRz1EOwN+R0EQJfzH3AwiBvT7nPzUG
----END RSA PRIVATE KEY-----
EOF
- name: Run HelloWorldBot in background
env:
PROBOTSHARP__GITHUB__APPID: "123456"
PROBOTSHARP__WEBHOOK_SECRET: "test-secret-for-tracing"
PROBOTSHARP__GITHUB__PRIVATEKEYPATH: "/tmp/trace-dummy-key.pem"
TMPDIR: /tmp
DOTNET_DiagnosticPorts: ""
run: |
dotnet run --project examples/HelloWorldBot/HelloWorldBot.csproj -c Release > /tmp/app.log 2>&1 &
echo $! > app.pid
echo "Started HelloWorldBot with PID $(cat app.pid)"
- name: Wait for app to initialize
run: sleep 15
- name: Check if process is running
run: |
PID=$(cat app.pid)
echo "Checking if PID $PID is running..."
ps -p $PID || (echo "Process not running!" && cat /tmp/app.log && exit 1)
echo "Process is alive and running"
echo "--- Checking dotnet-trace can see the process ---"
dotnet-trace ps || true
echo "--- Listing diagnostic sockets in /tmp ---"
ls -la /tmp/dotnet-diagnostic-* || echo "No diagnostic sockets found"
echo "--- App output so far ---"
cat /tmp/app.log
- name: Collect performance trace
env:
TMPDIR: /tmp
run: |
echo "Collecting trace from HelloWorldBot process..."
echo "TMPDIR is set to: $TMPDIR"
dotnet-trace collect --name HelloWorldBot --providers Microsoft-Windows-DotNETRuntime --duration 00:00:30 -o trace.nettrace || (echo "Trace collection failed!" && exit 1)
- name: Convert trace to Speedscope format
run: dotnet-trace convert trace.nettrace --format Speedscope
- name: Upload flamegraph artifact
uses: actions/upload-artifact@v4
with:
name: flamegraph
path: trace.speedscope.json
retention-days: 7

all-tests-passed:
name: All Tests Passed
runs-on: ubuntu-latest
needs: [build-test, verify-links, verify-markdown-code, test-examples]
needs: [build-test, verify-links, verify-markdown-code, test-examples, performance-trace]
steps:
- run: echo "✅ All tests passed successfully!"

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
- ASPNETCORE_URLS=http://+:8080
- ConnectionStrings__ProbotSharp=Host=postgres;Port=5432;Database=${POSTGRES_DB:-probotsharp};Username=${POSTGRES_USER:-probotsharp};Password=${POSTGRES_PASSWORD:-dev-password}
- ProbotSharp__GitHub__AppId=${PROBOTSHARP_GITHUB_APPID}
- ProbotSharp__GitHub__WebhookSecret=${PROBOTSHARP_GITHUB_WEBHOOKSECRET:-development}
- ProbotSharp__GitHub__WebhookSecret=${PROBOTSHARP_WEBHOOK_SECRET:-development}
- ProbotSharp__GitHub__PrivateKey=${PROBOTSHARP_GITHUB_PRIVATEKEY}
- ProbotSharp__GitHub__ClientId=${PROBOTSHARP_GITHUB_CLIENTID:-}
- ProbotSharp__GitHub__ClientSecret=${PROBOTSHARP_GITHUB_CLIENTSECRET:-}
Expand Down
4 changes: 2 additions & 2 deletions docs/Operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ curl -i https://api.github.com/app \
**Resolution:**
```bash
# Verify webhook secret is set
echo $PROBOTSHARP_GITHUB_WEBHOOKSECRET
echo $PROBOTSHARP_WEBHOOK_SECRET

# Test webhook locally with smee.io
docker-compose --profile smee up
Expand Down Expand Up @@ -998,7 +998,7 @@ cp .env.example .env

# Edit .env with your GitHub App credentials
# - PROBOTSHARP_GITHUB_APPID
# - PROBOTSHARP_GITHUB_WEBHOOKSECRET
# - PROBOTSHARP_WEBHOOK_SECRET
# - PROBOTSHARP_GITHUB_PRIVATEKEY (or mount private-key.pem)

# Start all services
Expand Down
2 changes: 1 addition & 1 deletion examples/TemplateTestBot/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PROBOTSHARP_GITHUB_APPID=123456

# Your GitHub App's webhook secret
# This is used to verify that webhook payloads are from GitHub
PROBOTSHARP_GITHUB_WEBHOOKSECRET=your-webhook-secret-here
PROBOTSHARP_WEBHOOK_SECRET=your-webhook-secret-here

# GitHub App Private Key
# Option 1: Path to private key file (recommended for local development)
Expand Down
4 changes: 2 additions & 2 deletions examples/TemplateTestBot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A GitHub App built with [ProbotSharp](https://github.com/your-repo/probot-sharp)

Edit `.env` and set:
- `PROBOTSHARP_GITHUB_APPID` - Your GitHub App ID
- `PROBOTSHARP_GITHUB_WEBHOOKSECRET` - Your webhook secret
- `PROBOTSHARP_WEBHOOK_SECRET` - Your webhook secret
- `PROBOTSHARP_GITHUB_PRIVATEKEY` - Path to your private key file or base64-encoded key

2. **Run the bot**
Expand Down Expand Up @@ -159,7 +159,7 @@ All configuration is done through environment variables (or `.env` file). See `.
### Required Configuration

- `PROBOTSHARP_GITHUB_APPID` - Your GitHub App ID
- `PROBOTSHARP_GITHUB_WEBHOOKSECRET` - Webhook secret for signature verification
- `PROBOTSHARP_WEBHOOK_SECRET` - Webhook secret for signature verification
- `PROBOTSHARP_GITHUB_PRIVATEKEY` - Private key (file path or base64-encoded)

### Optional Configuration
Expand Down
2 changes: 1 addition & 1 deletion templates/probotsharp-app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PROBOTSHARP_GITHUB_APPID=GITHUB_APP_ID

# Your GitHub App's webhook secret
# This is used to verify that webhook payloads are from GitHub
PROBOTSHARP_GITHUB_WEBHOOKSECRET=your-webhook-secret-here
PROBOTSHARP_WEBHOOK_SECRET=your-webhook-secret-here

# GitHub App Private Key
# Option 1: Path to private key file (recommended for local development)
Expand Down
4 changes: 2 additions & 2 deletions templates/probotsharp-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A GitHub App built with [Probot Sharp](https://github.com/your-repo/probot-sharp

Edit `.env` and set:
- `PROBOTSHARP_GITHUB_APPID` - Your GitHub App ID
- `PROBOTSHARP_GITHUB_WEBHOOKSECRET` - Your webhook secret
- `PROBOTSHARP_WEBHOOK_SECRET` - Your webhook secret
- `PROBOTSHARP_GITHUB_PRIVATEKEY` - Path to your private key file or base64-encoded key

2. **Run the bot**
Expand Down Expand Up @@ -176,7 +176,7 @@ All configuration is done through environment variables (or `.env` file). See `.
### Required Configuration

- `PROBOTSHARP_GITHUB_APPID` - Your GitHub App ID
- `PROBOTSHARP_GITHUB_WEBHOOKSECRET` - Webhook secret for signature verification
- `PROBOTSHARP_WEBHOOK_SECRET` - Webhook secret for signature verification
- `PROBOTSHARP_GITHUB_PRIVATEKEY` - Private key (file path or base64-encoded)

### Optional Configuration
Expand Down
Loading