Skip to content

Fail on unexpected input instead of warning #585

@sim642

Description

@sim642

Unfortunately there are many users of this action, who use it via setup-ocaml@master and have done so from the v1 days. Although v2 was breaking and renamed ocaml-versionocaml-compiler, none of these builds failed. Instead, they silently just set up some default version, even when people have build matrices over ocaml-version. This gives a false impression of success since the build seems to work for all ocaml-versions, but actually they all just build and test the latest OCaml version and the project's backwards-compatibility could be broken (for a long time) without anyone noticing. Since the use of ocaml-version on v2 of this action just prints a warning, which nobody will look at if the job (and the setup-ocaml step) are succeeding.

Worse yet, even if users have changed from setup-ocaml@v1 to setup-ocaml@v2, they might have forgotten to change the input name. For the same exact reason, they would never notice the supposed breaking change that doesn't break but silently does the wrong thing!

Therefore, I really propose to change this action (under v2) to error and fail when unexpected inputs, especially ocaml-version are passed to it. Yes, it will break people's workflows, but that's for the better since users will finally notice that they haven't been testing all the OCaml versions all this time. It's the breaking change that should've happened with v2 right out of the gate.

Here's just a selection of cases where this has caused problems:

  1. Wrong compiler version installed #413
  2. ocaml-yaml: Fix GitHub Actions workflow avsm/ocaml-yaml#66
  3. seq: Fix testing c-cube/seq#15
  4. ... and the list probably goes on longer than anyone is aware of.

Do note that these are seasoned OCaml developers, not beginners, who have made this mistake.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions