-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Environment Checks #1093
base: master
Are you sure you want to change the base?
Environment Checks #1093
Conversation
gm4_animi_shamir/beet.yaml
Outdated
@@ -20,6 +20,7 @@ meta: | |||
required: | |||
gm4_metallurgy: 1.4.0 | |||
lib_player_death: 1.2.0 | |||
environment_checks: [gm4:score_on_non_player_entity] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was your reasoning for making this configurable? Is there any reason we wouldn't want to just check the environment in every module, especially since they all use scoreboards to initialize through lantern load.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's mostly true for this check, but not for all. E.g. lib_machines
needs command blocks to be enabled, but most modules don't need that. The same goes for world gen stuff.
If we prompt users to enable those features instead of opening a bug report with us (which is the point of this endeavour), we should only do so if said feature is really needed.
@@ -56,6 +57,26 @@ def modules(ctx: Context, opts: VersioningConfig): | |||
lines.append(f"execute if score {dep_id} load.status matches 1.. unless score {dep_id} load.status matches {dep_ver.major} run data modify storage gm4:log queue append value {log_data}") | |||
lines.append(f"execute if score {dep_id} load.status matches {dep_ver.major} unless score {dep_id}_minor load.status matches {dep_ver.minor}.. run data modify storage gm4:log queue append value {log_data}") | |||
|
|||
# add required environment checks | |||
for namespaced_environment_check in opts.environment_checks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I almost think we should only run environment checks on first install, instead of every reload? Also, we only need to perform each check once. Putting them into load makes each module run the same check again. Maybe we can finally utilize pre_load for this kind of setup check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would miss the edge case of importing an existing world to a new server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting them into load makes each module run the same check again
That's why these checks leave a score behind which is only reset post load. If the check was already done this reload, it won't need to check again and just uses the last result. That result is invalidated in post load, making sure the check is run again once next reload.
… up to Implementer
This allows echecks to provide a helpful "probable_cause" message
I have cleaned up the base python code to the point where I'm satisfied with functionality. Here's what's left to do:
|
This PR adresses #902.
Required environment checks are listed in a module's
beet.yaml
and are executed on/reload
(during load). If a check fails, the module will not be installed and an error is printed in chat, similar to a missing dependency.This PR is a draft on purpose. I am not that familiar with @SpecialBuilder32's versioning script, but wanted to get the ball rolling. Help is greatly appreciated.
Todo:
command_blocks_enabled
echeckworld_generation_resources_present
echeckAddtoo hardload_executed
echeck