Skip to content

Add unified catalog integration, replaced external feeders, added field tracking#23

Merged
intel352 merged 6 commits intomainfrom
jlangevin/feeders
Jul 9, 2025
Merged

Add unified catalog integration, replaced external feeders, added field tracking#23
intel352 merged 6 commits intomainfrom
jlangevin/feeders

Conversation

@intel352
Copy link
Contributor

@intel352 intel352 commented Jul 9, 2025

  • Implemented toml_field_tracking_test.go to validate TOML configuration feeding and field tracking.
  • Created unified_catalog_integration_test.go to test environment variable precedence and field tracking across multiple feeders.
  • Enhanced yaml.go to support field tracking during YAML feeding, allowing detailed tracking of field populations.
  • Introduced field_tracker_bridge.go to adapt between main package and feeders package field tracker interfaces.
  • Added user_scenario_test.go to demonstrate and verify user scenarios involving database DSN configuration with instance-aware environment variables.

…ance YAML feeder with field tracking

- Implemented `toml_field_tracking_test.go` to validate TOML configuration feeding and field tracking.
- Created `unified_catalog_integration_test.go` to test environment variable precedence and field tracking across multiple feeders.
- Enhanced `yaml.go` to support field tracking during YAML feeding, allowing detailed tracking of field populations.
- Introduced `field_tracker_bridge.go` to adapt between main package and feeders package field tracker interfaces.
- Added `user_scenario_test.go` to demonstrate and verify user scenarios involving database DSN configuration with instance-aware environment variables.
@intel352 intel352 requested a review from Copilot July 9, 2025 17:00
@intel352 intel352 self-assigned this Jul 9, 2025
@codecov
Copy link

codecov bot commented Jul 9, 2025

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 adds comprehensive field-tracking across all configuration feeders, integrates a unified environment catalog for consistent OS and .env precedence, and introduces extensive tests covering TOML, YAML, JSON, and environment-based feeding scenarios.

  • Extend all feeders with SetFieldTracker and record detailed FieldPopulation events
  • Introduce EnvCatalog for unified environment variable management and integrate it into feeders
  • Add new tests (toml_field_tracking_test.go, unified_catalog_integration_test.go, user_scenario_test.go, etc.) to validate field tracking, precedence, and user scenarios

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated no comments.

File Description
user_scenario_test.go Fix how field populations are retrieved from the tracker
feeders/affixed_env.go Missing import for the cast package when converting env values
feeders/yaml.go Large, complex feeder logic handling both normal and tracked feeds
config_provider.go Reflection-based SetFieldTracker injection in AddFeeder
Comments suppressed due to low confidence (3)

feeders/yaml.go:15

  • [nitpick] The YamlFeeder implementation is over 400 lines in a single file and mixes parsing, reflection, and tracking logic. Consider refactoring into smaller helper modules (e.g., separate parsers, trackers, and setters) to improve readability and maintainability.
	feeder.Yaml

user_scenario_test.go:137

  • DefaultFieldTracker does not expose a public FieldPopulations field; use tracker.GetFieldPopulations() to retrieve recorded populations.
	populations := tracker.FieldPopulations

feeders/affixed_env.go:196

  • The code uses cast.FromType but the cast package is not imported; add an import such as github.com/spf13/cast or use another conversion approach.
			convertedValue, _ := cast.FromType(envValue, field.Type())

intel352 added 5 commits July 9, 2025 13:33
…wrappers

- Removed unused error wrapper functions for JSON and TOML feeders.
- Updated JSON, TOML, and YAML feeders to use a consistent approach for feeding data, regardless of field tracking state.
- Enhanced error handling in YAML feeder for better clarity on conversion issues.
- Added comprehensive tests to ensure consistent behavior across different feeder types (YAML, JSON, TOML).
- Introduced a new consistency test to verify that feeders produce the same results with and without field tracking.
- Improved logging capabilities for debugging purposes in YAML feeder.
@intel352 intel352 merged commit c5cdf85 into main Jul 9, 2025
42 checks passed
@intel352 intel352 deleted the jlangevin/feeders branch July 9, 2025 18:29
Copilot AI added a commit that referenced this pull request Aug 24, 2025
* Initial plan

* Implement route-level feature flag support in reverseproxy module

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

* Fix linting errors: remove extra blank lines and handle write errors in tests

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>
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.

2 participants