diff --git a/.github/PR_BODY.md b/.github/PR_BODY.md index a42dfe2..e1640cb 100644 --- a/.github/PR_BODY.md +++ b/.github/PR_BODY.md @@ -2,33 +2,45 @@ Branch: complement/homerunner-portbinding Summary ------- -This draft branch was created to collect and push diagnostic changes relating to Complement / Homerunner port binding and local federation test failures. +This branch contains Matrix Specification compliance improvements for federation endpoints, comprehensive unit tests, CI/CD enhancements, and diagnostic documentation for Complement testing. What this branch contains ------------------------ -- A diagnostic test log: `complement-TestGetMissingEventsGapFilling.txt` (captured test output from a Complement run). This log shows the homeserver starting and Complement attempting to fetch the server public key from the host via host.docker.internal on an ephemeral port (for example, `host.docker.internal:42739`), with repeated connection failures and timeouts. -What this branch does NOT contain --------------------------------- -- No persistent source-code changes to the main server codebase. Any small experimental edits previously performed were reverted on request; the repository should contain only diagnostic artifacts. +### Source Code Changes +- **Federation v1 endpoints**: Fixed `get_missing_events` response format to correctly return `pdus` and `origin` fields (commit bf04631) +- **Federation v2 endpoints**: Enhanced auth chain endpoint with proper Matrix-spec-compliant responses (commit 19c5d39) +- **Federation user query**: Added profile query endpoint implementation (commit 19c5d39) +- **Client-server room routes**: Added state event handling and room state endpoints (commit 19c5d39) +- **MatrixAuth utilities**: Refactored authentication and authorisation logic for better spec compliance (commit 19c5d39) -Context and reasoning +### Test Coverage (merged from PR #10) +- `FederationProfileQueryTest.kt`: Unit tests for federation profile queries +- `FederationV2AuthChainTest.kt`: Comprehensive tests for auth chain endpoint +- `StateEventRoutesTest.kt`: Tests for client-server state event routes +- `MissingEventsTest.kt`: Unit tests for the missing events endpoint (A→B→C chain validation) + +### CI/CD Improvements +- Updated `Complement.Dockerfile` to use Debian-slim builder, resolving TLS issues during Gradle dependency fetch (commit 2646d00) + +### Documentation +- `COMPLEMENT_LOCAL_RUN.md`: Comprehensive guide for running Complement tests locally using Docker and WSL +- Diagnostic test log: `complement-test-output.txt` (captured output from Complement run for reference) + +Context and Reasoning --------------------- -- The attached log was captured while running Complement with HOMERUNNER_HS_PORTBINDING_IP=0.0.0.0 to help diagnose container -> host connectivity problems. -- Containers resolved `host.docker.internal` to the Docker host IP (e.g., `192.168.65.254`), but attempts to connect to the published ephemeral ports repeatedly failed, leading Complement to report inability to fetch public keys and resulting test failures. - -Suggested reviewer actions -------------------------- -- Inspect `complement-TestGetMissingEventsGapFilling.txt` to confirm the exact failed host:port pairs (search for `host.docker.internal` in the log). -- If desired, run local host diagnostics to verify whether the host is listening on the ephemeral published ports and whether the Docker port publication is reachable from containers. Useful commands (PowerShell): - - `Get-NetTCPConnection -LocalPort 42739` or `netstat -an | Select-String 42739` - - `docker ps --format "{{.ID}}\t{{.Image}}\t{{.Names}}\t{{.Ports}}"` - - `docker port ` - - In WSL: `curl -vk https://host.docker.internal:42739/_matrix/key/v2/server/ed25519:` - -Notes ------ -- The branch is a draft to keep the diagnostic artifact available without merging into `main`. -- If you want me to push only non-log changes next, I can re-run the commit steps and explicitly exclude large log files. +This branch evolved from an initial investigation into Complement/Homerunner port binding issues. During diagnostics, several Matrix Specification compliance gaps were identified and fixed. PR #10 was opened to deliver the test coverage for these fixes and was subsequently merged back into this branch. + +The changes ensure: +- Proper federation endpoint responses matching Matrix Specification v1.16 +- Complete test coverage for federation and client-server endpoints +- Improved CI/CD reliability for Complement testing +- Clear documentation for local Complement test workflows + +Testing +------- +- All new unit tests pass locally +- Federation endpoints return spec-compliant responses +- Complement Docker image builds successfully with the updated Dockerfile Signed-off-by: GitHub Copilot