Skip to content

feat: Add lens-wasm instance repository#110

Merged
AndrewSisley merged 8 commits into
mainfrom
109-repository
Jul 31, 2025
Merged

feat: Add lens-wasm instance repository#110
AndrewSisley merged 8 commits into
mainfrom
109-repository

Conversation

@AndrewSisley

@AndrewSisley AndrewSisley commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

Relevant issue(s)

Resolves #109

Description

Adds lens-wasm instance repository, to manage pooled instances of wasm modules.

Pulled from the Defra repo with naming/documentation changes to make it use-case agnostic. Nothing has changed behaviour wise from there.

For now this is not tested by the Lens repo, I have tested it via the Defra repo. Lense will gain proper testing in this ticket #108 - this will probably be done after introducing on-disk storage, and an http client - so that the current binary/language agnostic tests can be safely ported to the testo framework.

The explicit transaction stuff was unused in Defra, but is assumed to still be working. It is not currently tested, but that will change once we fix either the Defra side, or add tests hosted in the Lens repo.

The corresponding Defra PR is here sourcenetwork/defradb#3874.

Testify also bumped out of laziness
Only changes are the removal of Defra dependencies (done by copying the required parts of their interfaces/aliases to Lens)
Lens prefix is not helpful in the lens repo, and Document is prefered of Doc now that the type is public
So that it is appropriate for the Lens repo.  No code has changed, only names of stuff.

@fredcarle fredcarle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I like the new interfaces. Just one non-blocking suggestion.


func (r *explicitTxnRepository) Init(txnSource TxnSource) {}

func (r *explicitTxnRepository) WithTxn(txn Txn) Repository {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: WithTxn on implicitTxnRepository was removed at one point. If you want to eventually make the explicit transaction work, this will be needed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I didn't think it ever was on implicitTxnRepository - I didnt check though. I assumed the implicitTxnDb just had a reference to concrete type instead of the interface.

Going to leave this as-is for now, as it's omission makes the explicitTxnRepository dead code, and I don't really want to re-expose it to users before it is tested again.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I can confirm that it was :)

I'm ok with that. We'll just have to figure out a way to reintroduce explicit transactions at some point if we care to have lens respect them.

@AndrewSisley AndrewSisley merged commit 98c7df0 into main Jul 31, 2025
5 checks passed
@AndrewSisley AndrewSisley deleted the 109-repository branch July 31, 2025 15:00
AndrewSisley added a commit to sourcenetwork/defradb that referenced this pull request Aug 1, 2025
## Relevant issue(s)

Resolves #3869

## Description

Replaces the lens registry with the new Lens repository in the Lens repo
- introduced in this PR sourcenetwork/lens#110

Also updates Lens to v0.8.1 - which includes the repo url changes.
fredcarle pushed a commit to sourcenetwork/defradb that referenced this pull request Mar 4, 2026
## Relevant issue(s)

Resolves #3869

## Description

Replaces the lens registry with the new Lens repository in the Lens repo
- introduced in this PR sourcenetwork/lens#110

Also updates Lens to v0.8.1 - which includes the repo url changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bring in Lens pool/registry from Defra

2 participants