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

config: require owner only if no owner_account is set #2114

Closed
wants to merge 1 commit into from

Conversation

dgw
Copy link
Member

@dgw dgw commented Jun 21, 2021

Description

This shifts validation of the core.owner setting from the base StaticSection class to CoreSection, by unmarking it as required (removing default=NO_DEFAULT) and checking the values after loading and validating the section has succeeded via super().

Comes with its own tests to validate the new behavior (a habit we should continue trying to keep up).

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

Notes

Will need to undo #2112 once that's merged, and remove any other references to owner being required no matter what.

Would have loved to raise ConfigurationError instead of ValueError, but config imports config.core_section:

ImportError: cannot import name 'ConfigurationError' from partially initialized module 'sopel.config' (most
likely due to a circular import) (/mnt/c/Users/dgw/github/sopel/sopel/config/__init__.py)

This shifts validation of the `core.owner` setting from the base
`StaticSection` class to `CoreSection`, by unmarking it as required
(removing `default=NO_DEFAULT`) and checking the values after loading
and validating the section has succeeded via `super()`.

Comes with its own tests to validate the new behavior (a habit we should
continue trying to keep up).
@dgw dgw added this to the 8.0.0 milestone Jun 21, 2021
@dgw dgw requested a review from a team June 21, 2021 05:10
@dgw
Copy link
Member Author

dgw commented Jun 28, 2021

We actually have to keep requiring core.owner be set to the owner's nickname, even if core.owner_account is being used for auth. Sopel itself uses core.owner as the recipient for important messages/notices such as when a new version is available, or if something goes wrong during a netsplit and the bot loses its main nick. (Some third-party plugins surely also do similar things.)

I'm reworking the docs again instead, on top of the just-merged #2112; too bad I didn't think of this until after merging that.

@dgw dgw closed this Jun 28, 2021
@dgw dgw added the Declined Requests that will not be implemented for technical or project direction reasons label Jun 28, 2021
@dgw dgw removed this from the 8.0.0 milestone Jun 28, 2021
@dgw dgw removed the request for review from a team June 28, 2021 05:26
@dgw dgw deleted the owner-OR-owner_account branch June 28, 2021 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Declined Requests that will not be implemented for technical or project direction reasons Documentation Medium Priority Tweak
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant