Skip to content

Commit 2520a2d

Browse files
committed
register config key so its available
1 parent f6e1c8b commit 2520a2d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sphinxdocs/private/sphinx_build.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
_WORKER_SPHINX_EXT_MODULE_NAME = "bazel_worker_sphinx_ext"
2020

21+
# Config value name for getting the path to the request info file
22+
_REQUEST_INFO_CONFIG_NAME = "bazel_worker_request_info_path"
23+
2124

2225
class Worker:
2326

@@ -75,7 +78,7 @@ def run(self) -> None:
7578
except Exception:
7679
logger.exception("Unhandled error: request=%s", request)
7780
output = (
78-
f"Unhandled error:\nRequest: {request}\n"
81+
f"Unhandled error:\nRequest id: {request.get('id')}\n"
7982
+ traceback.format_exc()
8083
)
8184
request_id = 0 if not request else request.get("requestId", 0)
@@ -133,7 +136,7 @@ def _prepare_sphinx(self, request):
133136
request_info_path = os.path.join(srcdir, "_bazel_worker_request_info.json")
134137
with open(request_info_path, "w") as fp:
135138
json.dump(request_info, fp)
136-
sphinx_args.append(f"--define=bazel_worker_request_info={request_info_path}")
139+
sphinx_args.append(f"--define={_REQUEST_INFO_CONFIG_NAME}={request_info_path}")
137140

138141
return worker_outdir, bazel_outdir, sphinx_args
139142

@@ -192,6 +195,7 @@ def __init__(self):
192195
self.changed_paths = set()
193196

194197
def setup(self, app):
198+
app.add_config_value(_REQUEST_INFO_CONFIG_NAME, "", "")
195199
app.connect("env-get-outdated", self._handle_env_get_outdated)
196200
return {"parallel_read_safe": True, "parallel_write_safe": True}
197201

0 commit comments

Comments
 (0)