Skip to content

Enhance salesforce converter UX - #286

Open
MonkeyCanCode wants to merge 3 commits into
apache:mainfrom
MonkeyCanCode:enhance_salesforce_converter_ux
Open

Enhance salesforce converter UX#286
MonkeyCanCode wants to merge 3 commits into
apache:mainfrom
MonkeyCanCode:enhance_salesforce_converter_ux

Conversation

@MonkeyCanCode

Copy link
Copy Markdown
Contributor

Summary

Related Issues

The current salesforce converter CLI only provide error codes (1-3) to end-user and not telling user what is wrong with the command. This PR addresses this gap by adding basic error message when exception got trigger.

Here is the current behavior:

# error code 1
➜  salesforce git:(main) ✗ java -jar target/ossie-salesforce-converter-0.1.0-SNAPSHOT.jar invalidDirection
➜  salesforce git:(main) ✗ echo $?
1

# error code 2
➜  salesforce git:(main) ✗ java -jar target/ossie-salesforce-converter-0.1.0-SNAPSHOT.jar toOSI nonexisted.json

➜  salesforce git:(main) ✗ echo $?
2

# error code 3 (hard to produce but matches to the pattern of error code 2)

Here is the new behavior:

# error code 1
➜  salesforce git:(enhance_salesforce_converter_ux) ✗ java -jar target/ossie-salesforce-converter-0.1.0-SNAPSHOT.jar invalidDirection
Usage: ossie-salesforce-converter <direction> <input-file>
  direction: toSF | toOSI
➜  salesforce git:(enhance_salesforce_converter_ux) ✗ echo $?
1

# error code 2
➜  salesforce git:(enhance_salesforce_converter_ux) ✗ java -jar target/ossie-salesforce-converter-0.1.0-SNAPSHOT.jar toOSI nonexisted.json

Error: Input file not found: nonexisted.json
➜  salesforce git:(enhance_salesforce_converter_ux) ✗ echo $?
2

# error code 3 (hard to produce but matches to the pattern of error code 2)

This PR also fixes the broken ASCII arts for architecture diagram.

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have been discussed on the mailing list or in a linked issue
  • Breaking changes to the spec are clearly called out in the summary

Ontology

  • Ontology changes in ontology/ are consistent with spec changes
  • New or modified terms are defined and documented

Converters

  • Converter logic in converters/ is updated to reflect spec or ontology changes
  • New converters include tests under the converter's test directory

Validation

  • Validation rules in validation/ are updated if the spec changed
  • New validation cases are covered by tests

Documentation

  • docs/ is updated to reflect any user-facing changes
  • New features or behaviors are documented with examples where appropriate
  • CONTRIBUTING.md is updated if the contribution process changed

Examples

  • examples/ are added or updated for any new spec constructs or converter support

Tests

  • All existing tests pass (pytest / CI green)
  • New functionality is covered by tests

Compliance

  • ASF license headers are present on all new source files
  • No third-party dependencies are added without PMC/IPMC approval

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The printed usage advertises a direction (toOSI) that the CLI does not accept, which will mislead users into an immediate error path.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR improves the Salesforce converter CLI user experience by adding basic, user-facing error/usage output and by correcting the README’s architecture ASCII diagram formatting.

Changes:

  • Print a usage message when insufficient CLI arguments are provided.
  • Print exception messages to stderr for InvalidInputException and ConversionException before exiting with the existing error codes.
  • Adjust the README architecture diagram layout.
File summaries
File Description
converters/salesforce/src/main/java/org/apache/ossie/app/OssieSalesforceConverter.java Adds usage output and prints error messages for exceptions.
converters/salesforce/README.md Tweaks the architecture ASCII diagram formatting.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread converters/salesforce/README.md Outdated
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