)]}'
{
  "commit": "11133b3e593243868a7a5926dab4fec5d455df40",
  "tree": "dadb0b5228972a7b5be06454a68a4c06a36723f4",
  "parents": [
    "49d180fc773da54df63386c64790dbf8b7616735"
  ],
  "author": {
    "name": "Mark Elliot",
    "email": "123787712+mark-thm@users.noreply.github.com",
    "time": "Wed Jun 26 18:29:36 2024 -0400"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jun 26 22:29:36 2024 +0000"
  },
  "message": "fix: Fix broken logger statement in parse_requirements.bzl (#2017)\n\nparse_requirements.bzl includes a broken logger statement by passing a\nstring instead of a lambda. The result is that when a hash is no longer\navailable on pypi (say, due to a release being yanked) that rules_python\ncauses Bazel to halt. Since we use Bazel to generate requirements files,\nthis means the only solution is to use non-Bazel tooling to get back to\na functional state before then running Bazel tooling to update the\nrequirements file -- all down to a faulty log statement.\n\nThis PR corrects the faulty log statement. A more thorough fix might be\nto update the logger to warn if its invoked with a string instead of a\nlambda rather than failing.\n\nAn example traceback which led to this discovery:\n```\nERROR: Traceback (most recent call last):\n\tFile \".../external/rules_python~/python/private/bzlmod/pip.bzl\", line 472, column 52, in _pip_impl\n\t\tis_hub_reproducible \u003d _create_whl_repos(module_ctx, pip_attr, hub_whl_map, whl_overrides, hub_group_map, simpleapi_cache)\n\tFile \".../external/rules_python~/python/private/bzlmod/pip.bzl\", line 187, column 50, in _create_whl_repos\n\t\trequirements_by_platform \u003d parse_requirements(\n\tFile \".../external/rules_python~/python/private/parse_requirements.bzl\", line 348, column 37, in parse_requirements\n\t\twhls, sdist \u003d _add_dists(\n\tFile \".../external/rules_python~/python/private/parse_requirements.bzl\", line 452, column 24, in _add_dists\n\t\tlogger.warn(\"Could not find a whl or an sdist with sha256\u003d{}\".format(sha256))\n\tFile \".../external/rules_python~/python/private/repo_utils.bzl\", line 78, column 39, in lambda\n\t\twarn \u003d lambda message_cb: _log(0, \"WARNING\", message_cb),\n\tFile \".../external/rules_python~/python/private/repo_utils.bzl\", line 72, column 71, in _log\n\t\tprint(\"\\nrules_python: {}: \".format(level.upper()), message_cb())  # buildifier: disable\u003dprint\nError: \u0027string\u0027 object is not callable\n```\n\n---------\n\nCo-authored-by: Richard Levasseur \u003crlevasseur@google.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0cbf2f91ce1f165afb4ad44f397885d321da7ff2",
      "old_mode": 33188,
      "old_path": "CHANGELOG.md",
      "new_id": "9dc5ec4bcadb45797338f98044c7d94369ce1a12",
      "new_mode": 33188,
      "new_path": "CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "22a6f0a875324a72c8a925812e8827364f0269c1",
      "old_mode": 33188,
      "old_path": "python/private/pypi/parse_requirements.bzl",
      "new_id": "f99329a995ab277f28b0b90938394fea2620a31b",
      "new_mode": 33188,
      "new_path": "python/private/pypi/parse_requirements.bzl"
    }
  ]
}
