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

[REG-2230] Operate on BotSegmentLists so we can do validations there #374

Closed
wants to merge 1 commit into from

Conversation

nAmKcAz
Copy link
Collaborator

@nAmKcAz nAmKcAz commented Dec 18, 2024

  • Changes the container to use lists of BotSegmentLists instead of lists of botsegments so that we can do validations at the BotSegmentList level
  • fixes the comment I made in your PR branch this morning by moving the validation execution code into ProcesssBotSegment
  • updates some code to pass the correct segment number into validation apis

Find the pull request instructions here

Every reviewer and the owner of the PR should consider these points in their request (feel free to copy this checklist so you can fill it out yourself in the overall PR comment)

  • The code is extensible and backward compatible
  • New public interfaces are extensible and open to backward compatibility in the future
  • If preparing to remove a field in the future (i.e. this PR removes an argument), the argument stays but is no longer functional, and attaches a deprecation warning. A linear task is also created to track this deletion task.
  • Non-critical or potentially modifiable arguments are optional
  • Breaking changes and the approach to handling them have been verified with the team (in the Linear task, design doc, or PR itself)
  • The code is easy to read
  • Unit tests are added for expected and edge cases
  • Integration tests are added for expected and edge cases
  • Functions and classes are documented
  • Migrations for both up and down operations are completed
  • A documentation PR is created and being reviewed for anything in this PR that requires knowledge to use
  • Implications on other dependent code (i.e. sample games and sample bots) is considered, mentioned, and properly handled
  • Style changes and other non-blocking changes are marked as non-blocking from reviewers

@nAmKcAz nAmKcAz requested a review from vontell December 18, 2024 13:59
@nAmKcAz nAmKcAz marked this pull request as ready for review December 18, 2024 14:04
Copy link
Collaborator

@vontell vontell left a comment

Choose a reason for hiding this comment

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

I'll check out the branch and see if it aligns with what I expect, but in the meantime just one comment around the logging of work on validations that are not technically running as part of a particular segment

// Also run the validations for the botsegmentList if they exist
foreach (var validation in _botSegmentListValidations)
{
validation.ProcessValidation(nextBotSegment.Replay_SegmentNumber);
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this is passing down the segment number, but the validation is not really part of that segment, it is part of that segment list as a whole... do we think this could confuse the user? This is why I used -1 for sequences, and then in the logs that gets converted to "SEQUENCE"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i want to see the active segment in the logs as this runs so I can see what segment I was on as the validation was running

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

they are absolutely being evaluated during that currently active segment, and should log as such

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if you want to also log that they are 'segmentlist' or 'sequence' validations as part of it, that would be fine, but I really want the active segment # on the front for all log messages

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good to me 👍 I can get behind that logic

Copy link
Collaborator

@vontell vontell left a comment

Choose a reason for hiding this comment

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

(forgot to mark as request changes)

@vontell
Copy link
Collaborator

vontell commented Dec 18, 2024

@RG-nAmKcAz this LGTM, and works with my sequences and bot segments but I have not tried bot segment list yet... let me just try that real quick

@nAmKcAz
Copy link
Collaborator Author

nAmKcAz commented Dec 18, 2024

@vontell feel free to merge (will go into your branch) ... as soon as you're done testing / happy with it

@@ -192,7 +209,7 @@ private void ProcessBotSegments()
{
if (_nextBotSegments.Count < 2)
{
var next = _dataPlaybackContainer.DequeueBotSegment();
var next = _dataPlaybackContainer.DequeueBotSegment(out _botSegmentListValidations);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@RG-nAmKcAz quick question on this actually regarding the lookahead logic. Does this mean that the currently running validation will be lost and replaced? I am not full understanding this code yet but I wanted to check if this means that validations that are currently running and not yet finished may then be running forever, since now we only operate on these new validations. Maybe we don't need to worry about that because we run StopValidations on the data container itself which does hold onto the reference...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i'll huddle with you on this

Stop I think we're fine

but you correctly point out that we may not be considering all the proper validations... I want to discuss if we get rid of this look ahead logic all together or not

@vontell
Copy link
Collaborator

vontell commented Dec 19, 2024

Closing this PR as it has now been merged into the other feature branch from #375

@vontell vontell closed this Dec 19, 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.

2 participants