Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: improve gherkin files #161

Merged
merged 4 commits into from
Jan 8, 2025
Merged

feat!: improve gherkin files #161

merged 4 commits into from
Jan 8, 2025

Conversation

aepfli
Copy link
Member

@aepfli aepfli commented Dec 5, 2024

I looked at our Gherkin files, and I feel we can optimize them slightly. They're sometimes hard to use.

  • Transferred a lot of When into Given
  • split flag actions into smaller chunks (one for reason, one for value, one for variant) instead of merging them into one
  • added tags throughout the test suite to easier enable disable features (not by loading files, but by defining tags)

⚠️ Breaking Change

  • changed how flags etc, are evaluated; current test suites won't work anymore
  • Flag evaluation now differs from the spec gherkin file. We could also adapt the spec gherkin file or create one here; I am open to both solutions.

@aepfli aepfli force-pushed the feat/improve_gherkin branch 2 times, most recently from 9fbb85d to 72acea4 Compare December 5, 2024 13:33
@aepfli
Copy link
Member Author

aepfli commented Dec 7, 2024

relates to #166

@aepfli aepfli force-pushed the feat/improve_gherkin branch from 8c3de77 to 6f5055d Compare December 7, 2024 22:21
Signed-off-by: Simon Schrottner <[email protected]>
@aepfli aepfli force-pushed the feat/improve_gherkin branch 2 times, most recently from 49ba22e to dc3a944 Compare December 12, 2024 09:54
Signed-off-by: Simon Schrottner <[email protected]>
@aepfli aepfli force-pushed the feat/improve_gherkin branch from dc3a944 to 796c0e8 Compare December 17, 2024 11:51
@aepfli aepfli changed the title feat: improve gherkin files feat!: improve gherkin files Dec 18, 2024
@aepfli aepfli force-pushed the feat/improve_gherkin branch 3 times, most recently from 6804205 to e91f61f Compare December 28, 2024 18:17
@aepfli
Copy link
Member Author

aepfli commented Dec 29, 2024

open-feature/java-sdk-contrib#1115 and open-feature/python-sdk-contrib#121 and open-feature/js-sdk-contrib#1129

Those need to have a little bit more work still, as they're not 100% feature complete, but show the process in general

@aepfli aepfli force-pushed the feat/improve_gherkin branch from e91f61f to 2e6d291 Compare December 29, 2024 10:25
@aepfli
Copy link
Member Author

aepfli commented Dec 29, 2024

@toddbaert @beeme1mr I would love to move forward with this. I have implemented reference implementations within Java and Python (also using tags to exclude features), which work great (except for Python 3.8, which is a little sad, but I can't fix the tooling).

(teaser: I also have a socket path implementation for Python with this test suite ready)

Let me know what you think :)

@aepfli aepfli marked this pull request as ready for review December 29, 2024 10:34
@aepfli aepfli requested review from toddbaert and beeme1mr December 29, 2024 10:39
@aepfli aepfli force-pushed the feat/improve_gherkin branch 5 times, most recently from 1bd95d3 to 169e533 Compare December 30, 2024 19:38
@aepfli aepfli force-pushed the feat/improve_gherkin branch from 169e533 to 53bfd58 Compare December 30, 2024 19:42
Then the error event handler should have been executed
Then the ready event handler should have been executed

Examples: Stable
Copy link
Member

@toddbaert toddbaert Jan 7, 2025

Choose a reason for hiding this comment

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

This is a bit of a nit, but if I understand correctly, we can use Scenarios here instead of Examples which I think is just clearer (using SSL or a target URI seems more like a specific "scenario" to me than an "example". Example just sounds like example data, but this is a different mode of operation, not just different sample data.

If this is a difficulty, I'm fine with Examples, but my understanding is they are synonymous in cucumber.

@@ -0,0 +1,146 @@
@rpc @in-process @targeting
Feature: flagd json evaluation
Copy link
Member

@toddbaert toddbaert Jan 7, 2025

Choose a reason for hiding this comment

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

I think we should update this name to match the file name better, or vice-versa... maybe "flag custom targeting features"

@@ -0,0 +1,34 @@
@rpc @in-process
Feature: flagd providers
Copy link
Member

Choose a reason for hiding this comment

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

Same here, can we make the filename and Feature a bit more similar?

@toddbaert toddbaert self-requested a review January 7, 2025 18:29
Copy link
Member

@toddbaert toddbaert left a comment

Choose a reason for hiding this comment

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

I looked at the draft implementations and they look good, so I don't have any major compatibility concerns. I left some notes about minor discrepancies I found between some content and file names, and also suggest some alternate keywords for clarity.

Flag evaluation now differs from the spec gherkin file. We could also adapt the spec gherkin file or create one here; I am open to both solutions.

I think we should update the spec gherkin, this format looks better.

Breaking Change

I think another thing we should do is make this a 1.0 release... mostly because we mostly (only?) use this internally and then we could more easily express breaking changes going forward. You can do this by adding "release-as": "1.0.0" in the release please config here:

"release-type": "simple",
(and then we remove it after the release). I think it's fine to do that in this PR. If we make more breaking changes that's fine, we can be on v15 of this next month IMO and it won't hurt.

Signed-off-by: Simon Schrottner <[email protected]>
@aepfli aepfli merged commit f20cda1 into main Jan 8, 2025
3 checks passed
@toddbaert toddbaert deleted the feat/improve_gherkin branch January 9, 2025 17:51
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