Repository navigation
Build on OSL 3.0 - #68
Merged
Merged
Conversation
OSL 3.0 reserves result, set, error, option, xml, thread, unknown and channel as type names, so variables and parameters with those names no longer compile.
OSL 3.0 counts characters with string .len. Asset sizes, stored JSON limits, game saves, extension sources, realtime messages and settings bodies are budgets in bytes, so they now use .toBytes().len and keep their old limits and stored sizes.
scripts/e2e_smoke.py starts a compiled API in a fresh data directory with fake sessions and no Rotur, walks the agreement, explore, classroom, project, upload, quota, remix and delete routes, and normalizes the JSON responses. Given two binaries it diffs them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the API to OSL 3.0. The 3.0 compiler rejects
main(some variable names are now reserved type names), and the server's/usr/local/bin/oslis already 3.0, so the API can only be built with the old 286ce05 build kept beside it. No endpoint changes.Renames. Variables named with what 3.0 reserves:
result→res,option→pollOption,channel→releaseChannel,xml→sitemapXml,thread→threadComments,set→bannedSet,error→roturError,unknown→unknownProject. None touches a string, object key, JSON field or collection name.Bytes and characters. In 3.0, string
.lencounts characters, not bytes. The first response diff caught it: asset sizes came out smaller, because binary data has fewer "characters" than bytes. The 19 places that measure bytes now use.toBytes().len: asset sizes, stored JSON caps, game saves, extension sources, realtime message caps, the settings body cap, the comment file cap and the git inspection cache key. About 80 text limits (title ≤ 100, bio ≤ 300 and so on) now count characters, so non-ASCII text gets the room the limit intends instead of being cut short.Other 3.0 changes, checked. Arrays are now shared on assignment. Every alias and every array parameter was reviewed, and none changes behaviour.
random(a, b)now includes its upper bound, and the API never calls it.go.mod. 3.0's
dbpackage brings new Go modules (modernc sqlite), sogo.modandgo.sumchange. The first compile on the server downloads them.Testing.
scripts/e2e_smoke.pyruns one binary offline, or diffs two. It covers 29 steps: agreement, explore, Classroom availability, sign-in state, create, upload, project and project.json, quota, share, remix, delete, trash, purge, unshare, a 404, a 405 and the/apiprefix.mainbuilt with the old compiler and this branch built with 3.0 return matching responses, including for an sb3 with 80 KB of non-ASCII text.osl testpasses 45/45 on both.Before deploying. The server's 3.0 binary was built without VCS info, so it isn't known which commit it is. Rebuild it from 5895982f (the commit CI and these tests use) before compiling this. The rest of the deploy is unchanged.
An independent review checked every rename, every byte-sensitive site and the startup order, and found nothing to fix.
There is no visible change.