Skip to content

Simplification of GetHttpMethod and httpMethod in WebCmdlets #18846

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

Merged

Conversation

CarloToso
Copy link
Contributor

@CarloToso CarloToso commented Dec 24, 2022

PR Summary

  • GetHttpMethod --> switch expression

  • Simplification of setting httpMethod

  • Remove IsStandardMethodSet(), IsCustomMethodSet()

PR Context

Improve readibility of the WebCmdlets, cleanup

@CarloToso CarloToso requested a review from PaulHigin as a code owner December 24, 2022 00:41
@ghost ghost assigned TravisEz13 Dec 24, 2022
@CarloToso CarloToso changed the title [WIP]Investigation on removing web request method [WIP] Simplification of GetHttpMethod and httpMethod in WebCmdlets Dec 24, 2022
@CarloToso CarloToso force-pushed the Investigation-on-removing-WebRequestMethod branch from d4441b1 to 2b6d084 Compare December 28, 2022 14:22
@CarloToso CarloToso changed the title [WIP] Simplification of GetHttpMethod and httpMethod in WebCmdlets Simplification of GetHttpMethod and httpMethod in WebCmdlets Dec 28, 2022
@ghost ghost added the Review - Needed The PR is being reviewed label Jan 5, 2023
@ghost
Copy link

ghost commented Jan 5, 2023

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@CarloToso CarloToso force-pushed the Investigation-on-removing-WebRequestMethod branch from 4f45a1a to 0828454 Compare January 6, 2023 15:42
@iSazonov
Copy link
Collaborator

iSazonov commented Jan 6, 2023

@CarloToso Of course cmdlets with lots of parameters and parameter sets look complicated nevertheless I don't see the benefit of removing these parameter sets.


I am somewhat surprised that parameters are declared as virtual and we override them. We can't make them not virtual without PowerShell Committee approval but I guess we could remove the overrides.

@ghost ghost removed the Review - Needed The PR is being reviewed label Jan 6, 2023
@CarloToso
Copy link
Contributor Author

CarloToso commented Jan 6, 2023

@iSazonov I added back the parameters set, is the rest of the code ok?
I propose we change the ParameterSetName in the Proxy and NoProxy region from [StandardMethod, CustomMethod -->Proxy] and [StandardMethodNoProxy, CustomMethodNoProxy --> NoProxy]

@iSazonov
Copy link
Collaborator

iSazonov commented Jan 7, 2023

I propose we change the ParameterSetName in the Proxy and NoProxy region from [StandardMethod, CustomMethod -->Proxy] and [StandardMethodNoProxy, CustomMethodNoProxy --> NoProxy]

I don't see value in the change. (Also it can break scripts working with meta data.)

@CarloToso
Copy link
Contributor Author

At the moment WebRequestMethod does not contain the CONNECT Http request method, should we do something about it?

@iSazonov
Copy link
Collaborator

iSazonov commented Jan 7, 2023

At the moment WebRequestMethod does not contain the CONNECT Http request method, should we do something about it?

Please open new issue with investigation why we should add.

@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Jan 9, 2023
@iSazonov
Copy link
Collaborator

iSazonov commented Jan 9, 2023

@CarloToso Please update the PR description.

@pull-request-quantifier-deprecated

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


Quantification details

Label      : Small
Size       : +31 -55
Percentile : 34.4%

Total files changed: 2

Change summary by file extension:
.cs : +31 -55

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? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@iSazonov iSazonov merged commit 292323c into PowerShell:master Jan 12, 2023
@iSazonov iSazonov assigned iSazonov and unassigned TravisEz13 Jan 12, 2023
@CarloToso CarloToso deleted the Investigation-on-removing-WebRequestMethod branch January 12, 2023 10:48
@ghost
Copy link

ghost commented Mar 14, 2023

🎉v7.4.0-preview.2 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants