gofr-dev / gofr-dev/gofr

Fail Fast on Pub/Sub Misconfiguration in GoFr CLI Applications

Open
#2,230 6 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
Go
Stars
20.9k
Forks
1.8k
Avg merge
5d 18h
Merged PRs (30d)
39

Description

This can also be extended for other dependencies

### Description
When creating a GoFr CLI application, the server may still start even if Pub/Sub is misconfigured. Because of custom recovery logic, the app continues running silently, which hides the underlying issue.

This can cause situations where Pub/Sub functionality does not work as expected, but the developer is unaware because no failure is reported during startup.

To improve developer experience and reliability, the GoFr CLI application should **fail fast** on Pub/Sub misconfiguration, making the issue immediately visible.

### Expected Behavior
- During startup, validate Pub/Sub configuration (e.g., credentials, endpoints, required topics/subscriptions).
- If validation fails, log a clear error and stop the application with a non-zero exit code.
- CLI apps should not run in a degraded state where Pub/Sub is unavailable.

### Benefits
- Prevents silent runtime failures in CLI apps.
- Surfaces misconfigurations early during development or deployment.
- Improves confidence in GoFr apps by ensuring dependencies are correctly set before running.

### Suggested Implementation
- Perform connection/auth checks before application starts.
- If validation fails, stop execution and provide actionable error messages.

Contributor guide

Open the contributing guide

Research direction

Trace GoFr CLI application startup and the custom recovery logic that currently allows Pub/Sub failures to be hidden. Identify where Pub/Sub credentials, endpoints, and required topics or subscriptions can be validated before startup; done means a failed validation logs an actionable error and exits with a non-zero status instead of running degraded.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, cli, developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.