Repository navigation
Sync fxceless d510ee4: a hook this loader does not understand is left out, not the profile - #170
Merged
Merged
Conversation
… profile A profile written for this branch (a hook with `when` or `new_scale`) made an older build reject the whole file — `title profile not read: TOML parse error at line N` — and run with none of its hooks: the two that keep the title alive went with the three that ask for a resolution patch. Values now, the hooks are taken out of the document and read one at a time, so a hook carrying a field this version does not know is skipped on its own with one warning naming it (`hook "…" not placed: unknown field …`), and everything else in the profile still applies. The top level is read as strictly as before (`deny_unknown_fields`: a file that is not a profile at all is still rejected and reported), and only the `[[hooks]]` entries are read one at a time. - `profile::parse` does it; `load_dir` calls it. - Test: three hooks, the middle one with a field of a later loader; the other two load, in order. - `docs/title-profiles.md`: `when` and `new_scale` need this version, and what an older build does with a newer hook. Checked against a copy of the live profile with the pending resolution hooks appended (in /tmp, never the live file): `matched, 5 hooks`, 2 applied (the rest wait for their switches), imports bound with 0 missing; a copy with one unknown field logs the one warning and still binds. (cherry picked from commit 14b07b4)
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
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.
The profile loader is strict at every level:
deny_unknown_fieldsonHooktoo, so a profilewritten for a newer loader (a hook with
when/new_scale) made an older build reject the wholefile —
title profile not read: TOML parse error at line N— and run with none of its hooks.A live title profile has three render-scale hooks and two first-world hooks waiting for it: the two
that keep the title alive must not go with the three that wait.
Hooks are now taken out of the document and read one at a time: a hook carrying a field this
version does not know is skipped on its own with one warning naming it, and everything else in the
profile still applies. The top level is read as strictly as before — a file that is not a profile
is still rejected and reported.
profile::parsedoes it;load_dircalls it (crates/victory-core/src/profile.rs).docs/title-profiles.md: what an older build does with a newer hook.Credit: the change is ours (pablogonz12), written on the fxceless-fork sync branch.
Gates:
cargo xwin clippy --target x86_64-pc-windows-msvc --workspace --all-targets -- -D warnings: clean.cargo test -p victory-core --lib profile: 11 passed.--execute) on a copy of the live profile:build.toml matched, 2 hooks, every modulemissing=0;the same copy with one unknown field logs
hook "from a later loader" not placed: unknown field shinierandstill binds,
2 hooks.cargo xtask policy: 240 files ok. Asset grep empty.No behaviour change when profiles are well-formed, so no off switch. Not tested in a game run.
Summary by CodeRabbit