fix(workflows): standardize runner configuration for security jobs
This commit is contained in:
parent
13a42935ae
commit
692d0182f3
2 changed files with 63 additions and 45 deletions
4
.github/workflows/security.yml
vendored
4
.github/workflows/security.yml
vendored
|
|
@ -21,7 +21,7 @@ env:
|
|||
jobs:
|
||||
audit:
|
||||
name: Security Audit
|
||||
runs-on: ${{ github.event_name != 'pull_request' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
|
|
@ -37,7 +37,7 @@ jobs:
|
|||
|
||||
deny:
|
||||
name: License & Supply Chain
|
||||
runs-on: ${{ github.event_name != 'pull_request' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ cargo test telegram --lib
|
|||
The `test_telegram_integration.sh` script runs:
|
||||
|
||||
**Phase 1: Code Quality (5 tests)**
|
||||
|
||||
- ✅ Test compilation
|
||||
- ✅ Unit tests (24 tests)
|
||||
- ✅ Message splitting tests (8 tests)
|
||||
|
|
@ -31,21 +32,25 @@ The `test_telegram_integration.sh` script runs:
|
|||
- ✅ Code formatting
|
||||
|
||||
**Phase 2: Build Tests (3 tests)**
|
||||
|
||||
- ✅ Debug build
|
||||
- ✅ Release build
|
||||
- ✅ Binary size verification (<10MB)
|
||||
|
||||
**Phase 3: Configuration Tests (4 tests)**
|
||||
|
||||
- ✅ Config file exists
|
||||
- ✅ Telegram section configured
|
||||
- ✅ Bot token set
|
||||
- ✅ User allowlist configured
|
||||
|
||||
**Phase 4: Health Check Tests (2 tests)**
|
||||
|
||||
- ✅ Health check timeout (<5s)
|
||||
- ✅ Telegram API connectivity
|
||||
|
||||
**Phase 5: Feature Validation (6 tests)**
|
||||
|
||||
- ✅ Message splitting function
|
||||
- ✅ Message length constant (4096)
|
||||
- ✅ Timeout implementation
|
||||
|
|
@ -58,27 +63,33 @@ The `test_telegram_integration.sh` script runs:
|
|||
After running automated tests, perform these manual checks:
|
||||
|
||||
1. **Basic messaging**
|
||||
|
||||
```bash
|
||||
zeroclaw channel start
|
||||
```
|
||||
|
||||
- Send "Hello bot!" in Telegram
|
||||
- Verify response within 3 seconds
|
||||
|
||||
2. **Long message splitting**
|
||||
|
||||
```bash
|
||||
# Generate 5000+ char message
|
||||
python3 -c 'print("test " * 1000)'
|
||||
```
|
||||
|
||||
- Paste into Telegram
|
||||
- Verify: Message split into chunks
|
||||
- Verify: Markers show `(continues...)` and `(continued)`
|
||||
- Verify: All chunks arrive in order
|
||||
|
||||
3. **Unauthorized user blocking**
|
||||
|
||||
```toml
|
||||
# Edit ~/.zeroclaw/config.toml
|
||||
allowed_users = ["999999999"]
|
||||
```
|
||||
|
||||
- Send message to bot
|
||||
- Verify: Warning in logs
|
||||
- Verify: Message ignored
|
||||
|
|
@ -91,16 +102,20 @@ After running automated tests, perform these manual checks:
|
|||
- Verify: Responses have delays
|
||||
|
||||
5. **Error logging**
|
||||
|
||||
```bash
|
||||
RUST_LOG=debug zeroclaw channel start
|
||||
```
|
||||
|
||||
- Check for unexpected errors
|
||||
- Verify proper error handling
|
||||
|
||||
6. **Health check timeout**
|
||||
|
||||
```bash
|
||||
time zeroclaw channel doctor
|
||||
```
|
||||
|
||||
- Verify: Completes in <5 seconds
|
||||
|
||||
## 🔍 Test Results Interpretation
|
||||
|
|
@ -116,12 +131,14 @@ After running automated tests, perform these manual checks:
|
|||
### Common Issues
|
||||
|
||||
**Issue: Health check times out**
|
||||
|
||||
```
|
||||
Solution: Check bot token is valid
|
||||
curl "https://api.telegram.org/bot<TOKEN>/getMe"
|
||||
```
|
||||
|
||||
**Issue: Bot doesn't respond**
|
||||
|
||||
```
|
||||
Solution: Check user allowlist
|
||||
1. Send message to bot
|
||||
|
|
@ -131,6 +148,7 @@ Solution: Check user allowlist
|
|||
```
|
||||
|
||||
**Issue: Message splitting not working**
|
||||
|
||||
```
|
||||
Solution: Verify code changes
|
||||
grep -n "split_message_for_telegram" src/channels/telegram.rs
|
||||
|
|
@ -201,7 +219,7 @@ zeroclaw status
|
|||
Expected values after all fixes:
|
||||
|
||||
| Metric | Expected | How to Measure |
|
||||
|--------|----------|----------------|
|
||||
| ---------------------- | ---------- | -------------------------------- |
|
||||
| Health check time | <5s | `time zeroclaw channel doctor` |
|
||||
| First response time | <3s | Time from sending to receiving |
|
||||
| Message split overhead | <50ms | Check logs for timing |
|
||||
|
|
@ -264,7 +282,7 @@ on: [push, pull_request]
|
|||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-rs/toolchain@v1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue