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

Use status from->to to pick a transition to apply to an issue #63

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

marko-bekhta
Copy link
Member

No description provided.

Comment on lines 225 to 226
() -> findRequiredTransitionId(downstreamStatus, destIssue))
.orElseGet(() -> findRequiredTransitionId(downstreamStatus, destIssue).orElse(null)))
Copy link
Member

Choose a reason for hiding this comment

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

This duplicate findRequiredTransitionId call is suspicious... Can statusToTransition actually return an empty optional here? If it does, doesn't it mean findRequiredTransitionId returned an empty optional and thus isn't useful?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that was a bad choice 🙈
The thing is that the transition is cached, but that first attempt to call findRequiredTransitionId may end up failing for some reason (since it's a rest call), so that was a silly attempt to still try and get a transition if it cached the failed attempt (null) BUT why would one cache the null in the first place!? 🤦🏻‍♂️
It should be better now with nulls not cached.

@marko-bekhta marko-bekhta force-pushed the feat/change-status-transition-handling branch from 3bb733d to ca89e92 Compare November 29, 2024 14:23
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