Skip to content

Reorganize project structure, packaging, and CI - #8

Merged
Suhaibinator merged 5 commits into
mainfrom
codex/project-structure-ci
Oct 11, 2026
Merged

Suhaibinator merged 5 commits into
mainfrom
codex/project-structure-ci

Conversation

@Suhaibinator

@Suhaibinator Suhaibinator commented Jul 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • reorganize the Go code around a versioned API, command entry point, queue boundary, and SQLite store while retaining compatibility aliases for the original Go protobuf import path
  • move the Python client to a standard src layout with deterministic generated bindings, corrected streaming behavior, tested packaging, and independent release versioning
  • replace overlapping workflows with pinned CI, container/GitHub release, trusted PyPI publishing, Buf compatibility checks, generation drift checks, and Dependabot
  • harden startup and shutdown, fail closed for invalid mTLS, expose gRPC health, map domain errors to gRPC status codes, and return the assigned produce offset
  • ship a non-root multi-stage container plus current README, contribution, security, examples, editor tasks, and Make targets
  • document client migration for Go, Python, direct protobuf users, behavioral changes, rollout, and rollback

Compatibility

  • the existing smq protobuf wire package and field numbers are unchanged
  • github.com/Suhaibinator/SuhaibMessageQueue/proto remains available through deprecated aliases
  • server/container releases use vX.Y.Z; Python releases use pysmq-vX.Y.Z

Validation

  • go vet ./...
  • go test -race -shuffle=on ./...
  • go build -trimpath ./cmd/smq
  • Ruff check and format check
  • Python tests (9 passing) and coverage
  • Python sdist/wheel build plus twine check
  • Buf lint, breaking-change check, and deterministic regeneration
  • actionlint for all GitHub Actions workflows
  • Docker image build and end-to-end Python create/produce/consume smoke test

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 70eea7c8cb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +256 to +257
t.messagesChannel <- data
result := <-t.resultChannel

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pair each insert result with its producer

When concurrent Produce RPCs target the same topic, each caller sends through messagesChannel but then reads from the same shared resultChannel. If the worker accepts the second message before the first caller receives its result, the second caller can consume the first insert's addResult, causing acknowledgements to return another producer's offset. Use a per-request response channel or otherwise serialize each send/result pair.

Useful? React with 👍 / 👎.

Suhaibinator and others added 5 commits October 11, 2026 02:19
Moving the server under internal/ (#7) left other Go modules with no way
to run SMQ inside their own process. Add a public embedded package that
opens the SQLite store directly, with no listener. It provides an
idempotent CreateTopic, Publish and an atomic PublishBatch that return
offsets, Read from an offset bounded by count and bytes, Earliest and
Latest offsets, DeleteUntilOffset, per-topic Stats, and Close. An
optional RegisterGRPC serves the existing SMQ API from the same store on
a caller-owned grpc.Server.

The package reuses the internal SQLite store, which gains:

- AddMessages, ReadMessages, TopicStats and Topics.
- Open with options. WAL, synchronous, auto_vacuum and busy_timeout are
  now set through the DSN, so they apply to every pooled connection.
  Previously they applied to one. Private in-memory databases are pinned
  to a single connection.
- A fix for concurrent producers receiving each other's offsets. The
  per-topic writer goroutine shared one result channel; on the base
  branch, 258 of 3,200 concurrent AddMessage calls got the wrong offset.
  Inserts now run directly under the existing write lock.
- ErrStoreClosed for operations after Close, instead of a send on a
  closed channel. The gRPC transport maps it to UNAVAILABLE.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@Suhaibinator
Suhaibinator force-pushed the codex/project-structure-ci branch from 8b25d93 to e552580 Compare October 11, 2026 09:20
@Suhaibinator
Suhaibinator merged commit a37f299 into main Oct 11, 2026
5 checks passed
@Suhaibinator
Suhaibinator deleted the codex/project-structure-ci branch October 11, 2026 09:21
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