Skip to content

Conversation

@tamasvajk
Copy link
Contributor

The latest changes in dotnet-install enforce that not both of version and quality are specified. See the changes in https://github.com/dotnet/install-scripts/commits/main/src/dotnet-install.sh. Specifically this line.

I haven't done any major testing in powershell context, just ran the following on MacOS:

  • ./dotnet-install.sh -v 7.0.100-preview.2.22153.17 -q signed fails
  • ./dotnet-install.sh -v 7.0.100-preview.2.22153.17 doesn't fail.

PR Checklist

@tamasvajk
Copy link
Contributor Author

tamasvajk commented Jun 27, 2022

This is the reason why the following actions were failing: https://github.com/PowerShell/PowerShell/actions/workflows/codeql-analysis.yml

And with this change applied the action is not failing: https://github.com/PowerShell/PowerShell/actions/runs/2569947207

GitHub
PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.

@SteveL-MSFT
Copy link
Member

SteveL-MSFT commented Jun 27, 2022

Based on dotnet/install-scripts#287 it looks like the expectation is that only --version or --quality should be specified and if both it will error.

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SteveL-MSFT
Copy link
Member

The Linux test is failing on a tab completion test. I think normally I would recommend that being in a separate PR, but this issue w/ dotnet-install.sh and the tabcompletion issue will need to be taken together to unblock CI.

In ./test/powershell/host/TabCompletion/TabCompletion.Tests.ps1 on line 496, it's checking for a specific ordering of completions and that order appears to have changed. I don't think the test should rely on the ordering. So instead, I would recommend changing that line to:

        $res.CompletionMatches.CompletionText | Should -Contain 'Position'

and do that in this PR.

@ghost
Copy link

ghost commented Jun 27, 2022

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ tamasvajk sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@pull-request-quantifier-deprecated

This PR has 6 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       : +4 -2
Percentile : 2.4%

Total files changed: 2

Change summary by file extension:
.psm1 : +1 -1
.ps1 : +3 -1

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 detetcted.
  • 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.

Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SteveL-MSFT
Copy link
Member

@tamasvajk it appears you haven't signed the CLA yet so we can't accept this contribution until that happens

@adityapatwardhan
Copy link
Member

It seems it was correct for Windows all along:

PowerShell/build.psm1

Lines 1901 to 1907 in 735096b

$installArgs = @{}
if ($Version) {
$installArgs += @{ Version = $Version }
} elseif ($Channel) {
$installArgs += @{ Quality = $Quality }
$installArgs += @{ Channel = $Channel }
}

@daxian-dbw daxian-dbw merged commit b88cd3a into PowerShell:master Jun 28, 2022
@SeeminglyScience SeeminglyScience added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Jul 14, 2022
@ghost
Copy link

ghost commented Jul 18, 2022

🎉v7.3.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

@daxian-dbw
Copy link
Member

/backport to release/v7.2.6

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Started backporting to release/v7.2.6: https://github.com/PowerShell/PowerShell/actions/runs/2791667878

GitHub
PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

@daxian-dbw backporting to release/v7.2.6 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Update `build.psm1` to not specify both version and quality for `dotnet-install`
Applying: Fix failing tab completion test
Using index info to reconstruct a base tree...
M	test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1
Falling back to patching base and 3-way merge...
Auto-merging test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1
CONFLICT (content): Merge conflict in test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Fix failing tab completion test
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@daxian-dbw
Copy link
Member

/backport to release/v7.0.12

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Started backporting to release/v7.0.12: https://github.com/PowerShell/PowerShell/actions/runs/2791674422

GitHub
PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

@daxian-dbw backporting to release/v7.0.12 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Update `build.psm1` to not specify both version and quality for `dotnet-install`
Using index info to reconstruct a base tree...
M	build.psm1
Falling back to patching base and 3-way merge...
Auto-merging build.psm1
CONFLICT (content): Merge conflict in build.psm1
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Update `build.psm1` to not specify both version and quality for `dotnet-install`
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@adityapatwardhan
Copy link
Member

Manual backport for 7.2.6 done.

@ghost
Copy link

ghost commented Aug 11, 2022

🎉v7.2.6 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

Backport-7.0.x-Done Backport-7.2.x-Done CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log Extra Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants