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

Cli versioning: experimental flags handling #5099

Merged
merged 3 commits into from Apr 29, 2022
Merged

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented Mar 17, 2022

Prints a warning when it is used, and it update the manpage with an Experimental annotation.

And a fix on default cli flags

@rjbou rjbou added this to the 2.2.0~alpha milestone Mar 17, 2022
@rjbou rjbou requested a review from dra27 March 17, 2022 16:49
@rjbou rjbou added this to PR in progress in Opam 2.2.0 via automation Mar 17, 2022
src/client/opamArg.mli Outdated Show resolved Hide resolved
@rjbou rjbou moved this from PR in progress to PR to review in Opam 2.2.0 Mar 17, 2022
@rjbou rjbou moved this from PR to review to PR in progress in Opam 2.2.0 Apr 19, 2022
@rjbou
Copy link
Collaborator Author

rjbou commented Apr 28, 2022

Outputs

With these flags modified to be experimental, and some of them deprecated:

  • Simple flag
    • --confirm-level yes, --confirm-level unsafe-yes
    • --confirm-level ask, --confirm-level no deprecated since 2.1
  • Combined flags
    • opam list --installed, opam list --available
    • opam list --all, opam list --roots deprecated since 2.1
  • Enum flags
    • opam show --empty-fiels
    • opam show --raw deprecated since 2.1
    • opam show --where-xp deprecated since 2.1 & replaced by --where

The output is

### mk_flag experimental
$ opam show ago --empty-fields
[WARNING] Flag --empty-fields is experimental, there is no guarantee that it will be kept; avoid using it in scripts.

### mk_flag exprimenal remove 2.1
$ opam show ago --raw
opam: --raw was removed in version 2.1 of the opam CLI, but version 2.2 has been requested.
      This flag was experimental, so the behaviour may be removed completely in a future release.

### mk_flag experimental -> 2.1 & replaced
$ opam show ago --where-xp
opam: --where-xp was removed in version 2.1 of the opam CLI, but version 2.2 has been requested. It was experimental, use --where instead.

### mk_vflag_all experimental -> 2.1
$ opam list ago --all
opam: --all was removed in version 2.1 of the opam CLI, but version 2.2 has been requested.
      This flag was experimental, so the behaviour may be removed completely in a future release.

### mk_vflag_all experimental -> 2.1 multiple
$ opam list ago --all --roots
opam: --all and --installed-roots were all in 2.1, and were all removed by version 2.1 of the opam CLI, but version 2.2 has been requested.
      --all and --installed-roots were experimental, so the behaviour may be removed completely in a future release.

### mk_vflag_all experimental -> 2.1 & valid
$ opam list ago --all --base --pinned
opam: --all was removed in version 2.1 of the opam CLI, but version 2.2 has been requested.
      This flag was experimental, so the behaviour may be removed completely in a future release.

### mk_vflag_all experimental -> 2.1 multiple & valid
$ opam list ago --all --roots --base --pinned
opam: --all and --installed-roots were all in 2.1, and were all removed by version 2.1 of the opam CLI, but version 2.2 has been requested.
      --all and --installed-roots were experimental, so the behaviour may be removed completely in a future release.

### mk_flag_all experimental
$ opam list ago --installed
[WARNING] --installed is experimental, there is no guarantee that it will be kept; avoid using it in scripts.

### mk_flag_all experimental multiple
$ opam list ago --installed --available
[WARNING] --installed and --available are experimental, there is no guarantee that they will be kept; avoid using them in scripts.

### mk_flag_all experimental && valid
$ opam list ago --installed --base --pinned
[WARNING] --installed is experimental, there is no guarantee that it will be kept; avoid using it in scripts.
# No matches found

### mk_flag_all experimental multiple & valid
$ opam list ago --installed --available --base --pinned
[WARNING] --installed and --available are experimental, there is no guarantee that they will be kept; avoid using them in scripts.
# No matches found

### mk_enum experimental -> 2.1
$ opam config var switch --confirm-level ask
opam: The option ask for --confirm-level was removed in version 2.1 of the opam CLI, but version 2.2 has been requested.
      This flag was experimental, so the behaviour may be removed completely in a future release.

### mk_enum experimental -> 2.1 multiple
$ opam config var switch --confirm-level ask --confirm-level no
opam: The options ask and no for --confirm-level were all in 2.1, and were all removed by version 2.1 of the opam CLI, but version 2.2 has been requested.
      The options ask and no for --confirm-level was experimental, so the behaviour may be removed completely in a future release.

### mk_enum experimental
$ opam config var switch --confirm-level yes
[WARNING] The option yes for --confirm-level is experimental, there is no guarantee that it will be kept; avoid using it in scripts.

### mk_enum experimental multiple
$ opam config var switch --confirm-level yes --confirm-level unsafe-yes
[WARNING] The options yes and unsafe-yes for --confirm-level are experimental, there is no guarantee that they will be kept; avoid using them in scripts.

@rjbou rjbou moved this from PR in progress to PR finalised (merge with CI) in Opam 2.2.0 Apr 28, 2022
@rjbou rjbou removed the request for review from dra27 April 29, 2022 08:30
@rjbou rjbou merged commit db31e99 into ocaml:master Apr 29, 2022
Opam 2.2.0 automation moved this from PR finalised (merge with CI) to Done Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Opam 2.2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants