Skip to content

Release 0.12.7#273

Merged
khoroshevskyi merged 17 commits intomasterfrom
dev
Apr 22, 2026
Merged

Release 0.12.7#273
khoroshevskyi merged 17 commits intomasterfrom
dev

Conversation

@khoroshevskyi
Copy link
Copy Markdown
Member

@khoroshevskyi khoroshevskyi commented Apr 22, 2026

Changes:

  • Migrated starlette to version 1.0.0
  • Migrated yacman to version 1.0.0
  • Added preview link generation

Wait for:

TODO:

  • Version of pepdbagent updated in __version__.py file
  • Changelog updated

nsheff and others added 11 commits April 20, 2026 16:39
Starlette 1.0.0 is now the installed version (pulled in by an unrelated
CI rebuild on 2026-04-16). This commit migrates the codebase to the
Starlette 1.0 idioms that replace the removed/deprecated pre-1.0 APIs.

- TemplateResponse: use (request, name, context) signature; drop
  request from the context dict (was causing TypeError: unhashable
  type: 'dict' on GET /v1).
- Lifespan handler replaces module-import-time global state
  (BackgroundScheduler, bbagent, usage_data, ref_validator) with
  app.state + FastAPI Depends() injection in dependencies.py.
- Pydantic v2 / FastAPI 0.100+ kwargs: regex= -> pattern=,
  example= -> examples=[...] in data_models.py.
- starlette.responses imports -> fastapi.responses in helpers.py.
- Duplicate endpoint function names renamed (get_bedbase_db_stats x3,
  get_bedset_metadata x3, embed_bed_file x2, get_tokens x2) to
  unblock request.url_for(name=...) lookups.
- HTTPException(status_code=...) calls in bed_api.py get explicit
  detail=; fix return HTTPException(...) -> raise.
- uvicorn.run("bedhost.main:app", ...) import-string form.
- dependencies.py no longer imports from main; fetch_detailed_stats
  takes bbagent as argument.

No version pins added. No backwards-compatibility shims.
When BEDHOST_INIT_ML=false, app.state.ref_validator is None.
Previously analyze_reference_genome would unconditionally call
ref_validator.determine_compatibility, raising AttributeError
and returning 500. Return a clean 503 instead.
Copilot AI review requested due to automatic review settings April 22, 2026 15:45
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 22, 2026

Deploying bedhost-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0a2aa1f
Status: ✅  Deploy successful!
Preview URL: https://6792da40.bedhost.pages.dev
Branch Preview URL: https://dev.bedhost.pages.dev

View logs

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Release 0.12.7 updates dependencies and refactors the FastAPI app to use lifespan + dependency injection, while adding support for per-BED Open Graph preview images.

Changes:

  • Refactor app initialization to FastAPI lifespan and inject bbagent / usage / ref validator via Depends.
  • Add a /v1/bed/{bed_id}/og-image endpoint and wire the UI worker to use it for BED link previews.
  • Update Python dependencies and bump package version to 0.12.7.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
ui/worker.ts Uses API-generated OG images for BED pages.
requirements/requirements-all.txt Updates bbconf/yacman/bedboss and adds deps needed for new functionality (e.g., Pillow).
bedhost/routers/objects_api.py Switches router handlers to injected bbagent dependency.
bedhost/routers/bedset_api.py Switches to injected bbagent and updates usage counting decorator usage.
bedhost/routers/bed_api.py Switches to injected bbagent, adds OG image endpoint, and adjusts several handlers.
bedhost/routers/base_api.py Updates endpoints to injected bbagent and adjusts service-info OpenAPI lookup.
bedhost/og_image.py New image generation module for OG cards.
bedhost/main.py Introduces lifespan startup/shutdown and moves router attachment to import-time.
bedhost/helpers.py Updates count_requests to pull usage data from request.app.state and adds upload_usage.
bedhost/dependencies.py Introduces dependency providers (get_bbagent, etc.) and adjusts detailed stats fetching.
bedhost/data_models.py Updates FastAPI/Pydantic parameter usage (regexpattern, exampleexamples).
bedhost/_version.py Bumps version to 0.12.7.
Comments suppressed due to low confidence (1)

bedhost/routers/bedset_api.py:111

  • This handler returns plots (bbagent.bedset.get_plots), but the docstring still describes returning generic "metadata from selected columns". Update the docstring to explicitly describe the plots payload so the documentation stays accurate after the rename.
    """
    Returns metadata from selected columns for selected bedset
    """

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bedhost/routers/bed_api.py Outdated
Comment on lines +334 to 337
async def umap_bed_file(
file: UploadFile = File(None),
bbagent: BedBaseAgent = Depends(get_bbagent),
):
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The endpoint allows file to be omitted (File(None)), but the implementation later returns embedding unconditionally, which will raise UnboundLocalError when no file is provided. Make the file required or add an explicit 4xx error when file is None.

Copilot uses AI. Check for mistakes.
Comment thread bedhost/routers/bedset_api.py
Comment thread bedhost/routers/base_api.py Outdated
Comment thread bedhost/routers/base_api.py Outdated
Comment thread bedhost/routers/bed_api.py Outdated
Comment thread bedhost/dependencies.py
Comment thread bedhost/dependencies.py Outdated
khoroshevskyi and others added 6 commits April 22, 2026 12:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@khoroshevskyi khoroshevskyi merged commit bf5789a into master Apr 22, 2026
2 checks passed
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.

3 participants