Fix spacetime generate ignoring module-path from spacetime.json#4491
Closed
clockwork-labs-bot wants to merge 1 commit intomasterfrom
Closed
Fix spacetime generate ignoring module-path from spacetime.json#4491clockwork-labs-bot wants to merge 1 commit intomasterfrom
spacetime generate ignoring module-path from spacetime.json#4491clockwork-labs-bot wants to merge 1 commit intomasterfrom
Conversation
When spacetime.json has module-path but no generate entries:
{ "module-path": "server-rust" }
the generate command ignored it and defaulted to 'spacetimedb'.
Root cause: get_filtered_generate_configs() only processes targets with
generate entries. When none exist, exec_ex() fell back to creating a
CommandConfig with an empty HashMap, discarding all config values.
Fix: pass through the top-level additional_fields from the loaded config
so module-path (and other entity-level fields) are preserved.
Closes #4475
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
spacetime.jsonhasmodule-pathbut nogenerateentries:{ "module-path": "server-rust" }spacetime generateignores the configured path and defaults tospacetimedb/.Root Cause
get_filtered_generate_configs()only processes targets that havegenerateentries. When no generate entries exist,exec_ex()falls back to creating aCommandConfigwith an emptyHashMap, discarding all config values includingmodule-path.Fix
When
get_filtered_generate_configs()returns empty but a config was loaded, pass through the top-leveladditional_fieldsfrom the loaded config (which includesmodule-path,database,server, etc.) to the fallbackCommandConfig.Testing
New test:
test_module_path_from_config_without_generate_entries— verifies thatmodule-pathfrom config is used when no generate entries are present.Closes #4475
Note: There is also a community PR #4482 for the same issue. This PR takes a different approach — instead of modifying
get_filtered_generate_configsto synthesize a generate entry, it passes through the existing config fields at theexec_exlevel.