Repository navigation
fix: wait for the 20-minute review guide Lambda #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -723,11 +723,16 @@ def run_review_guide(service_url: str, data: bytes, headers: dict, artifact: Pat | |
| if "x-llm-provider" in headers and "x-llm-api-key" not in headers: | ||
| raise Skip("the service cannot call this run's provider") | ||
| keep_bundle(artifact, data) | ||
| answer = _post(f"{service_url.rstrip('/')}/v1/review-guide", data, headers) | ||
| # Allow the 20-minute journey Lambda to finish and return its response. | ||
| print("Journey analysis: sending /v1/review-guide request; waiting for the service response.") | ||
| answer = _post(f"{service_url.rstrip('/')}/v1/review-guide", data, headers, timeout=21 * 60) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blocker-ish: Lambda maxes out at 15 min, and I think #84's |
||
| guide = answer.get("guide") | ||
| if not isinstance(guide, dict): | ||
| raise ValueError("the service returned no guide") | ||
| (artifact / "review_guide.json").write_text(json.dumps(guide, ensure_ascii=False, indent=1)) | ||
| journeys = guide.get("journeys") | ||
| count = f" ({len(journeys)} journeys)" if isinstance(journeys, list) else "" | ||
| print(f"Journey analysis: saved review_guide.json{count}.") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: the new lines say "Journey analysis:" but the notice below still says "review-guide failed". Same prefix for both would make grepping the logs easier. |
||
| except Exception as error: | ||
| print(f"::notice::review-guide {'skipped' if isinstance(error, Skip) else 'failed'}: {error}") | ||
|
|
||
|
|
@@ -846,6 +851,7 @@ def _guide_and_architecture(pool, service_url: str, ctx: dict, bearer: dict, env | |
| architecture's envelope, which records why when neither request went out.""" | ||
| try: | ||
| headers = {**bearer, **model_headers(env)} | ||
| print("Journey analysis: preparing the analysis bundle.") | ||
| guide_request, architecture_request = _requests(ctx, collect(env), env) | ||
| except TooLarge as error: | ||
| print(f"::notice::review-guide skipped: {error}") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also wondering about cost: on private repos the customer pays runner minutes while we wait on our Lambda, now up to ~15 min per review. Not for this PR, but maybe worth a ticket to make the guide async (the Lambda stores it, the platform picks it up) instead of holding the job open?