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

Wrap enumerators to avoid JobIteration deprecation #1140

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

etiennebarrie
Copy link
Member

Fix #1132

The new version of job-iteration makes CI fail because it adds a deprecation. This resolves the deprecation by always wrapping enumerators with JobIteration.enumerator_builder.wrap.

@@ -75,6 +76,9 @@ def build_enumerator(_run, cursor:)
MSG
end

unless @collection_enum.is_a?(JobIteration.enumerator_builder::Wrapper)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a risk of Wrapper constant not existing in JobIteration.enumerator_builder namespace?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe it's now part of the API. If your EnumeratorBuilder doesn't have a Wrapper constant, that line in job-iteration will raise before being able to emit the deprecation warning: https://github.com/Shopify/job-iteration/blob/v1.8.0/lib/job-iteration/iteration.rb#L223
Also I think typically one would write an EnumeratorBuilder by subclassing the one from JobIteration, so it would resolve the original wrapper in those cases.

@etiennebarrie etiennebarrie merged commit 75bde7b into main Dec 16, 2024
35 checks passed
@etiennebarrie etiennebarrie deleted the wrap-enumerators branch December 16, 2024 15:11
@etiennebarrie etiennebarrie mentioned this pull request Dec 18, 2024
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.

Weekly CI run failed
2 participants