Skip to content

feat: Return Non-Zero Exit Code on Critical Errors for CI/CD Compatibility #44

@BETAER-08

Description

@BETAER-08

Problem

When amdb encounters a critical error (e.g., missing database, parsing failure), it logs the error using tracing::error! but still exits with a successful 0 exit code. This breaks automated pipelines (like GitHub Actions), as they cannot detect if the amdb process actually failed.

Proposed Solution

  • Update src/main.rs to appropriately handle Err results from core commands.
  • Ensure the application calls std::process::exit(1) (or properly bubbles up anyhow::Result to main so the OS registers it as a failure) when an unrecoverable error occurs.

Definition of Done

  • Failing commands (e.g., running amdb generate without running init first) exit with code 1.
  • Successful commands exit with code 0.
  • Verified that a simple bash script can catch the failure using $?.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ci/cdGitHub Actions workflows and release pipelines.area: cliCommand-line interface, arguments, and output formatting.bugSomething isn't working (e.g., crashes, logical errors).priority: lowNice to have; can wait until later.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions