Migrate to daw-lua-common 2.0.0 #6
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-lua-net#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Migrate daw-lua-net to daw-lua-common 2.0.0.
Changes
lib/daw/commonupdated to v2.0.0http_client.lua: removedpcallaroundjson.decode(no longerthrows in 2.0.0), fallback-to-raw behavior on non-JSON responses
preserved
http_client.lua:json.encodefailure now explicitly checkedand returned as
nil, errinstead of relying on the oldthrow-on-failure behavior
http_client.lua:[ERROR] http_client.<func>:prefixes addedper daw-error-standard.md (previously missing / used a generic
[ERROR] net:prefix)http_client.lua:get/post/putnow return a single result table{ body, status, headers }, nilinstead of three positionalvalues (
body, status, nil) -- see DAW/daw-lua-net#5 for theunderlying standard change
http_client.lua, was astale
src/daw/lua/common/http_client.luareference)test/test_http_client.luaadapted to new return shapeVerification
fragjan code .-- 5 files, 122 checks, all clearmake test-- Lua 5.4, all 20 tests passedmake testwithDAW_LUA_VERSION = 5.1-- all 20 tests passedRelated
Migration guide: DAW/daw-lua-common MIGRATING-2.0.md
Final status update -- released as v2.0.0
Since this issue was opened, the review process surfaced significantly more
than the original checklist:
closed on malformed/unverifiable input (nil, err) instead of the previous
silent 0/false/hardcoded-127.0.0.1 behavior (see DAW/daw-lua-net#3).
get_client_ip requires request.remote_addr and takes an optional
trusted_proxies parameter.
result, nil | nil, err (including true, nil / false, nil for predicates).
pattern shared with daw.common/init.lua.
{ body, status, headers }, nil | nil, err contract as get/post/put
(previously body, status, err) -- no more return-shape exception in the
library.
including full coverage of the new fail-closed and get_raw() behavior.
fragjan clean, make test green on Lua 5.1 and 5.4. Tagged and pushed as
v2.0.0.
Refs: DAW/daw-lua-net#3, DAW/daw-lua-net#5, DAW/daw-lua-common#39