py/aio.api.bazel: Code review notes#4425
Closed
Copilot wants to merge 2 commits into
Closed
Conversation
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/3729b033-dede-452f-84a2-33426e08a035 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add code quality report for py/aio.api.bazel
py/aio.api.bazel: Code review notes
May 10, 2026
This was referenced May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deep second-pass code-quality review of
py/aio.api.bazel, following the initial packaging cleanup PR. Adds a single new file — no source changes.py/aio.api.bazel/REVIEW.mdStructured findings across 12 categories with GitHub permalinks, effort/risk ratings, and 10 prioritised follow-up PRs. Top correctness issues identified:
cwdsilently dropped inABazelRun.run— parameter accepted, never forwarded tosubproc_runbazel_startup_optionsomitted frombazel run(present inquery_command, absent inrun)_dumpalways emitsexit_code=0— worker protocol reports success even on handler exceptions (# TODO: add error handlingleft unresolved)# TODO: implement one-shot op)subprocess.runin a thread-pool executor orphans Bazel processes on task cancel;asyncio.create_subprocess_execwould fix this natively[""]not[]—"".split("\n")behaviour unguardedsubprocessinvocations, return codes, or Bazel stderr captured in the loggerAdditional findings cover:
ABazel/ABazelCommandhierarchy that earns no abstraction, four empty concrete classes inbazel.py, type-annotation gaps (listvslist[str], untyped*args/**kwargs, unjustified# type:ignore), test cases that mirror broken implementation (no assertion thatcwdor startup options are forwarded), copy-paste docstring onABazelEnv.run, and a one-sentence README.Original prompt
Deep code-quality review of
py/aio.api.bazelDeliverable: a single PR that adds one new markdown file containing a structured code-quality / code-smell report for
py/aio.api.bazel. No code changes — report only.Where to put the file
What the report must cover
This is a deeper second-pass review that follows the in-flight initial cleanup PR (packaging metadata fixes including
name = aio_api_bazel→aio.api.bazeland the bogusurl = https://bazel.com/..., lower dep bounds, mechanical Py3.12+ typing/syntax modernisation). Explicitly skip anything already covered by that initial pass.Investigate and categorise findings under at least these headings (omit a heading if you genuinely find nothing, but be thorough across every module and test file):
shell=True, unsanitised arguments, missingcwddiscipline, output capture/streaming correctness, exit-code handling, signal/cancel propagation, environment leakage.await, accidental coroutine objects, unbounded concurrency, sync I/O on the event loop, blocking subprocess calls inside async functions,async-for-async's-sake.query/cquery/aqueryoutput parsing edge cases, malformed-output handling, escaping/quoting bugs, locale assumptions.@cached_property/functools.cacheusage, cache-key bugs, caches that don't actually cache or grow unboundedly.except:, swallowed exceptions,raise … from Nonehiding root causes, missing context in re-raises.printcalls, inconsistent log levels, f-string-formatted logs vs%slazy formatting, swallowed bazel stderr.Any-soup, missing return annotations on public functions, structural types that should beProtocols,# type: ignorewithout justification.assert_called_once_withoveruse, slow/flaky tests.README.rstaccuracy.Format of the report
Use this structure (markdown):
Rules
#L10-L42) pointing at the commit SHA reviewed.py/aio.api.bazel: Code review notes.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: @copilot Accepted Confirmation: Confirm agent session
User: @copilot Accepted Confirmation: Confirm agent session
User: @copilot Accepted Confirmation: Confirm agent session
Assistant: All three are now dispatched.