feat(semver): add edge case scenarios for v-prefix, partial versions, and build metadata#341
feat(semver): add edge case scenarios for v-prefix, partial versions, and build metadata#341
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the testing suite for semantic versioning (SemVer) operations by adding comprehensive scenarios for edge cases. These new tests ensure that the system correctly handles version strings with 'v' prefixes, partial version numbers, and build metadata, aligning with the SemVer specification and addressing identified issues in Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds test scenarios for semver edge cases, including v-prefixes, partial versions, and build metadata. New flag definitions are added to flags/custom-ops.json and corresponding test scenarios are added to gherkin/targeting.feature. The added tests cover the intended cases as described. My review of the changes did not identify any issues.
|
relates to open-feature/flagd#1873 |
- semver edge cases: v-prefix, partial version, build metadata (@semver-edge-cases) - operator error null-return fallback (@operator-errors): semver invalid version/operator, fractional null bucket key - nested $ref resolution via is_privileged (@evaluator-ref-edge-cases) - nested fractional expressions: if/var as bucket variant names (@fractional-nested) - fractional hash edge cases (@fractional-v2) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- semver edge cases: v-prefix, partial version, build metadata (@semver-edge-cases) - operator error null-return fallback (@operator-errors): semver invalid version/operator, fractional null bucket key - nested $ref resolution via is_privileged (@evaluator-ref-edge-cases) - nested fractional expressions: if/var as bucket variant names (@fractional-nested) - fractional hash edge cases (@fractional-v2) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
- semver edge cases: v-prefix, partial version, build metadata (@semver-edge-cases) - operator error null-return fallback (@operator-errors): semver invalid version/operator, fractional null bucket key - nested $ref resolution via is_privileged (@evaluator-ref-edge-cases) - nested fractional expressions: if/var as bucket variant names (@fractional-nested) - fractional hash edge cases (@fractional-v2) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
- semver edge cases: v-prefix, partial version, build metadata (@semver-edge-cases) - operator error null-return fallback (@operator-errors): semver invalid version/operator, fractional null bucket key - nested $ref resolution via is_privileged (@evaluator-ref-edge-cases) - nested fractional expressions: if/var as bucket variant names (@fractional-nested) - fractional hash edge cases (@fractional-v2) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces new semantic versioning test cases and flag definitions to handle edge cases such as 'v' prefixes, partial versions, and build metadata. The changes are applied across both the evaluator and general flag/feature definitions. Feedback was provided regarding the duplication of these new flags and Gherkin scenarios across multiple files, which could lead to maintenance overhead.
841884a to
54bf38d
Compare
… and build metadata Adds @semver-edge-cases tagged scenarios covering: - v-prefix versions (v1.0.0) stripped transparently on both sides - Partial versions (1, 1.2) padded with .0 components - Build metadata ignored per SemVer 2.0.0 Rule 10 Addresses: open-feature/flagd#1873 Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds the v-prefix, partial version, and build-metadata semver scenarios from the SDK-level gherkin (gherkin/targeting.feature) to the evaluator suite, with matching flag definitions in evaluator/flags/testkit-flags.json. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Adds @semver-v-prefix, @semver-partial-version and @semver-build-metadata subtags so SDK implementations can exclude individual edge-case scenarios during their migration period (e.g. -t 'not @semver-v-prefix'), mirroring the pattern used by @fractional-nested. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
54bf38d to
734c18f
Compare
Summary
Adds
@semver-edge-casestagged scenarios totargeting.featurecovering edge cases from flagd#1873.New Tag
@semver @semver-edge-cases— SDK implementations can opt in to run these as part of their@semversuite or target@semver-edge-casesindependently.New Scenarios
v-prefix handling (
semver-v-prefix-flag)Rule compares against
v1.0.0(v-prefixed). Both1.0.0andv1.0.0in context should match — the prefix is stripped transparently on both sides.1.0.0v1.0.02.0.0Partial version handling (
semver-partial-version-flag)Rule compares against
1(partial — missing minor and patch). Should be treated as1.0.0and match any compatible1.x.y.1.5.01.0.02.0.0Build metadata ignored (
semver-build-metadata-flag)Rule compares against
1.0.0+build. Build metadata MUST be ignored per SemVer 2.0.0 Rule 10 — so1.0.0and1.0.0+otherboth equal1.0.0+build.1.0.01.0.0+other2.0.0Related