Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App: make returned result consistent with output options #42

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

sebalix
Copy link
Collaborator

@sebalix sebalix commented Nov 2, 2023

Extracted from #33

Depending on the running mode (CLI, non-interactive, JSON output...) the result of App.run() has to be consistent with the user parameters:

  • with non-interactive and without output, return a boolean or exception:
    • something to migrate/port: True
    • nothing to do: False
    • module doesn't exist on source branch: ValueError
  • with a format output defined, return the expected format, e.g. with JSON:
    • something to migrate/port: non-empty JSON document
    • nothing to migrate/port: empty JSON document
    • module doesn't exist on source branch: ValueError
  • as CLI: return an exit code (+ text printed on std output):
    • something to migrate: 100
    • something to port: 110
    • nothing to migrate/port: 0
    • module doesn't exist on source branch: 1

Depending on the running mode (CLI, non-interactive, JSON output...) the
result of `App.run()` has to be consistent with the user parameters:

- with non-interactive and without output, return a boolean or exception:
    - something to migrate/port: `True`
    - nothing to do: `False`
    - module doesn't exist on source branch: `ValueError`
- with a format output defined, return the expected format, e.g. with JSON:
    - something to migrate/port: non-empty JSON document
    - nothing to migrate/port: empty JSON document
    - module doesn't exist on source branch: `ValueError`
- as CLI: return an exit code (+ text printed on std output):
    - something to migrate: 100
    - something to port: 110
    - nothing to migrate/port: 0
    - module doesn't exist on source branch: 1
@sebalix sebalix added this to the 0.14 milestone Nov 2, 2023
@sebalix sebalix merged commit 5d972e4 into OCA:main Nov 2, 2023
4 of 5 checks passed
@sebalix sebalix deleted the fix-result-consistency branch November 2, 2023 08:27
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