Copilot commented on code in PR #496:
URL: https://github.com/apache/hugegraph-doc/pull/496#discussion_r4073774400
##########
scripts/versioning.py:
##########
@@ -4068,30 +4070,10 @@ def build(args: argparse.Namespace) -> None:
json.dumps(override, ensure_ascii=False), encoding="utf-8"
)
hugo = os.environ.get("HUGO_BIN", "hugo")
- go = os.environ.get("GO_BIN", "go")
- go_executable = shutil.which(go)
+ go_executable = shutil.which(os.environ.get("GO_BIN", "go"))
if go_executable is None:
- fail(f"Go executable is unavailable: {go}")
- module_result = subprocess.run(
- [
- go_executable,
- "mod",
- "download",
- "-json",
- "github.com/pgsty/[email protected]",
- ],
- cwd=assembly,
- check=True,
- stdout=subprocess.PIPE,
- text=True,
- )
- module = json.loads(module_result.stdout)
- if (
- module.get("Path") != "github.com/pgsty/oink"
- or module.get("Version") != "v1.0.0"
- or module.get("Sum") !=
"h1:E+WHFP9zSRT+5RKoIkWNp+ASRGS1BKG+rDEi9by/BjE="
- ):
- fail(f"unexpected OINK module metadata: {module!r}")
+ fail("Go executable is unavailable")
Review Comment:
The new failure message drops the actionable context that existed before
(which GO_BIN value was used / what executable was being searched for).
Consider including the effective `GO_BIN` value (or attempted executable name)
in the error message to make misconfiguration/debugging in CI and local
environments easier.
##########
assets/js/kapa-adapter.js:
##########
@@ -244,23 +256,49 @@
renderState('idle', '');
if (consent && consent.open) consent.close();
restoreFocus();
+ settle();
}
- function activate(query, submit, trigger) {
+ function activate(query, submit, trigger, context) {
if (state === 'loading' || state === 'consent') return;
+ if (context && context.signal.aborted) return Promise.resolve();
Review Comment:
When activation is invoked via the OINK command-palette search-tail
extension, callers may `await` the return value; returning `undefined` while
`state` is `loading`/`consent` makes the return type inconsistent (sometimes a
Promise, sometimes `undefined`). This can break cancellation/settlement
expectations and can cause runtime errors in consumers that always treat
`activate()` as async. Return a settled Promise in the early-exit path (and, if
applicable, consider returning the in-flight `completion` for the current
operation) so `activate` has a stable async contract.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]