Skip to content

Stop GCloud initilization early if service account key var not found#225

Merged
jonyTF merged 2 commits intoschej-it:mainfrom
maxwellward:clean-exit-gcloud-init
Mar 27, 2026
Merged

Stop GCloud initilization early if service account key var not found#225
jonyTF merged 2 commits intoschej-it:mainfrom
maxwellward:clean-exit-gcloud-init

Conversation

@maxwellward
Copy link
Copy Markdown
Contributor

This PR makes it so the GCloud initialization will return/end cleanly if the SERVICE_ACCOUNT_KEY_PATH env var is not set.

The env var isn't required as Timeful can be used without an account. Making this optional simplifies local dev setup.

@wslany
Copy link
Copy Markdown
Contributor

wslany commented Mar 24, 2026

Yes. Local dev should not require Cloud Tasks credentials.

One potential issue: while this change prevents startup failure, the rest of the gcloud layer still assumes TasksClient exists. CreateEmailTask and DeleteEmailTask dereference TasksClient unconditionally, and those paths are still reachable from event creation/edit flows. So in dev mode this may turn "fail at startup" into a nil-pointer exception when someone uses remindees.

Maybe make CreateEmailTask / DeleteEmailTask safe no-ops when Cloud Tasks is unavailable, or
gate the remindee/task-scheduling call sites so they never run without an initialized client?

@maxwellward
Copy link
Copy Markdown
Contributor Author

Good call. I think safe no-ops are fine, probably with a console warning too so it's not just a silent failure. Will update this this evening :) Thanks!

@wslany
Copy link
Copy Markdown
Contributor

wslany commented Mar 25, 2026

@jonyTF Looks good to me.

@jonyTF jonyTF merged commit 6355eba into schej-it:main Mar 27, 2026
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

Successfully merging this pull request may close these issues.

3 participants