Skip to content

Consolidate Untrusted Tasks to Preprocess Queue & Support Platform Filtering in ENABLE_FUZZ_FOR_BOTS - #5412

Open
javanlacerda wants to merge 4 commits into
masterfrom
javan.consolidate-untrusted-tasks
Open

Consolidate Untrusted Tasks to Preprocess Queue & Support Platform Filtering in ENABLE_FUZZ_FOR_BOTS#5412
javanlacerda wants to merge 4 commits into
masterfrom
javan.consolidate-untrusted-tasks

Conversation

@javanlacerda

@javanlacerda javanlacerda commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Those changes enforces that all UTasks are scheduled in the preprocess queue, assuring it would have the main stage being executed in a remote untrusted environment.

In other hand, it ensure that the Trusted tasks are scheduled to the jobs queues, to be processed by the bots in the no io mode (pre, main and pos in the same host)

Summary

  1. Centralized Automatic Queue Routing for RemoteTasks Architecture:
    • Uses COMMAND_TYPES in task_types.py as the single source of truth to classify tasks into untrusted (BaseUTask -> UTask) and trusted (TrustedTask).
    • Automatically routes all untrusted tasks (analyze, corpus_pruning, fuzz, minimize, progression, regression, symbolize, variant) to PREPROCESS_QUEUE (or SWARMING_QUEUES[PREPROCESS_QUEUE]) inside add_task().
    • Leaves helper functions (queue_for_platform, queue_for_job, queue_for_testcase) and existing callsites completely untouched for zero disruption.
    • Maps 'fuzz': UTask in COMMAND_TYPES.
  2. Platform Filtering in ENABLE_FUZZ_FOR_BOTS:
    • Checks if environment.platform().lower() is in the comma-separated FeatureFlags.ENABLE_FUZZ_FOR_BOTS.string_value before allowing idle long-lived bots to pull local fuzz tasks.

Changes

  • task_types.py:
    • Changed 'fuzz': UTaskLocalExecutor to 'fuzz': UTask in COMMAND_TYPES.
    • Added is_trusted_task and is_untrusted_task helpers derived directly from COMMAND_TYPES.
    • Deferred pub_sub_task_queue import into UTask.preprocess to avoid circular dependency.
  • tasks/__init__.py:
    • In add_task(), automatically route untrusted tasks (is_untrusted_task(command)) to PREPROCESS_QUEUE (or SWARMING_QUEUES[PREPROCESS_QUEUE]).
    • Added platform filtering to get_task() via FeatureFlags.ENABLE_FUZZ_FOR_BOTS.
  • tasks_test.py:
    • Added unit test suites GetTaskFuzzingFeatureFlagTest and TaskQueueResolutionTest.

Verification

  • Unit tests passed: pipenv run python butler.py py_unittest -t core -p tasks_test.py
  • Unit tests passed: pipenv run python butler.py py_unittest -t core -p task_types_test.py
  • Linting passed: pipenv run python butler.py lint
  • Formatting verified: pipenv run python butler.py format

@javanlacerda
javanlacerda requested a review from a team as a code owner August 5, 2026 13:42
@javanlacerda
javanlacerda force-pushed the javan.consolidate-untrusted-tasks branch from 92f87ad to 9c0717a Compare August 6, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant