PowerShell icon indicating copy to clipboard operation
PowerShell copied to clipboard

Add in Url Alias for IRM/IWR Cmdlets

Open kilasuit opened this issue 3 years ago • 14 comments

PR Summary

Fixes #16658

PR Context

Users may get URI/URL mixed up and by adding an alias to this shared parameter will reduce errors in interactive scripting

PR Checklist

kilasuit avatar Dec 21 '21 03:12 kilasuit

Make draft until we get a conclusion from WG in related issue.

iSazonov avatar Dec 21 '21 05:12 iSazonov

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

ghost avatar Jan 08 '22 08:01 ghost

@PaulHigin can you please review this along with the conversation in #16658 & comment on whether or not this is something that could be merged or not

kilasuit avatar Jan 09 '22 22:01 kilasuit

This seems like a reasonable change to me, and I don't see how this would be a breaking change. However, the cmdlet working group should weigh in on it. So adding that tag.

PaulHigin avatar Jan 10 '22 19:01 PaulHigin

For WG. I can't agree with that cosmetic addition.

  1. URI is not wrong term in the context
  2. Aliases are always bad thing until they do useful work. Ex., we added PSPath alias to LiteralPath parameter of many cmdlets. As result we get perf win because of skipping unneeded globbing.
  3. For interactive scenario - the source of this request - we have tab-completion, suggestions and now predictions - all this makes cosmetic aliases unnecessary.

iSazonov avatar Jan 11 '22 04:01 iSazonov

For interactive scenario - the source of this request - we have tab-completion, suggestions and now predictions - all this makes cosmetic aliases unnecessary.

Sorry @iSazonov I have to disagree with you on especialy on that last part because you are forgetting about the non-advanced users who are coming to this language for the first time, who may not know about tab-completion, suggestions and now predictions as well as those using the language for years and still don't use those to their full potential. Plus this request was as pointed out in the issue based on a long standing Microsoft FTE who correctly pointed out that muscle memory in this particular instance causes unneccessary failures, which this PR would address and is exactly why we have aliases on parameters, for improving the user experience not for engine perfomance gains like you mention in your 2nd point & your first isn't an issue of being technically correct, but an issue that many users do not understand the differnce between them and use them interchangably.

This is defiinitley more for the Interactive UX WG than the Cmdlets one I think @PaulHigin so I'm tagging @JamesWTruher & @daxian-dbw as these are their key areas from that WG

kilasuit avatar Jan 13 '22 11:01 kilasuit

@kilasuit I could agree if we made a breaking change and replaced the parameter name, but otherwise it only worsens the UX - aliases have never been a public contract and are not mentioned anywhere - neither in documentation, nor in tab completion. And there are all kinds of newbies - those who learn and those who are lazy. You don't have to worry about the latter, and the former, if they were able to find this teamlet, no doubt they are already familiar with the list of parameters.

iSazonov avatar Jan 13 '22 12:01 iSazonov

@iSazonov - sorry, whilst I respect your POV on just about everything else when it comes to PowerShell i have to point out that your view here is currently not correct

  1. They are a part of the public contract
  2. They are documented (albeit poorly) in this doc but called out fully in this section of this other doc
  3. Implict parameter completion allows use of named aliases or lazy aliases
  4. As @PaulHigin mentioned this isn't a breaking change and is why aliases exist to not end up being a breaking change in the first place

kilasuit avatar Jan 13 '22 12:01 kilasuit

Labelled both this PR and the issue with WG-Interactive-Console, as the main disagreement in the discussions in #16658 is about a subtle change in tab completion for this parameter when the Emacs edit mode is in use, see https://github.com/PowerShell/PowerShell/issues/16658#issuecomment-1001809209.

daxian-dbw avatar Jan 13 '22 19:01 daxian-dbw

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

ghost avatar Feb 01 '22 08:02 ghost

This is currently waiting agreement based on the above mentioned comment in the issue as this has identified a potential additional change to PSReadline (raised in https://github.com/PowerShell/PSReadLine/issues/3198) to equate for adapting this particular user experience.

kilasuit avatar Feb 01 '22 14:02 kilasuit

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

ghost avatar Feb 19 '22 20:02 ghost

This PR has 19 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Small
Size       : +19 -0
Percentile : 7.6%

Total files changed: 2

Change summary by file extension:
.cs : +1 -0
.ps1 : +18 -0

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a balance between between PR complexity and PR review overhead. PRs within the optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detected.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification) of this PR in relation to all other PRs within the repository.


Was this comment helpful? :thumbsup:  :ok_hand:  :thumbsdown: (Email) Customize PullRequestQuantifier for this repository.

Reopening this PR & asking for others in the Interactive UX WG to comment on this.

kilasuit avatar Sep 06 '22 22:09 kilasuit

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

ghost avatar Sep 25 '22 08:09 ghost