Hardening and Refactoring - #23
Merged
Merged
Conversation
- persist pending tag jobs with Redis AOF - namespace Redis state and migrate legacy keys - improve authentication, parsing, and GraphQL diagnostics - propagate synchronization failures instead of swallowing them - make initialization idempotent - add dependency updates, tests, CI, and deployment documentation
There was a problem hiding this comment.
Pull request overview
This PR delivers a substantial hardening/refactor of mythic_sync, centered on making Ghostwriter tag updates non-blocking and durable via Redis-backed queuing, improving GraphQL retry diagnostics/redaction, and strengthening operational behavior (startup checks, containerization, CI).
Changes:
- Added a Redis-backed pending-tag retry worker with namespaced keys, legacy migration, and dead-lettering for irrecoverable jobs.
- Refactored Ghostwriter GraphQL execution to use capped exponential backoff with jitter and safer diagnostic context (redaction).
- Updated container/runtime/CI scaffolding (Docker entrypoint, Compose health checks, GitHub Actions, Dependabot) and expanded unit test coverage.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
sync.py |
Core refactor: Redis namespacing/migrations, tag retry queue + worker, improved GraphQL retry/backoff and diagnostic redaction, initialization idempotency, and shutdown handling. |
test_sync.py |
New async unit tests covering retries, reconciliation, tag-queue behavior, timestamp/IP normalization, migrations, and auth/Redis startup behavior. |
requirements.txt |
Dependency pin updates (but includes a gql pin that appears invalid). |
Dockerfile |
Moves to Bookworm base, venv install, non-root runtime, dedicated entrypoint, and /data volume. |
docker-entrypoint.sh |
New entrypoint to manage embedded Redis + graceful shutdown sequencing. |
docker-compose.yml |
Redis healthcheck + AOF settings + persistent volume; service restart policies. |
settings.env |
Adds REDIS_DB and documents optional REDIS_URL. |
README.md |
Expanded operational documentation, dead-letter inspection, and manual acceptance checklist/testing guidance. |
CHANGELOG.md |
Adds 3.1.0 release notes. |
.github/workflows/test.yml |
New CI workflow for unit tests + container build + Redis persistence check. |
.github/dependabot.yml |
New Dependabot configuration for pip/docker/actions. |
.dockerignore |
New ignore list to slim Docker build context (excludes tests). |
.gitignore |
Adds common Python/macOS ignores. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🤖 Augment PR SummarySummary: Refactors Mythic→Ghostwriter syncing to be more resilient, especially around Redis durability and tag-update failures. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
While unlikely, it's possible for two Mythic instances to co-exist on different ports. This change ensures there are no collisions and cross-instance log pollution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Significant refactoring to improve performance and logging.
CHANGELOG
[3.1.0] - 18 July 2026
Added
mythic_syncrestarts and service recreation, provided the Redis data volume is preservedChanged
ModelDoesNotExistresponsesFixed
entryIdentifierand repairing the mapping or recreating a deleted entryZ