Use events also when step definitions use "attach" and "log"#1881
Merged
Conversation
* Remove the ancient procedure call interface from formatters completely * Until now the data from "attach" and "log" calls from step definitions has been passed to the formatter using the ancient procedure call interface used in Cucumber-Ruby v1 and v2. From Cucumber-Ruby v3 all other data to formatters has been passed using events. * Introduce an event AttachCalled to pass the data from "attach" and "log" calls from step definitions to event listeners like formatters.
luke-hill
reviewed
Jun 1, 2026
luke-hill
reviewed
Jun 1, 2026
luke-hill
left a comment
Contributor
There was a problem hiding this comment.
This makes a lot of sense and removes some of the tech debt you mentioned. One QQ about some more stuff we can maybe cull
Contributor
|
I ran a focused check around the bundle exec cucumber features/docs/writing_support_code/attachments.feature features/docs/defining_steps/printing_messages.feature features/docs/writing_support_code/hooks/hook_order.feature
bundle exec cucumber features/docs/formatters/json_formatter.feature features/docs/formatters/pretty_formatter.feature
bundle exec rspec spec/cucumber/formatter/json_spec.rb spec/cucumber/formatter/message_spec.rb spec/cucumber/formatter/pretty_spec.rb spec/cucumber/glue/proto_world_spec.rb spec/cucumber/glue/step_definition_spec.rb
git diff --check origin/main...HEADResults:
From that, I do not see a functional gap in the migration from |
luke-hill
approved these changes
Jun 3, 2026
Contributor
|
@brasmusson can you write up some technical level changelog for this please. This is a great change and this makes a LOT more sense to me, so thankyou a LOT for this! 🎉 |
luke-hill
pushed a commit
that referenced
this pull request
Jun 8, 2026
* Remove the ancient procedure call interface from formatters completely * Until now the data from "attach" and "log" calls from step definitions has been passed to the formatter using the ancient procedure call interface used in Cucumber-Ruby v1 and v2. From Cucumber-Ruby v3 all other data to formatters has been passed using events. * Introduce an event AttachCalled to pass the data from "attach" and "log" calls from step definitions to event listeners like formatters. * Update Changelog.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove the ancient procedure call interface from formatters completely
Until now the data from "attach" and "log" calls from step definitions has been passed to the formatter using the ancient procedure call interface used in Cucumber-Ruby v1 and v2. From Cucumber-Ruby v3 all other data to formatters has been passed using events.
Introduce an event AttachCalled to pass the data from "attach" and "log" calls from step definitions to event listeners like formatters.
Type of change
Please delete options that are not relevant.
Please add an entry to the relevant section of CHANGELOG.md as part of this pull request.
Checklist:
Your PR is ready for review once the following checklist is
complete. You can also add some checks if you want to.
bundle exec rubocopreports no offenses