exasol/release-droid

Improved warning message for unspecified release platforms

kaklakariada opened this issue · 2 comments

Initially reported as "Local validation seems to ignore release_config.yml"

Running RD with -l . fails:

small-json-files-test-fixture % release-droid -n small-json-files-test-fixture -l .                
Exception in thread "main" java.lang.IllegalArgumentException: E-RD-20: Platform specified neither on commandline nor in configuration file 'release_config.yml'. Please specify at least one platform and re-run the Release Droid.
        at com.exasol.releasedroid.usecases.request.ReleasePlatforms.from(ReleasePlatforms.java:23)
        at com.exasol.releasedroid.main.ReleaseDroid.run(ReleaseDroid.java:54)
        at com.exasol.releasedroid.main.Runner.main(Runner.java:52)

but the project has a correct configuration:

% cat release_config.yml                                             
platforms:
  - GitHub
  - Maven
language: Java

Workaround: run

release-droid -n small-json-files-test-fixture -l . -p maven,github

Root cause for observed exception is that

  • release-droid expects key release-platforms
  • while your file release_config.yml contains platforms

I propose to add a better error message.

E-RD-20: No release platform specified. Please specify at least one release platform either on command line or with key 'release-platforms' in file 'release_config.yml' and re-run the Release Droid.

Rationale:
My first attempt was to make the parser display a more specific warning.
Unfortunately RD parses the config multiple times (which might be another minor problem).
And hence RD would display the related warning multiple times which is ugly in my eyes.