Skip to content

comment --pr=true default #1139

@casperdcl

Description

@casperdcl

https://github.blog/changelog/2022-08-04-commit-comments-no-longer-appear-in-the-pull-request-timeline/ meaning the --pr flag is now mandatory for CML reports to show up in PRs. Kinda a UX breaking change potentially.

Options (pick just one):

  1. update docs & examples, adding --pr everywhere (breaking change, examples: add --pr cml.dev#331)
also auto-detect this/print warnings?
$ cml comment ...
(ok)
$ cml pr ...
(ok)
$ cml comment ...
WARNING: did you forget `--pr` flag?
  1. cml comment ... [--pr=true] by default (UX friendly)
    • iff not in a PR, print a warning and fallback to --pr=false (commit-comment)
    • users need explicit --pr=false/--no-pr to use commit-comments in PRs (edge case)
  2. cml comment ... [--pr=auto] by default (better fail-not-warn error handling)
    • try to PR-comment, fallback to commit-comment
    • explicit --pr={true,false} throws error on failure (no fallback)
    • however, is this implementation possible? does yargs allow --flag=foo == "foo" && --flag == true (latter needed for backwards compat)?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions