Skip to content

Conversation

@gaurav02081
Copy link

@gaurav02081 gaurav02081 commented Jan 24, 2026

Description

This PR improves the health check endpoint by verifying that the Taskwarrior (task) binary is available on the system.

Previously, the health endpoint always returned 200 OK, even if Taskwarrior was missing. The updated behavior returns 503 Service Unavailable with a clear status message when the required binary is not found, ensuring the service only reports itself as healthy when it can actually function

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

I have verified the changes locally by simulating a missing Taskwarrior dependency inside the running container !

Baseline (normal state):

curl -s -i http://localhost:8000/health

Returns:

HTTP/1.1 200 OK
{"service":"ccsync-backend","status":"healthy"}

Simulated failure (Taskwarrior removed):

docker-compose exec -u root backend mv /usr/local/bin/task /usr/local/bin/task.bak
curl -s -i http://localhost:8000/health

Returns:

HTTP/1.1 503 Service Unavailable
{"service":"ccsync-backend","status":"unhealthy: taskwarrior binary not found"}

Restored dependency:

docker-compose exec -u root backend mv /usr/local/bin/task.bak /usr/local/bin/task
curl -s -i http://localhost:8000/health

Returns:

HTTP/1.1 200 OK
{"service":"ccsync-backend","status":"healthy"}

---> This change helps catch misconfigured or broken environments.

@github-actions
Copy link

Thank you for opening this PR!

Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.

Please take a moment to:

  • Check the "Files changed" tab
  • Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
  • Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
  • Finally, submit all the comments!

More information on how to conduct a self review:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request

This helps make the review process smoother and gives us a clearer understanding of your thought process.

Once you've added your self-review, we'll continue from our side. Thank you!

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.

2 participants