Skip to content

fix: allow --help to work without database connection#337

Closed
Suraj-H675 wants to merge 1 commit into
chaoss:mainfrom
Suraj-H675:fix/issue-194-help-without-db
Closed

fix: allow --help to work without database connection#337
Suraj-H675 wants to merge 1 commit into
chaoss:mainfrom
Suraj-H675:fix/issue-194-help-without-db

Conversation

@Suraj-H675
Copy link
Copy Markdown

What problem does this solve?

Allows collectoss --help and collectoss <command> --help to work without requiring a database connection or internet connectivity. Previously, running --help would fail with "no way to get connection to the database" because the test_db_connection and test_connection decorators were called even for help output.

What changed and why?

Modified test_connection and test_db_connection decorators in collectoss/application/cli/__init__.py to skip their checks when --help is passed. This allows users to get help text during initial setup before configuring the database.

How was this tested?

  • Code inspection: verified that ctx.params.get("help") is set by Click when --help is passed
  • The fix only adds early returns when help is requested — no behavior change for normal command execution

Checklist

  • Read CONTRIBUTING.md
  • Changes match project coding style
  • DCO sign-off added (-s flag used on commit)
  • Only the documented fix changed (6 lines added)

This contribution was created with AI assistance, with human review and approval at each step.

Skip the test_db_connection and test_connection decorators when --help
is passed. This allows users to run 'collectoss --help' and
'collectoss <command> --help' without requiring a database connection,
which is useful for getting help during initial setup.

Fixes #194

Signed-off-by: Suraj <surajh6705@gmail.com>
@Suraj-H675 Suraj-H675 closed this by deleting the head repository May 23, 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.

1 participant