Skip to content

Sync upstream, migrate org refs, introduce go.work workspace & example modules#51

Merged
intel352 merged 74 commits intomainfrom
sync/ctl-main-2025-09
Sep 6, 2025
Merged

Sync upstream, migrate org refs, introduce go.work workspace & example modules#51
intel352 merged 74 commits intomainfrom
sync/ctl-main-2025-09

Conversation

@intel352
Copy link
Contributor

@intel352 intel352 commented Sep 4, 2025

Summary
This PR syncs changes from upstream (ctl/main) into this fork and applies a comprehensive migration to the GoCodeAlone organization namespace.

Key Changes

  • Migrated import paths: CrisisTextLine/modular -> GoCodeAlone/modular across core, modules, CLI, and examples
  • Added full go.work workspace enumerating core, cmd/modcli, all modules, and 27 examples
  • Added new examples (auth-demo, cache-demo, eventbus-demo, jsonschema-demo, letsencrypt-demo, scheduler-demo) with canonical module paths
  • Introduced go.work.sum (generated) for reproducible workspace builds
  • Normalized example go.mod module directives to github.com/GoCodeAlone/modular/examples/
  • Updated reverseproxy & eventbus docs to reflect new import paths
  • Bumped testify to v1.11.1 and hashicorp/go-uuid to v1.0.3 where needed (indirect tidy)
  • Removed remaining legacy path references in code (only git remote metadata still references upstream)

Rationale
Adopting go.work unifies intra-repo dependency resolution without maintaining pinned pseudo-versions between internal modules, simplifying local development and reducing merge friction.

Verification

  • Ran full lint & test task: all core, module, CLI tests pass; examples build (most have no tests by design)
  • Built each example individually to verify workspace resolution
  • Grep confirms no remaining CrisisTextLine references in tracked source files

Follow-ups (Optional)

  • Add CI guard ensuring every examples/* with go.mod appears in go.work
  • Evaluate release workflow adjustments now that module version pins are removed locally
  • Consider pruning explicit requires on core module where workspace resolution suffices (post-release decision)

Let me know if you’d like any of the optional follow-ups included in this PR.

Copilot AI and others added 30 commits August 24, 2025 22:55
…ration and universal Go support (#77)

* Initial plan

* Implement core API contract extraction and comparison functionality

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Add comprehensive test suite and CI workflow for API contract management

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Complete API contract management implementation with documentation and linting fixes

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Fix CI pipeline contract extraction for modules with go.mod files

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Implement complete API contract system with git integration

- Add workflow permissions for GitHub Actions (contents:read, pull-requests:write)
- Complete method signature parsing in extractor (parameters, returns, receivers)
- Implement full getDocComment function with AST traversal
- Remove placeholder comments from tests, implement complete solutions
- Add git-based contract comparison with version tag support
- Add git-diff and tags commands to CLI
- Support automatic version tag detection and git ref comparisons
- Add comprehensive test coverage for git functionality
- Update documentation to clarify tool works with any Go codebase
- Add git workflow examples and best practices

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Fix failing contract command test to account for new subcommands

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.10.0 to 1.11.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.10.0...v1.11.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Langevin <jlangevin@crisistextline.org>
…es (#79)

* Enhance EventLogger module with synchronous startup/shutdown options and early lifecycle event suppression

- Added configuration options: `startupSync`, `shutdownEmitStopped`, and `shutdownDrainTimeout` to control operational event emissions.
- Updated `Start` and `Stop` methods to respect new configurations for synchronous behavior and improved shutdown handling.
- Implemented suppression of benign early lifecycle events to reduce log noise during application bootstrapping.
- Introduced regression tests to verify correct behavior of startup and shutdown processes.

* httpserver: replace synthetic request events with real request handling in BDD tests

* chimux: add runtime middleware removal (UseNamed/RemoveMiddleware) and tests

* eventlogger: add synchronous startup/shutdown options and suppress early lifecycle noise

* scheduler: test isolation improvements and minor lifecycle adjustments

* infrastructure: test isolation utilities, CI matrix for BDD, docs on parallelism & config feeders

* reverseproxy: additional BDD coverage and stability tweaks (debug, health, circuit breaker)

* config: per-app feeders & direct field tracking robustness; update modcli generator go.mod templates

* examples+modules: align with new config isolation & event emission patterns; test updates

* httpserver: remove temporary debug print statements from request event path & tests

* security(ci): add explicit permissions blocks, plan Codecov pinning; fix Redis password test

* ci: pin Codecov action to specific commit SHA for stability; clean up whitespace in various files

* chore(database): tidy go.mod to satisfy linter

* chore(config): gofmt config_provider

* docs: add concurrency guidelines and cross-links; test: add observer registration ordering test; chore: integrate race test script & workflow; fix: finalize reverseproxy race-safe handlers

* refactor: follow-up concurrency & observer adjustments across modules; tighten tests after manual edits

* ci: update workflows to enhance race detection and logging; improve observer pattern lifecycle event checks

* ci: enable GORACE for immediate race detection feedback in CI workflows; remove obsolete race test script

* chore: update Go version to 1.25 across workflows and dependencies; align testify version to 1.11.0; Update release versioning based on contract change impact

* ci: enhance coverage reporting by adding upload steps for unit and CLI coverage artifacts; ensure merged total coverage is uploaded
…rtup noise (#81)

* Initial plan

* Fix eventlogger noisy ErrLoggerNotStarted for module-specific early lifecycle events

Implement pattern-based filtering in isBenignEarlyLifecycleEvent() to reduce noise:
- Add suffix matching for .config.loaded and .config.validated (module-specific config events)
- Add suffix matching for .router.created and .cors.configured (infrastructure setup events)
- Add comprehensive tests verifying fix works and doesn't over-filter
- Maintains backward compatibility and existing behavior for core framework events

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Update modules/eventlogger/module.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Implement queue-until-ready approach for eventlogger pre-start events

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Address PR feedback: remove comment, add queue-until-ready BDD tests, run go fmt

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Implement full BDD test logic for queue-until-ready scenarios

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* refactor: improve mutex handling and reduce test code duplication in eventlogger

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Co-authored-by: Jonathan Langevin <jlangevin@crisistextline.org>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…omplete BDD Test Coverage (#83)

* Initial plan

* Implement Phase 1-2: Feature flag aggregator pattern with weighted evaluators

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Implement Phase 3: Enhanced framework cycle detection with interface-based dependencies

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Complete Phase 4-5: Integration tests, backwards compatibility, and final cleanup

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Add feature flag migration documentation and update README

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Implement interface-based feature flag evaluator discovery and add BDD tests

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Implement interface-based service discovery with enhanced service registry

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Fix nil pointer panics in enhanced service registry by adding null checks

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Add comprehensive BDD scenarios for enhanced service registry API

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Implement enhanced cycle detection with self-dependency support and BDD tests

- Fixed critical nil pointer dereference in Test_Application_Init_ErrorCollection by adding protective null checks for enhanced service registry
- Enhanced cycle detection to support self-dependencies while preventing accidental matches
- Allow self-dependencies when both service names and interfaces match (intentional)
- Skip self-dependencies when only interfaces match but service names differ (accidental)
- Fixed interface name disambiguation to use fully qualified names (Type.String() vs Type.Name())
- Implemented comprehensive BDD test coverage for all enhanced cycle detection scenarios:
  * Mixed dependency types in cycle detection
  * Complex multi-module cycles (A->B->C->A)
  * Self-dependency detection
  * Interface name disambiguation with fully qualified names
  * No false positive cycle detection for valid linear dependencies

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Refactor to use builder pattern and extract complex self-dependency logic

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Co-authored-by: Jonathan Langevin <jlangevin@crisistextline.org>
…85)

* Initial plan

* Fix enhanced service registry test failures

- Fix test modules to properly implement ServiceAware interface
- Update RegisterService logic to allow enhanced conflict resolution
- Update test expectations to match new automatic conflict resolution behavior
- All 8 BDD test scenarios now pass
- All existing unit tests still pass

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Implement missing field tracking and service naming tests - 5 of 6 skipped tests now passing

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

* Complete implementation - all 6 previously skipped tests now pass with proper field tracking

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
…ctured lifecycle events (#86)

* feat(eventbus): fairness rotation, backpressure modes (drop/block/timeout), metrics exporters (Prometheus, Datadog), lifecycle payload, dependency pruning, tests\n\nCore:\n- Add rotating subscriber order for fairness (atomic counter)\n- Implement delivery modes: drop, block, timeout with configurable PublishBlockTimeout\n- Add delivered/dropped atomic counters; delivered increments post-handler completion\n- Add Stats() & PerEngineStats() APIs\n- Introduce structured ModuleLifecyclePayload + NewModuleLifecycleEvent; backward-compatible event types\n- Prune self interface dependency edges & ignore self matches to prevent artificial cycles\n\nMetrics & Exporters:\n- Prometheus collector exposing delivered_total/dropped_total per-engine + aggregate\n- Datadog StatsD exporter (gauges) with engine tag, aggregate, goroutine gauge\n\nEvent Logger & Reverse Proxy:\n- Prevent recursive buffer full/dropped amplification in eventlogger; emit stopped before teardown\n- Expand feature flag aggregator BDD tests and evaluator discovery scenarios; add scenario isolation\n\nDatabase:\n- Add sqlite-backed migration service tests (idempotency, invalid SQL, table name validation)\n\nScheduler & Other Modules:\n- Update mocks to satisfy expanded Application interface (Context/service introspection)\n- Bump module go.mod dependencies to core v1.9.0 and testify 1.11.0 where needed\n\nTesting Enhancements:\n- High concurrency race test (drop mode)\n- Fairness blocking/timeout test with stabilization loop & relaxed ratio bounds (0.25-3.0)\n- Stats accounting test & unsubscribe under load test\n- Datadog exporter UDP capture test (forced flush)\n- Prometheus collector basic test\n\nCI / Tooling:\n- Auto bump workflow for module dependency version updates\n\nDocs:\n- README (eventbus) updated for fairness, delivery modes, observability semantics\n\nRationale:\nImproves fairness under load, provides configurable backpressure strategies, exposes observable delivery metrics, stabilizes tests, avoids spurious dependency cycles, and enriches lifecycle event structure.

* test(eventbus): relax race test delivered threshold to reduce flakiness (allow 25% with drop mode)

* fix(eventbus): stop processing immediately after unsubscribe to prevent post-unsubscribe deliveries

* test: align module tests with updated Application interface and eventbus metrics/fairness semantics

* fix(eventbus): ensure unsubscribe waits for handler goroutine termination to avoid post-unsubscribe deliveries

* Update dependencies across multiple modules

- Added `github.com/hashicorp/go-uuid v1.0.3` as an indirect dependency in `httpclient`, `httpserver`, `jsonschema`, `reverseproxy`, and `scheduler` modules.
- Updated `golang.org/x/text` from `v0.24.0` to `v0.28.0` in `jsonschema` module.
- Updated various AWS SDK dependencies in `letsencrypt` module to their latest versions, including:
  - `github.com/aws/aws-sdk-go-v2 v1.38.0`
  - `github.com/aws/aws-sdk-go-v2/config v1.31.0`
  - `github.com/aws/aws-sdk-go-v2/credentials v1.18.4`
  - `github.com/aws/aws-sdk-go-v2/service/sso v1.28.0`
  - `github.com/aws/aws-sdk-go-v2/service/sts v1.37.0`
- Updated `github.com/golang-jwt/jwt/v5` from `v5.2.2` to `v5.2.3` in `letsencrypt` module.
- Updated `golang.org/x/sys` from `v0.34.0` to `v0.35.0` and `golang.org/x/net` from `v0.42.0` to `v0.43.0` in `letsencrypt` module.

* eventbus/eventlogger: address review feedback (extension naming doc, remove shuffle fallback, drop goroutine gauge, cache isOwnEvent, clarify rotation safety)

* fix: update go.sum and go.work.sum to include missing module entries

* fix(eventlogger): acquire lock during initialization to prevent data races with OnEvent

* fix(eventbus): optimize event rotation logic to avoid int conversion and improve performance

* fix(auto-bump): remove go.work files to prevent conflicts during module updates
* chore: bump module dependencies to v1.11.1

* test(eventbus): relax blocking mode fairness lower bound to reduce CI flakiness

---------

Co-authored-by: github-actions <github-actions@users.noreply.github.com>
Co-authored-by: Jonathan Langevin <codingsloth@pm.me>
…amic route comment, eventbus exporter guidance, rotation guard cleanup, shutdown drain semantics
@intel352 intel352 requested a review from Copilot September 6, 2025 06:34

This comment was marked as outdated.

- Implemented multi-engine routing tests to verify correct engine selection based on routing rules.
- Added tests to ensure publishing before starting the EventBus returns an error.
- Created additional tests for Redis EventBus to validate behavior when starting, publishing, and subscribing before initialization.
- Developed statistics tests to confirm correct accumulation of event delivery counts per engine.
- Introduced a noopLogger for testing purposes to avoid logging during tests.
- Added topic prefix filter tests to ensure filtering works as expected.
- Enhanced LetsEncrypt module with tests for configuration validation, certificate handling, and error paths.
- Implemented tests for DNS provider configurations to cover various error scenarios.
- Added tests for certificate renewal and revocation processes, ensuring proper error handling and state management.
- Created storage helper tests to validate certificate storage and expiration checks.
@intel352 intel352 requested a review from Copilot September 6, 2025 07:50

This comment was marked as outdated.

@intel352 intel352 requested a review from Copilot September 6, 2025 09:35

This comment was marked as outdated.

@intel352 intel352 requested a review from Copilot September 6, 2025 10:28

This comment was marked as outdated.

… and clarify comments

docs(readme): add advanced usage section for route pattern matching and dynamic segment mismatches
docs(metrics): refine build tag guidance for Prometheus and Datadog exporters
fix(eventlogger): clarify ShutdownDrainTimeout behavior for graceful shutdown
…nce, doc/comment refinements, race-safe counters already added
@intel352 intel352 requested a review from Copilot September 6, 2025 20:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR performs a comprehensive migration from the CrisisTextLine/modular namespace to GoCodeAlone/modular while introducing significant improvements to the development workflow and testing infrastructure. The migration includes updating all import paths, establishing a unified workspace structure, and enhancing the eventbus module with advanced features.

Key changes:

  • Complete namespace migration with updated import paths across all modules and examples
  • Introduction of unified go.work workspace for simplified dependency management
  • Significant eventbus module enhancements with delivery modes, fairness controls, and metrics
  • Enhanced testing infrastructure with better isolation and BDD test improvements

Reviewed Changes

Copilot reviewed 156 out of 284 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go.work New workspace configuration unifying all modules and examples
go.mod Updated to Go 1.25 with migrated import paths
modules/eventbus/memory.go Enhanced with delivery modes, rotation fairness, and stats tracking
modules/eventbus/*_test.go Comprehensive new test suites for memory engine features
modules/database/migrations.go Updated to use synchronous event notification
examples/*/go.mod All examples migrated to canonical module paths
modules/*/go.mod Updated Go version and dependency versions
Comments suppressed due to low confidence (2)

modules/eventbus/memory.go:1

  • [nitpick] This comment is excessively detailed for inline code documentation. Consider moving this operational guidance to the module's README.md or creating a separate documentation file. Inline comments should be concise and focus on the immediate implementation details.
package eventbus

modules/eventbus/memory.go:1

  • [nitpick] While this documentation provides valuable design context, it's extremely verbose for a struct comment. Consider condensing this to the essential information and moving the detailed rationale to a design document or the module's README.
package eventbus

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@intel352 intel352 merged commit 0373bce into main Sep 6, 2025
78 of 80 checks passed
@intel352 intel352 deleted the sync/ctl-main-2025-09 branch September 6, 2025 20:46
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.

3 participants