Skip to content
Draft
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
28 changes: 0 additions & 28 deletions .claude/ldk-resources/template.rockspec

This file was deleted.

61 changes: 61 additions & 0 deletions .claude/memories/never-use-store-endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# NEVER USE STORE ENDPOINT - ONLY ENVELOPES

## CRITICAL RULE

**NEVER USE THE /store ENDPOINT IN SENTRY LUA SDK**
**ONLY USE ENVELOPES VIA THE /envelope ENDPOINT**

## Why This Rule Exists

1. **Logs require envelopes to work** - Sentry's logging functionality only works with envelope transport
2. **Modern Sentry protocol** - The /store endpoint is legacy, envelopes are the modern approach
3. **Feature completeness** - All Sentry features (errors, logs, traces, performance) work through envelopes
4. **No fallbacks** - Never implement fallback to /store endpoint

## Implementation Requirements

### DSN Utils (src/sentry/utils/dsn.tl)
- ✅ ONLY `build_envelope_url()` function
- ❌ NO `build_ingest_url()` function
- ✅ All URLs point to `/api/{project_id}/envelope/`

### Transport Layer (src/sentry/platforms/*/transport.tl)
- ✅ ONLY `send_envelope()` method
- ❌ NO `send()` method for events
- ✅ ONLY `envelope_endpoint` field
- ❌ NO `endpoint` field
- ✅ Content-Type: `application/x-sentry-envelope`

### Core Client (src/sentry/core/client.tl)
- ✅ All events converted to envelopes before sending
- ✅ Use `envelope.build_error_envelope(event)` for errors/messages
- ✅ Use `envelope.build_log_envelope(logs)` for logs
- ✅ Use `envelope.build_transaction_envelope(transaction, event_id)` for performance
- ✅ Call `transport:send_envelope(envelope_body)`

### Envelope Building (src/sentry/utils/envelope.tl)
- ✅ Centralized envelope building logic in core
- ✅ Platform-specific transports only handle network layer
- ✅ Supports errors, logs, and transactions

## Transport Architecture

```
Core Client → Envelope Builder → Platform Transport → Network Request
(envelope.tl) (only network layer)
```

## Verification Checklist

When working with Sentry Lua SDK, always verify:
- [ ] No references to `build_ingest_url`
- [ ] No `send(event)` methods in transports
- [ ] No `/store/` URLs in any transport
- [ ] All events use `build_error_envelope()`
- [ ] All transports have `send_envelope()` method
- [ ] Content-Type is `application/x-sentry-envelope`
- [ ] Envelope building logic is in core, not platforms

## Memory Trigger

This rule applies to ALL work on the Sentry Lua SDK. Never implement or suggest the /store endpoint approach.
48 changes: 0 additions & 48 deletions .github/workflows/publish-luarocks.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/test-rockspec.yml

This file was deleted.

38 changes: 10 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,11 @@ jobs:
- name: Run tests with coverage
run: make coverage-report

- name: Validate rockspec installation
- name: Validate single-file SDK
shell: bash
run: |
# For Ubuntu LuaJIT, update the rockspec test to use local luarocks path
if [ "${{ matrix.os }}" = "ubuntu-latest" ] && [[ "${{ matrix.lua-version }}" == *"luajit"* ]]; then
eval "$(luarocks path --local)"
make test-rockspec
else
make test-rockspec
fi
echo "Testing single-file SDK generation and functionality..."
make test-single-file

- name: Upload coverage artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
Expand Down Expand Up @@ -168,32 +163,19 @@ jobs:
file: ./test-results.xml
token: ${{ secrets.CODECOV_TOKEN }}

- name: Create distribution zip
- name: Create single-file distribution
if: matrix.os == 'ubuntu-latest' && matrix.lua-version == '5.4'
shell: bash
run: |
echo "Creating distribution zip for Love2D and other non-LuaRocks users..."

# Create temporary directory for packaging
mkdir -p dist-temp

# Copy required files and directories
cp CHANGELOG.md dist-temp/ || { echo "❌ CHANGELOG.md not found"; exit 1; }
cp README.md dist-temp/ || { echo "❌ README.md not found"; exit 1; }

# Copy directories (recursively)
cp -r build dist-temp/ || { echo "❌ build directory not found. Run 'make build' first."; exit 1; }
cp -r spec dist-temp/ || { echo "❌ spec directory not found"; exit 1; }
cp -r examples dist-temp/ || { echo "❌ examples directory not found"; exit 1; }
echo "Creating single-file distribution package..."

# Create zip file
cd dist-temp && zip -r ../sentry-lua-sdk.zip . > /dev/null
cd ..
# Generate single-file SDK
make build-single-file

# Clean up temporary directory
rm -rf dist-temp
# Use the make publish target
make publish

echo "✅ Distribution zip created: sentry-lua-sdk.zip"
echo "✅ Single-file distribution created: sentry-lua-sdk.zip"

# Show contents for verification
echo "Distribution zip contents:"
Expand Down
Loading
Loading