Sync upstream, migrate org refs, introduce go.work workspace & example modules#51
Merged
Sync upstream, migrate org refs, introduce go.work workspace & example modules#51
Conversation
…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
…release URL for display
… release workflow
…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>
…remove unnecessary outputs
…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
…auto-bump workflow
* 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
- 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.
… raise coverage (PR #51)
…ter build-tag guidance
…nale concise, WaitGroup.Go notes, subject guard clarification)
…s, and event handling
…ag guidance; enhance tests for validation logic
…p isolation, empty module lookup)
… 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
…nd drain timeout semantics
Contributor
There was a problem hiding this comment.
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.workworkspace 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>
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
This PR syncs changes from upstream (ctl/main) into this fork and applies a comprehensive migration to the GoCodeAlone organization namespace.
Key Changes
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
Follow-ups (Optional)
Let me know if you’d like any of the optional follow-ups included in this PR.