Skip to content

feat(market-research-agent): restore recipe as a deployable contrib recipe - #2831

Open
nikhithajoy wants to merge 5 commits into
google:mainfrom
nikhithajoy:feat/market-research-agent-deployable
Open

nikhithajoy wants to merge 5 commits into
google:mainfrom
nikhithajoy:feat/market-research-agent-deployable

Conversation

@nikhithajoy

Copy link
Copy Markdown
Contributor

Summary

Restores `contrib/python/market-research-agent`, originally merged in #1391 and removed in #2756 because it lacked a root `Dockerfile` and `deployable: true`.

Changes

  • Added a root `Dockerfile`, `.dockerignore` and `agents-cli-manifest.yaml` using the `make-python-recipe-deployable` skill
  • Added the FastAPI/A2A serving files (`app/fast_api_app.py`, `app/app_utils/`)
  • Set `deployable: true` in `manifest.yaml`
  • Upgraded to `google-adk` 2.x and aligned dependency pins with `.github/policy.yml` (no agent code changes needed)
  • Added `tests/conftest.py` so unit tests run without a `.env`

Test plan

  • `uv run validate contrib/python/market-research-agent`: all checks pass
  • `pytest tests/`: 12 passed
  • `ruff check`: clean
  • Docker image builds (linux/amd64); container serves `/list-apps` (200) and the A2A agent card (200)"

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated House Rules review — 2 finding(s).

project_id = None

allow_origins = (
os.getenv("ALLOW_ORIGINS", "").split(",")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] env read carries a hardcoded default (second argument is a hardcoded default); 8 occurrence(s) across 4 file(s). Defaults belong in .env.example, not in the code (contrib/python/market-research-agent/app/fast_api_app.py:44; and 5 more)

- "Vertex AI"

ownership:
team: "nikhithajoy"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] ownership.team and poc are both "nikhithajoy". One of the two is wrong: team is the owning team and poc is a person, so a single value cannot be both, and whichever one is the personal handle leaves the recipe unowned the moment that person moves (.github/schemas/manifest-schema.json (ownership.team))

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Security review — 3 finding(s).


Round 1 · 0 of this PR's 25 automated comments used · this round is capped at 20 across all reviewers.


EXPOSE 8080

CMD ["uv", "run", "uvicorn", "app.fast_api_app:app", "--host", "0.0.0.0", "--port", "8080"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MAJOR] Can you please add a non-root USER before the container entrypoint? The container currently runs as root.

Returns:
JSON string with lat, lng, and formatted_address fields.
"""
async with httpx.AsyncClient() as client:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MAJOR] Can you please specify an explicit timeout on httpx.AsyncClient()? There are 4 outbound client calls across this file without one.

)
async with httpx.AsyncClient() as client:
resp = await client.get(
f"{_PLACES_BASE_URL}/{resource}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MAJOR] Can you please validate or URL-encode place_id before constructing the URL? An unsanitised value could traverse the API path or inject query parameters.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Maintainability review — 4 finding(s).


Round 1 · 0 of this PR's 25 automated comments used · this round is capped at 20 across all reviewers.

``APP_URL``). Call once per app — typically in a FastAPI ``lifespan``, since
the card is built asynchronously; repeated calls register duplicate routes.
"""
resolved_app_url = app_url or os.getenv("APP_URL", "http://0.0.0.0:8000")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] Is there a reason for hardcoding defaults on environment reads here? Defaults belong in .env.example, and there are 4 instances across the recipe.

@pytest.mark.asyncio
async def test_geocode_address_handles_failure(self):
mock_response = {"status": "ZERO_RESULTS", "results": []}
with patch("httpx.AsyncClient") as mock_client_cls:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] Can we extract this httpx mock setup into a shared pytest fixture? It is duplicated across four tests in this class.

},
headers={
"X-Goog-Api-Key": _api_key(),
"X-Goog-FieldMask": (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] duplicate field mask string

attach_reasoning_engine_routes,
)

load_dotenv()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] is this still needed?

@github-actions

Copy link
Copy Markdown
Contributor

There is a problem with the Antigravity CLI Correctness PR review. Please check the action logs for details.

@github-actions github-actions Bot added the status/not-ready-for-review Review requests held until checks pass and bot comments are resolved label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Ready for review. All checks pass.

Re-requested review from tommywagz.

@nikhithajoy

Copy link
Copy Markdown
Contributor Author

@tommywagz The remaining failing check (test_routing_rules_sync_with_codeowners_and_workflow) also fails on main. #2826 added /core/python/genmedia-for-commerce/** to .github/CODEOWNERS but not to ROUTING_RULES in .github/scripts/process_issue_response.py or the routing list in .github/workflows/_ai-issue-response-core.yml. All of this recipe's own checks pass. Happy to open a separate fix PR if that helps.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated House Rules review — 1 finding(s).


import os

os.environ.setdefault("MODEL_NAME", "gemini-3.5-flash")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] env read carries a hardcoded default (second argument is a hardcoded default); 8 occurrence(s) across 4 file(s). Defaults belong in .env.example, not in the code (contrib/python/market-research-agent/tests/conftest.py:26; and 5 more)

@github-actions github-actions Bot removed the status/not-ready-for-review Review requests held until checks pass and bot comments are resolved label Nov 18, 2026
…tainer, httpx timeouts, place_id validation, env defaults)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant