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

Options: Always verify keys for VerifyKeys options #3280

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alwaysintreble
Copy link
Collaborator

What is this fixing or adding?

alternative to #3274 which just makes sure that verify_keys() is always called for VerifyKeys subclasses instead of just randomly?

How was this tested?

https://discord.com/channels/731205301247803413/731214280439103580/1237762707550371960

If this makes graphical changes, please attach screenshots.

@github-actions github-actions bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels May 8, 2024
@alwaysintreble alwaysintreble added the is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. label May 8, 2024
@NewSoupVi
Copy link
Collaborator

Haven't tested it, but this looks and feels correct to me

Copy link
Collaborator

@agilbert1412 agilbert1412 left a comment

Choose a reason for hiding this comment

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

I can approve the stardew test changes, not sure about the core changes. I don't have an opinion as to if it's better than #3274

Copy link
Contributor

@MatthewMarinets MatthewMarinets left a comment

Choose a reason for hiding this comment

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

A useful fix, but it's difficult to tell what the impact is as these functions are a little under-documented. Some extra docstrings / being explicit about what you expect from the error message would be appreciated, but I wouldn't call it required to merge.

Options.py Show resolved Hide resolved

def verify(self, world: typing.Type[World], player_name: str, plando_options: "PlandoOptions") -> None:
self.verify_keys()
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we get a docstring on this function so implementers of custom option types know what actually has to be implemented here? I'm still confused by why a method named verify() is mutating itself, and I think the fact that its method of returning an error is to raise an exception rather than having a return value is also of note. Is the exception error message user-facing? When is this function called during generation? Do I have to call it manually in my options unit tests? etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is a bug fix, docs are extremely out of scope.
https://github.com/ArchipelagoMW/Archipelago/blob/main/Generate.py#L411
the only modifications that verify does is unfolding item and location groups into item and location names to actually be used by generation later.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fair. Again, good to call this comment thread resolved.

Is there an issue / discord thread somewhere where the docs are in the works / where I can ask these questions in general? Ideally I'd think there would be a separate function that would mutate / preprocess / expand out groups in a setting, and this would be documented somewhere (as well as whether that function runs before or after verify). I don't want to clutter up a simple bugfix PR with design / doc talk, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nothing specific but that's what ap-world-dev is for

@Exempt-Medic Exempt-Medic added waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer. and removed waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants