Skip to content

Forward platform_id and normalize job platform in blame_task - #5685

Open
Xeicker wants to merge 3 commits into
masterfrom
feature/swarming/blame-platform-normalization
Open

Xeicker wants to merge 3 commits into
masterfrom
feature/swarming/blame-platform-normalization

Conversation

@Xeicker

@Xeicker Xeicker commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Bug: 582825425

Context

blame_task runs on a trusted worker rather than the bot that hit the crash, and Swarming runs ANDROID_EMULATOR jobs inside Linux containers. Today:

  • _prepare_component_revisions_dict does not pass testcase.platform_id to revisions.get_component_revisions_dict, so config.json revision overrides fall back to the trusted worker's local platform_id instead of the testcase's.
  • _prepare_predator_message forwards raw testcase.platform, which can send 'linux' (or suffixed variant names like 'android_emulator' / 'linux_with_gpu') to Predator instead of canonical platform names.

Fix description

  • Add platform_id=None to _prepare_component_revisions_dict and forward platform_id=testcase.platform_id for crash, start, and end revision lookups.
  • Update ComponentRevisionPatchingTest.mock_get_component_revisions_dict to accept platform_id=None.
  • Query data_types.Job for testcase.job_type in _prepare_predator_message, prefer job.platform over testcase.platform, strip subqueue suffixes via environment.base_platform(platform).lower(), and normalize Android, Linux, Windows, and Mac variants to canonical lowercase names before publishing to Predator.

Testing

  • Added test_android_emulator_platform_normalized_and_platform_id_passed in blame_task_test.py.
  • Ran python butler.py py_unittest -t core -p blame_task_test.py (14/14 passing).
  • Ran python butler.py format and python butler.py lint (passing).

@Xeicker
Xeicker requested review from a team as code owners November 30, 2026 23:40

This branch has not been deployed

No deployments
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