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

Update install-powershell.ps1 with more options #19884

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

kilasuit
Copy link
Collaborator

@kilasuit kilasuit commented Jul 2, 2023

PR Summary

Adds additional parameters into the install-powershell.ps1 script for use with installing LTS or a specific version as passed through
Also updates the readme for this script.

Fixes #15403
Fixes #19883

PR Context

PR Checklist

@kilasuit
Copy link
Collaborator Author

kilasuit commented Jul 3, 2023

Minor additional formatting changes were included whilst editing the script but does not impact use

Tested with the following which all work as expected

.\tools\install-powershell.ps1 -Destination C:\ps -Version '7.3.1' -Verbose

Unzips to C:\ps-7.3.1\ and informs the user on this

.\tools\install-powershell.ps1 -Version 'v7.3.1' -Verbose

Unzips to $env:LOCALAPPDATA\Microsoft\powershell-7.3.1\ and informs the user on this

.\tools\install-powershell.ps1 -Destination C:\ps -LTS -Verbose

Unzips to C:\ps-LTS\ and informs the user on this

@ghost ghost added the Review - Needed The PR is being reviewed label Jul 10, 2023
@ghost
Copy link

ghost commented Jul 10, 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

@StevenBucher98 StevenBucher98 added the PowerShell-Docs not needed The PR was reviewed and doesn't appear to require a PowerShell Docs update label Jul 10, 2023
@daxian-dbw
Copy link
Member

@kilasuit The "PowerShell-CI-install-ps" job failed, which is likely caused by the changes in this PR. Please take a look.

@ghost ghost removed the Review - Needed The PR is being reviewed label Jul 10, 2023
@daxian-dbw daxian-dbw added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jul 10, 2023
@kilasuit
Copy link
Collaborator Author

kilasuit commented Jul 10, 2023

@daxian-dbw I have looked and can't see why my changes could cause the jobs to fail

(minor edit) @TravisEz13 or at least that I think I can fix as the error message is pointing to an issue as listed below (hope saves you from digging)

You have 45 outdated formulae and 1 outdated cask installed.
You can upgrade them with brew upgrade
or list them with brew outdated.
First attempt of update failed. Increase Git buffer size and try again ...
error: Could not read ffac597fdb6ce8236b5e2da77ab6fbae3d9d9cb7
fatal: revision walk setup failed
error: https://github.com/Homebrew/homebrew-cask did not send all necessary objects

Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask failed!
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

ERROR: Refreshing Homebrew cache failed...
##[error]Bash exited with code '2'.

@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jul 10, 2023
tools/install-powershell.ps1 Outdated Show resolved Hide resolved
tools/install-powershell.ps1 Show resolved Hide resolved
tools/install-powershell.ps1 Show resolved Hide resolved
@daxian-dbw daxian-dbw added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jul 17, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jul 17, 2023
@kilasuit
Copy link
Collaborator Author

Currently working on this with updating the parameter sets properly - will push another update with this in the coming days

@kilasuit kilasuit changed the title Added Version and LTS methods to the install script Update install-powershell.ps1 with more options Jul 28, 2023
@kilasuit kilasuit marked this pull request as draft July 28, 2023 20:00
@kilasuit kilasuit marked this pull request as ready for review July 31, 2023 20:41
@kilasuit
Copy link
Collaborator Author

@TravisEz13 - have added tests for this using Windows agents for all the options that I've added, which also includes an explicit stable option which is only slightly different end install location & doesn't break how it works currently when run like .\tools\install-powershell.ps1 -Verbose

@microsoft-github-policy-service
Copy link
Contributor

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

2 similar comments
@microsoft-github-policy-service
Copy link
Contributor

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

@microsoft-github-policy-service
Copy link
Contributor

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

@pull-request-quantifier-deprecated

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


Quantification details

Label      : Medium
Size       : +137 -28
Percentile : 53%

Total files changed: 3

Change summary by file extension:
.yml : +65 -0
.ps1 : +60 -26
.md : +12 -2

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.

@daxian-dbw
Copy link
Member

@TravisEz13 Please review again when you get the time. Thanks!

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Review - Needed The PR is being reviewed label Aug 17, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Review - Needed The PR is being reviewed label Aug 24, 2023
@microsoft-github-policy-service
Copy link
Contributor

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

1 similar comment
@microsoft-github-policy-service
Copy link
Contributor

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

@kilasuit kilasuit mentioned this pull request Sep 26, 2023
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium PowerShell-Docs not needed The PR was reviewed and doesn't appear to require a PowerShell Docs update Review - Needed The PR is being reviewed
Projects
None yet
5 participants