Skip to content

feat(discordsh): Mockoon docker-compose POC for local E2E testing#8221

Merged
h0lybyte merged 2 commits intodevfrom
trunk/discordsh-mockoon-poc-1773807297
Mar 18, 2026
Merged

feat(discordsh): Mockoon docker-compose POC for local E2E testing#8221
h0lybyte merged 2 commits intodevfrom
trunk/discordsh-mockoon-poc-1773807297

Conversation

@h0lybyte
Copy link
Member

Summary

Closes #8180 | Parent: #7849 | Related: #8150, #7856

  • Add GITHUB_API_BASE_URL env var support to GitHubClient usage in both slash commands and the scheduler, enabling API redirection to mock backends
  • Create Mockoon mock definitions for GitHub REST API (issues, pulls, repo metadata, 401/403/404 error scenarios) and Discord REST API (messages, gateway, interactions, commands)
  • Wire everything up in docker-compose-poc-dev.yaml with healthchecks and zero-credential local testing

Architecture

docker-compose-poc-dev.yaml
├── discordsh            (real bot binary, existing Dockerfile)
├── mockoon-github       (mockoon/cli, port 4010)
└── mockoon-discord      (mockoon/cli, port 4011)

Files

  • apps/discordsh/poc/docker-compose-poc-dev.yaml — orchestration
  • apps/discordsh/poc/mockoon/github-mock.json — GitHub API mock (6 routes)
  • apps/discordsh/poc/mockoon/discord-mock.json — Discord REST mock (5 routes)
  • apps/discordsh/poc/README.md — developer instructions + CI integration guide
  • apps/discordsh/axum-discordsh/src/discord/commands/github_board.rs — env var override
  • apps/discordsh/axum-discordsh/src/discord/scheduler.rs — env var override

Known Limitations

  • serenity/poise does not support custom Discord REST base URLs — Discord mock is for request inspection only
  • Mockoon cannot handle WebSocket upgrades — gateway mock is REST metadata only

Test Plan

  • docker compose up mockoon-github mockoon-discord boots and healthchecks pass
  • curl localhost:4010/repos/KBVE/kbve/issues returns canned issues (200)
  • curl localhost:4010/repos/unauthorized/test/issues returns 401
  • curl localhost:4010/repos/forbidden/test/issues returns 403
  • curl localhost:4010/repos/notfound/test/issues returns 404
  • curl -X POST localhost:4011/api/v10/channels/123/messages returns mock message
  • Full docker compose up with real DISCORD_TOKEN (requires test bot app)

…#8180)

Add GITHUB_API_BASE_URL env var support to GitHubClient usage in both
slash commands and the scheduler, enabling API redirection to mock
backends. Create Mockoon mock definitions for GitHub REST API (issues,
pulls, repo metadata, error scenarios) and Discord REST API (messages,
gateway, interactions, commands). Wire everything up in a
docker-compose-poc-dev.yaml with healthchecks.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

…ests (#8180)

Add playwright.mock.config.ts that manages the full docker-compose
lifecycle (mockoon-github + mockoon-discord + discordsh), a 15-test
mock-api.spec.ts covering GitHub mock routes, Discord mock endpoints,
error scenarios, and bot health/frontend through the mock stack.

Fix docker-compose healthchecks: use 127.0.0.1 instead of localhost
(Alpine resolves localhost to IPv6), add --hostname 0.0.0.0 to Mockoon
CLI commands, and add start_period for reliable startup. Support
pre-built image via DISCORDSH_IMAGE env var to skip rebuilds in CI.
@h0lybyte h0lybyte merged commit cfc74b6 into dev Mar 18, 2026
7 checks passed
@h0lybyte h0lybyte deleted the trunk/discordsh-mockoon-poc-1773807297 branch March 18, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant