Skip to content
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

Lex refactor needs #83

Closed
4 of 5 tasks
bnewbold opened this issue Mar 22, 2023 · 3 comments
Closed
4 of 5 tasks

Lex refactor needs #83

bnewbold opened this issue Mar 22, 2023 · 3 comments

Comments

@bnewbold
Copy link
Collaborator

bnewbold commented Mar 22, 2023

Cross-reference to main upstream (atproto) branches: bluesky-social/atproto#658

Things that will require new lexgen feature support:

  • type="cid-link", encodes as an object like { "$link": "<cid>" }. For binary CIDs, aka "Link" in IPLD data model)
  • type="bytes", encodes as an object like { "$bytes": "<base64-encoded>" } for embedded bytes (which specific base64 config?)
  • no image/video/audio, just type="blob" now. blob gains a size field (integer, size in bytes)
  • type="number" changed to type="float" (though not yet used, and might change how that works)
  • string types, which will work like type="string" format="at-uri"

The string types are not strictly needed to get lexgen to run, but we probably might as well wire up placeholder validation for functions in codegen code. The formats are at least: handle, nsid, at-identifier (handle or DID), uri (generic), datetime, at-uri, did, cid. I can port over the validation functions and their tests. I guess we haven't actually implemented the other validators yet, like maxLength. Maybe we punt on validation until a second pass (separate PR).

There are some semantics/benavioral changes, like idempotency of batch mutations and deleteRecord not failing if record already does not exist. I don't think the existing golang PDS is complete enough to care about those.

Once lexgen runs successfully, presumably there will be a bunch of broken stuff that we'll just need to get to compile.

cc: @whyrusleeping

@whyrusleeping
Copy link
Collaborator

can we close this now?

@bnewbold
Copy link
Collaborator Author

bnewbold commented Apr 12, 2023

The string formatting stuff hasn't been touched yet, AFIAK. Might factor in to an iteration of lexgen? Also things like maxLength (both strings and arbitrary arrays), max sizes for blobs (in bytes), max grapheme lengths.

We could create a new issue to track that specific work to be done, and could be copied from the details here. Don't want to lose what is here without copying it out.

@bnewbold
Copy link
Collaborator Author

closing this old/stale issue; lex refactor was forever ago.

#449 is a PR with some partial/draft work on incorporating indigo/atproto/syntax package in to lexgen.

"grapheme length validation" will probably end up in indigo/atproto/data or indigo/atproto/lexicon.

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

No branches or pull requests

2 participants