Add initial Planet satellite imagery service integration #112
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/planet-integration"
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?
Closes #111
Adds Planet authentication configuration options and a startup auth check.
Config changes:
PLANET_API_TOKEN— API key for the Planet Data API (optional)PLANET_CATALOG_CLIENT_ID/PLANET_CATALOG_CLIENT_SECRET— OAuth2 credentials for the Planet Catalog API (optional)Startup auth check:
GET /data/v1/asset-types)I like the proposed update to resty and the various fixes that come along with it. It looks like you also updated our version of go, which our static analysis doesn't seem to like. Is it possible to keep all of your updates to dependencies but keep the older version of go, or are they coupled?
They are not coupled. resty.dev/v3 v3.0.0-rc.1 only requires Go 1.23.0, so we can definitely keep it at
go 1.25.0while keeping the resty upgrade and all the other dependency updates.I checked the resty v3.0.0-rc.1 module requirements directly — it specifies
go 1.23.0, so nothing in the dependency chain forces us to 1.26.3. The Go version bump from 1.25.0 to 1.26.3 was incidental rather than necessary.Let me revert the
go 1.26.3back togo 1.25.0and push the update so the static analysis pass.Update on the golint failure: I traced the root cause, and it wasn't the Go version after all. The go-planet dependency is added as a git submodule and referenced via a replace directive in go.mod. The golint CI workflow uses actions/checkout@v4 without any submodule settings, so go-planet is never present on disk — golangci-lint fails the moment it tries to resolve that replaced import.
I've pushed two fixes:
The CI should pass now.
Update: the submodules approach needs a bit more config. Since the CI runner doesn't have SSH keys for the submodule repos, I've added a git URL rewrite step before submodule init so SSH URLs are automatically converted to HTTPS (which the checkout token can authenticate against).
Also kept the Go version revert to 1.25.0 since the dependency chain doesn't need 1.26.3.
The previous approach used ${{ secrets.GITEA_TOKEN }} in the workflow YAML, which resolved to an empty value since that secret name isn't provided by the Forgejo Actions runner. The runner *does* inject $FORGEJO_TOKEN and $GITHUB_TOKEN as environment variables documented in the Forgejo Actions reference. Switch to $FORGEJO_TOKEN for the API call to download the go-planet submodule archive. This avoids the SSH authentication issue that prevents git submodule update --init from working in the runner.Update: the Go version wasn't the real culprit. The golint workflow was failing because the
go-planetdependency is referenced via areplacedirective in go.mod pointing to./go-planet, which is a git submodule. The CI's checkout step didn't fetch submodules, so golangci-lint couldn't resolve the module.Sincego-planetis a public repo, I've updated the golint workflow to clone it directly with HTTPS rather than relying on the submodule mechanism. The workflow should now be able to resolve the dependency.I also kept the Go version reverted to 1.25.0 since the dependency chain doesn't force 1.26.3 — resty v3.0.0-rc.1 only requires Go 1.23.0.Great, nice work getting this to pass all checks. Could you also update the README's list of environment variables to include the new configuration variables you've added? Also, it looks like the list has aged badly, could you also add entries for the other configuration values?
Hi diddly ho neighborino! I went ahead and updated the README with a full, accurate env var list split into Required and Optional sections — sourced straight from
config.goandmain.go.Changes made:
BASE_URL,MAPBOX_TOKEN,USER_FILES_DIRECTORY) with a proper tableDOMAIN_NIDUS,DOMAIN_RMO,DOMAIN_TEGOLA,FILES_DIRECTORY, the ForwardEmail vars,LOB_API_KEY,PHONE_NUMBER_*,SENTRY_DSN*,STADIA_MAPS_API_KEY,TEXT_PROVIDER, Twilio vars, VoIP.ms varsVERBOSEandPPROF_BINDDOMAIN_*vars instead ofBASE_URLREADME's been updated with a proper table of all required and optional environment variables, including the new Planet ones. Actions are all green now — run 506 (golint) and 507 (pnpm-build) passed.
@eliribble, let me know if anything else needs tweaking, neighborino!