automate_observation: warn about ignored flag combinations - #36
Merged
Merged
Conversation
Some flags are silently ignored depending on what they are combined with. Log a warning at startup for each: - --check_preinstalled_only, --verifier_path, --no_prefetch, --cache_dir, --cache_prefetch_concurrency and --cache_prefetch_timeout without --perform_inclusion_proof_check. - --cache_prefetch_concurrency and --cache_prefetch_timeout with --no_prefetch, since only pre-fetching reads them. - --pull-all-apks with --pull-preinstalled-apks-only, where only pre-installed APKs are pulled. Integer flags count only when set to a non-default value. These are warnings, not errors, so existing invocations keep working and exit codes are unchanged; the only difference is the new log lines for these combinations. The checks live in a pure function, validate_argument_combinations(), so other tools can reuse the rules. Test: - pytest uraniborg/scripts/python/tests/: 150 passed (21 new). - Live on an Android 14 emulator with four ignored inclusion-proof flags: four warnings at startup, run otherwise unchanged (exit 0). - Real process with --perform_inclusion_proof_check --no_prefetch and both tuning flags: both warnings logged, --cache_dir not flagged. Change-Id: I49800dc522b5d1c4939749fe0d3812482adb6b6c
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.
Some flags are silently ignored depending on what they are combined with. Log a warning at startup for each:
Integer flags count only when set to a non-default value. These are warnings, not errors, so existing invocations keep working and exit codes are unchanged; the only difference is the new log lines for these combinations. The checks live in a pure function, validate_argument_combinations(), so other tools can reuse the rules.
Test:
Change-Id: I49800dc522b5d1c4939749fe0d3812482adb6b6c