Skip to content

Conversation

@Snider
Copy link
Owner

@Snider Snider commented Nov 13, 2025

  • Move Go files from core, e, and runtime directories to the project root.
  • Unify package declarations to a single 'core' package.
  • Update go.work to exclude the cmd directory from the main build.
  • Resolve naming conflicts and update import paths.
  • Fix tests to work with the new structure.

- Move Go files from core, e, and runtime directories to the project root.
- Unify package declarations to a single 'core' package.
- Update go.work to exclude the cmd directory from the main build.
- Resolve naming conflicts and update import paths.
- Fix tests to work with the new structure.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Refactor

    • Reorganised core package structure for improved API clarity and namespace consistency.
    • Simplified service runtime initialisation by streamlining constructor and factory APIs.
  • Bug Fixes

    • Service names are now consistently normalised to lowercase, ensuring uniform identifier handling throughout the system.

Walkthrough

This PR consolidates runtime-related code by migrating files from package e to core, replacing the generic Runtime type with a new ServiceRuntime variant, refactoring the runtime package into core with a simplified API, normalising service names to lowercase, and updating associated test paths.

Changes

Cohort / File(s) Summary
Package Migration
e.go, e_test.go
Package declarations changed from package e to package core, integrating error/runtime types into the core namespace.
Runtime Generic Type Refactoring
core/runtime.go (removed), runtime.go (added)
Removed the generic Runtime[T any] type and its methods from core/runtime.go. Introduced new ServiceRuntime[T any] generic type in runtime.go with constructor and core/config accessors.
Runtime Package Restructuring
runtime_pkg.go, runtime_pkg_test.go
Package declaration moved from runtime to core. Constructor renamed from New() to NewRuntime(), simplified by removing NewWithFactories() parameter. Factory options API updated to use core-package names directly (e.g., core.OptionOption). Tests updated to reference new type names and simplified constructor.
Service Name Normalisation
core.go
Service name derivation now applies strings.ToLower() to the final path segment for case-insensitive handler discovery.
Test Data Path Update
core_test.go
Embed directive and asset access path updated from testdata to core/testdata reflecting new file structure.

Possibly related PRs

  • Snider/Core#22: Adds and exports NewWithFactories runtime construction API and related tests, directly opposing the factory-parameter removal in this PR's runtime refactoring.

Suggested labels

enhancement

Poem

🐰 A reorganisation hops along,
From e to core where it belongs,
ServiceRuntime now takes the stage,
NewRuntime simplifies the page,
Lowercase names—the code runs strong!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor-flatten-repo-structure

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 856fb24 and 8b7dc42.

⛔ Files ignored due to path filters (1)
  • go.work is excluded by !**/*.work
📒 Files selected for processing (8)
  • core.go (1 hunks)
  • core/runtime.go (0 hunks)
  • core_test.go (1 hunks)
  • e.go (1 hunks)
  • e_test.go (1 hunks)
  • runtime.go (1 hunks)
  • runtime_pkg.go (4 hunks)
  • runtime_pkg_test.go (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Snider Snider merged commit 4133ead into dev Nov 13, 2025
1 check was pending
@Snider Snider deleted the refactor-flatten-repo-structure branch November 13, 2025 18:47
@coderabbitai coderabbitai bot added the enhancement New feature or request label Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants