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

godog should report failure if ambiguous matching steps are found #635

Closed
Johnlon opened this issue Jun 22, 2024 · 8 comments
Closed

godog should report failure if ambiguous matching steps are found #635

Johnlon opened this issue Jun 22, 2024 · 8 comments
Assignees
Labels
⚡ enhancement Request for new functionality

Comments

@Johnlon
Copy link
Member

Johnlon commented Jun 22, 2024

Addressed by PR #636

🤔 What's the problem you're trying to solve?

I want my steps to register an error if there are multiple matching steps.
"Ambiguous step def"

✨ What's your proposed solution?

Cause godog to abort if multiple matches are found.
Currentlly it returns the first match so this would be a breaking change for some unsuspecting users of godog.

⛏ Have you considered any alternatives or workarounds?

No response

📚 Any additional context?

This proposal would be consistent with other languages

@Johnlon Johnlon added the ⚡ enhancement Request for new functionality label Jun 22, 2024
@Johnlon Johnlon changed the title godog should report failure if multiple matching steps are found godog should report failure if ambiguous matching steps are found Jun 24, 2024
@Johnlon
Copy link
Member Author

Johnlon commented Jun 24, 2024

@mattwynne hi Matt what's the best way to get a quick conversation on this?
I think it's uncontroversial but is a potentially breaking change for those who unwittingly have clashing steps.
Also there is the question of how and where to put a test.

I have fixed this in my own local fork to avoid further embarrassment, but I don't have a PR because my other PR 634 is blocking up my GitHub. And 634 needs a whole separate conversation.

@vearutop
Copy link
Member

Throwing an error in such case sounds good to me. I think this behavior can be put under Strict mode to reduce compatibility impact.

@Johnlon
Copy link
Member Author

Johnlon commented Jun 28, 2024

@vearutop hi take a look - at the related pr

Addressed by PR https://github.com/cucumber/godog/pull/636Addressed by PR #636

@Johnlon
Copy link
Member Author

Johnlon commented Jul 1, 2024

Merged

@Johnlon Johnlon closed this as completed Jul 1, 2024
@Johnlon
Copy link
Member Author

Johnlon commented Jul 1, 2024

@vearutop thanks

@noodnik2
Copy link

noodnik2 commented Oct 4, 2024

Is there a plan to roll this out?

@Johnlon
Copy link
Member Author

Johnlon commented Oct 4, 2024

I found last week I need to make a fix.
cant write at the moment as no time
will do a fix this weekend

@noodnik2
Copy link

noodnik2 commented Oct 4, 2024

Also see PR-642

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡ enhancement Request for new functionality
Projects
None yet
Development

No branches or pull requests

3 participants