Repository navigation
Conversation
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Record the two deviations of the inactivity log from BootUI 2.6.0 in a matrix fragment, update the MVP plan text that still described the old log line, extract the inactivity logging of install() into a helper to keep its complexity at the pinned count, and wrap one over-long test assertion. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED must log exactly one record, the fixed warning, as BootUI does. The count of the remaining configuration warnings stays. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED is already reported by the fixed inactive warning. Counting its settings warning as well produced a second WARNING record, where BootUI logs one. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…tests Port BootUiInactiveStartupDiagnosticTests.deliberateDisablementIsSilentAtInfo, cite the BootUI tests the other inactivity tests port, and keep the expected log texts in one test module. A single Inactivity alias types the inactivity category. The matrix row for the warning count records that it leaves out the invalid SHARPIT_ENABLED warning. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
This branch has not been deployed
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.
Summary
Task 1.4 of the 0.11.0 plan (#367), row S11 of the BootUI 2.6.0 delta: when sharpit is inactive, its startup log uses
fixed texts and BootUI's levels, and never a configured value.
src/sharpit/engine/activation.py:ActivationStatus.inactivity(auto,off,disabled-profile,invalid, orNonewhen enabled), set bydecide, not part ofto_dto()(the overview contract is unchanged);inactivity_message()returns the level and fixed text, ported from BootUI 2.6.0BootUiShellGuardAutoConfiguration.bootUiInactiveStartupDiagnostic:sharpit is inactive in AUTO mode: no enabled profile is active and no reloading development server was detected. For local development, activate a SHARPIT_ENABLED_PROFILES profile or set SHARPIT_ENABLED=ON.OFF, DEBUG:sharpit is inactive: SHARPIT_ENABLED=OFF.sharpit is inactive: an active profile matches SHARPIT_DISABLED_PROFILES.SHARPIT_ENABLED, WARNING:sharpit is inactive: invalid SHARPIT_ENABLED configuration (fail-closed). Use AUTO, ON, or OFF.src/sharpit/fastapi/install.py: the inactive branch logs that text instead ofsharpit inactive: <reason>(thereason can name a profile or echo a raw invalid value). Settings warnings are logged only while sharpit is active;
while inactive, one WARNING gives their number, leaving out the invalid
SHARPIT_ENABLEDwarning that the fixed textalready reports. The repeated-install warning no longer quotes the earlier install's reason. The
WARNINGescalation for "requested but inactive" is removed: the levels are BootUI's.
docs/reference/matrix-updates/0.11.0-activation.tsv: two adapted rows (the renamed texts; the warning count).Behaviour change for users: an explicit
OFFor a disabled profile now logs at DEBUG (previously INFO or WARNING), asBootUI does.
Red evidence
All new tests were run against a commit with the tests and stub interfaces only (
inactivityfield andinactivity_messagereturningNone), so each red is an assertion, not an import error.SHARPIT_ENABLEDvaluetests/fastapi/test_install.py::test_inactivity_log_carries_no_invalid_enabled_valueRED (assertion under tests/)tests/fastapi/test_install.py::test_inactivity_log_carries_no_profile_nameRED (assertion under tests/)tests/fastapi/test_install.py::test_invalid_enabled_value_cannot_forge_a_log_lineRED (assertion under tests/)tests/fastapi/test_install.py::test_auto_inactivity_does_not_echo_custom_profiles_or_pathRED (assertion under tests/)OFFlogs above DEBUGtests/fastapi/test_install.py::test_explicit_off_only_logs_at_debugRED (assertion under tests/)tests/fastapi/test_install.py::test_disabled_profile_only_logs_at_debugRED (assertion under tests/)tests/fastapi/test_install.py::test_inactive_install_logs_warning_count_not_valuesRED (assertion under tests/)tests/fastapi/test_install.py::test_repeated_install_log_carries_no_configured_valueRED (assertion under tests/)tests/fastapi/test_install.py::test_inactive_logs_a_fixed_textRED (assertion under tests/)tests/engine/test_activation.py::test_inactivity_category_per_branchRED (assertion under tests/)tests/engine/test_activation.py::test_inactivity_message_levels_and_textsRED (assertion under tests/)Review findings
SHARPIT_ENABLEDlogged two WARNINGs (the fixed text and a count of 1 for the same cause); BootUI logs onetests/fastapi/test_install.py::test_invalid_enabled_value_cannot_forge_a_log_line(now asserts exactly one record)RED (assertion under tests/)tests/fastapi/test_install.py::test_invalid_enabled_value_still_counts_other_warningsRED (assertion under tests/)deliberateDisablementIsSilentAtInfonot portedtests/fastapi/test_install.py::test_deliberate_disablement_is_silent_at_infoOFFturns it redprivate-active-profile# ported:citation named BootUI's private helperassertSingleDiagnostic, not a testtests/test_ported_citations.py::test_ported_citations_resolve_in_bootui_test_inventorynew unresolved citation: BootUiInactiveStartupDiagnosticTests.assertSingleDiagnosticOther review items:
# ported:citations added, the expected texts kept in one test helper, oneInactivitytypealias, and the nothing-configured test clears the whole activation environment.
Follow-up outside this change: settings warnings echo raw invalid values while sharpit is active (tracked separately).
Verification
uv run ruff check,uv run ruff format --check,uv run pyright(0 errors);uv run pytest -q -n 4 tests/engine/test_activation.py tests/fastapi/test_install.py tests/test_settings.py tests/test_settings_05.py tests/engine/config/test_settings_source.py tests/test_code_shape.py(515 passed).