Skip to content

Use stable trace IDs instead of Python hash() #18

Description

@ANonABento

Problem

generate_uuid(...) currently derives Perfetto IDs with Python's built-in hash(...):

return hash(f"{workflow_run_id}_{attempt_number}_{job_id}_{step_id}") % (2**64)

Python hash randomization means the same workflow run can produce different IDs across separate Python processes. That makes generated traces harder to compare, cache, or diff, and can make tests flaky if they ever assert specific IDs.

Suggested fix

Use a deterministic hash such as hashlib.blake2b(..., digest_size=8), sha256(...).digest()[:8], or UUIDv5-derived bytes, then convert to an unsigned 64-bit integer.

Relevant file

  • src/github_actions_tracing/main.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions