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

[14.0][FIX] stock_request: write method to update state in _compute_state #2095

Closed
wants to merge 1 commit into from

Conversation

kaynnan
Copy link
Contributor

@kaynnan kaynnan commented Jul 2, 2024

cc @marcelsavegnago @ForgeFlow @victoralmau @pedrobaeza

As described in issue #2066, after implementing the compute_state method in stock_request, a conflict arose with stock_request_tier_validation. When an SRO had tier validation active and pending reviews, it was confirmed without considering the tier validation status.

Upon analyzing the code, I opted to use item.write to set the status instead of simply assigning it with =. Following this change, the behavior aligned with expectations, where each SR and SRO operates individually according to their tier validation. Prior to this, if an SR was confirmed with an SRO having pending reviews, the action was executed while ignoring the pending reviews.

@kaynnan kaynnan marked this pull request as draft July 3, 2024 00:37
@kaynnan kaynnan marked this pull request as ready for review July 3, 2024 00:39
@kaynnan kaynnan changed the title [14.0][FIX] stock_request: SR/SRO conflict where using tier.validation [14.0][FIX] stock_request: write method to update state in _compute_state Jul 3, 2024
Copy link

@WesleyOliveira98 WesleyOliveira98 left a comment

Choose a reason for hiding this comment

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

LGTM

@kaynnan
Copy link
Contributor Author

kaynnan commented Jul 9, 2024

ping @victoralmau @pedrobaeza

@pedrobaeza pedrobaeza added this to the 14.0 milestone Jul 9, 2024
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

This is incorrect. A compute method must never write nor create any data. You can use dot notation or update method, but never write.

@kaynnan
Copy link
Contributor Author

kaynnan commented Jul 9, 2024

This is incorrect. A compute method must never write nor create any data. You can use dot notation or update method, but never write.

For now I'll leave this pull request in draft while I search for solutions to resolve the compute method conflict with tier.validation, because it's ignoring validation based on the status of SRO when using update or dot notation.

@kaynnan kaynnan marked this pull request as draft July 9, 2024 13:27
@kaynnan kaynnan closed this Jul 11, 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.

4 participants