feat(flagd): Fix in-process provider to use FLAGD_SYNC_PORT for configuration
- [x] Add
FLAGD_SYNC_PORTenvironment variable constant - [x] Update
updateFromEnvVar()to readFLAGD_SYNC_PORTfirst, then fallback toFLAGD_PORTfor backwards compatibility - [x] Update README documentation to reflect the environment variable changes
- [x] Add unit tests for the new
FLAGD_SYNC_PORTfunctionality - [x] Run existing tests to ensure no regressions
- [x] Run code review and security checks
- [x] Revert unintentional go.mod and go.sum changes
Original prompt
This section details on the original issue you should resolve
<issue_title>[flagd] Fix in-process provider to use FLAGD_SYNC_PORT (not FLAGD_PORT) for port configuration (backwards compatibility)</issue_title> <issue_description>## Background
Recent updates to flagd and related tests in flagd-testbed clarified the use of environment variables for ports:
FLAGD_PORTis for remote/server mode.FLAGD_SYNC_PORTshould be used for in-process/sync providers.Currently, the in-process provider uses the wrong environment variable (
FLAGD_PORT).Required Changes
- Fix provider configuration logic to use
FLAGD_SYNC_PORTfor in-process provider setups, and fall back toFLAGD_PORTfor backwards compatibility.- Update any relevant documentation and configuration references.
- Ensure test coverage, ideally using scenarios matching those in flagd-testbed (with
@legacy-sync-porttag for backwards compatibility coverage).References
- Parent: https://github.com/open-feature/flagd/issues/1573
- Testbed: https://github.com/open-feature/flagd-testbed/issues/266</issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes open-feature/go-sdk-contrib#788
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
@copilot please revert all your go.mod and go.sum updates, there is no need to do this within this pullrequest
@copilot please revert all your go.mod and go.sum updates, there is no need to do this within this pullrequest
Reverted all go.mod and go.sum changes in 5f67528.
/gemini review
@aepfli Could you please change the PR and issue title? feat(..) Fix... doesn't sound right and doesn't explain the change very well.
I will update the repo, we actually do have gherkin tests in the testbed, and this test by copilot is not needed.
@erka i removed the test generated by copilot - and added the gherkin testsuite tests for this kind of action - which was good because it catched issues in the gherkin files, and in the implementation (as we did not know which resolver we are in, at the previous implementation)