Skip to content

SynBioHub PartShop client, collection pulls, and stricter Golden Gate digest handling#85

Open
Gonza10V wants to merge 7 commits intofull_buildfrom
codex/implement-authenticated-repository-login-support
Open

SynBioHub PartShop client, collection pulls, and stricter Golden Gate digest handling#85
Gonza10V wants to merge 7 commits intofull_buildfrom
codex/implement-authenticated-repository-login-support

Conversation

@Gonza10V
Copy link
Copy Markdown
Contributor

@Gonza10V Gonza10V commented May 7, 2026

Motivation

  • Provide a thin adapter for SynBioHub sbol2.PartShop to enable authenticated and anonymous repository access and automatic collection pulls into the in-memory SBOL document using the BuildCompiler convenience constructor.
  • Wire identity-based pulls into planning/execution so resolver misses can be fulfilled from the same repository client instance.
  • Make Golden Gate assembly simulation more deterministic by enforcing an exact two-fragment digest and clearer error messages for unexpected digests.

Description

  • Add PartShopRepositoryClient in src/buildcompiler/sbol/repository.py implementing auth-token and email/password login, pull_identity, and a safe __repr__ that does not expose secrets.
  • Extend the public API in src/buildcompiler/api/compiler.py to accept repository_url, email, and password in BuildCompiler.from_synbiohub and full_build, create an sbol2.Document when needed, instantiate PartShopRepositoryClient, and pull configured collections; expose the client on the BuildCompiler instance as repository_client.
  • Pass a pull_client callback into FullBuildExecutor.from_dependencies so the SbolResolver can use the repository pull function during planning/execution, and export PartShopRepositoryClient from buildcompiler.sbol.
  • Replace ad-hoc digest selection logic in src/buildcompiler/sbol2build.py with _select_expected_digest_fragment to require exactly two digest fragments and to explicitly choose the insert (smaller) or backbone (larger) fragment, with improved error messages.
  • Add example usage to README.md and include a new authenticated SynBioHub tutorial notebook under notebooks/ demonstrating login and collection pulls.
  • Add unit tests: tests/unit/sbol/test_repository.py to validate PartShopRepositoryClient behaviors and extend tests/unit/api/test_compiler_api.py to test repository integration and authentication edge cases.

Testing

  • Added and ran unit tests in tests/unit/sbol/test_repository.py, which exercise anonymous pulls, token auth, login flow, and __repr__, and they passed.
  • Extended and ran tests/unit/api/test_compiler_api.py to validate BuildCompiler.from_synbiohub argument validation and collection pulls with a fake PartShop, and the tests passed.
  • Ran the test suite with pytest for the modified areas and observed success for the new and adjusted tests.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 869b543df5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

auth_token=auth_token,
email=email,
password=password,
sbol_doc=sbol_doc,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Forward caller-provided SBOL document to SynBioHub path

When full_build takes the SynBioHub constructor branch, it only forwards sbol_doc and drops the sbol_document argument; if callers pass repository_url/auth options together with sbol_document (the other public parameter), from_synbiohub receives None and creates a new sbol2.Document, so the user’s preloaded SBOL content is silently ignored during planning/execution. This is a regression in mixed local+remote workflows and can cause missing inventory/component resolution.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant