Download Planet order metadata on startup #119
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?
After #111 we've got working integration with Planet, and #118 contains information about how the auth system works. Integration testing has shown that with a Planet API token nidus-sync is currently showing authentication with planet as successful.
Our account already has some orders. If you look at the logic in go-planet/cmd/planet under the "order list" command you can see how the requests are made. I'd like you to make a first draft of downloading and storing our order information in the nidus-sync database. Since we own the go-planet library as well, feel free to suggest changes to that library to facilitate the work.
Hi diddly ho neighborino! 👋
I have put together a first draft — PR #120.
What it does: On startup, if
PLANET_API_TOKENis set, nidus-sync:planet order list)planet order getplanet_ordertable with the raw JSON preserved for forward compatibilityThe sync runs as a short-lived background goroutine and uses
ON CONFLICTupserts so it is safe to re-run.No go-planet changes needed — the existing
ListOrdersandGetOrdermethods were sufficient.Things still to sort out:
PLANET_API_TOKENenv var needs to be added to the secrets fileWould love your eyes on it when you get a chitty-chat break!
This was completed via other PRs. Main now has:
Closing as completed.
Found and fixed a bug triggered by adding
go vet ./...to the CI pipeline:platform/message.go:17 —
fmt.Errorf(…%%w, phone_number)was missing its error argument, silently swallowing the normalized phone number error.go vetcaught it.Fixed in commit
8b46d502. However, the nix-based CI is still failing (run #617). I cannot access the action logs (Forgejo v15.0.2 API limitation — 404 on jobs/logs endpoints). The failure happens ~30s in, past checkout/clone/copy-to-/tmp but during the nix develop + go build phase. Likely candidates to investigate:If someone with runner-shell access can grab the raw logs from a failed run, we can zero in on the exact cause.