Skip to content

Remove XML files for min-size package#18189

Merged
daxian-dbw merged 1 commit intoPowerShell:masterfrom
daxian-dbw:minpkg
Oct 4, 2022
Merged

Remove XML files for min-size package#18189
daxian-dbw merged 1 commit intoPowerShell:masterfrom
daxian-dbw:minpkg

Conversation

@daxian-dbw
Copy link
Copy Markdown
Member

PR Summary

Remove XML files for min-size package.
The min-size package is supposed to:

  1. avoid R2R images for PowerShell and all other library assemblies.
  2. not include the Graphical Host and the WPF/WinForm stuff it pulls in.
  3. remove symbol files (.pdb) and XML document files (.xml)

However, not sure since when, the min-size package for Windows started to have XML files. This PR removes the XML files for Windows min-size package.

Test run build: https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=299968&view=results

PR Checklist

@pull-request-quantifier-deprecated
Copy link
Copy Markdown

This PR has 20 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       : +11 -9
Percentile : 8%

Total files changed: 3

Change summary by file extension:
.psm1 : +8 -9
.yml : +3 -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? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@ghost ghost assigned TravisEz13 Sep 29, 2022
@daxian-dbw daxian-dbw added CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log Backport-7.2.x-Consider labels Sep 29, 2022
$name = $testFailure.name
$message = $testFailure.failure.message
$StackTrace = $testFailure.failure."stack-trace"
$stack_trace = $testFailure.failure."stack-trace"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is to fix a warning from PSSA -- $StackTrace is a built-in variable, so should use a different name.

# only create an assembly group if we have tests
if ( $tCases.count -eq 0 -and ! $includeEmpty ) { continue }
$tGroup = $tCases | Group-Object result
$total = $tCases.Count
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also for fixing a PSSA warning -- not used variable.

Remove-Item "${buildFolder}\*.pdb" -Force
} elseif ($BuildType -eq 'rpm') {
## Build 'min-size'
## Build for Mariner
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This block is for building mariner package, not min-size.

@iSazonov
Copy link
Copy Markdown
Collaborator

iSazonov commented Sep 30, 2022

Perhaps it makes sense to remove resource dll-s too - we have many subfolders with them.
dotnet/sdk#774 (comment)

@daxian-dbw
Copy link
Copy Markdown
Member Author

I think it's up to the user of the min-size package to further prune the files based on their scenario. For example, you may want to leave the ru folder around and delete the others :).

@daxian-dbw
Copy link
Copy Markdown
Member Author

@adityapatwardhan The test build https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=299968&view=results finished successfully. I have check the produced win-x64-gc.zip package, and the XML files are gone.

@SteveL-MSFT
Copy link
Copy Markdown
Member

@daxian-dbw it may be appropriate to have min-size be English only for now and we can add back other languages based on user feedback. Since PS7 itself isn't localized right now, I suspect most users are ok with just English strings.

@daxian-dbw
Copy link
Copy Markdown
Member Author

daxian-dbw commented Oct 3, 2022

Since PS7 itself isn't localized right now, I suspect most users are ok with just English strings.

@SteveL-MSFT Then, shall we remove the resource dlls from all of our packages? It's about 24mb totally for regular packages.

For min-size package itself, it's only for the Guest Config team to consume as of today. Let me check with them and see if they are OK with removing all resource dlls (en-us resource are embedded in the real assemblies).

I'm not going to change this PR since it will be backported to 7.3 and 7.2. If the Guest Config team agrees, I can submit a separate PR to remove the resource dlls.

@daxian-dbw daxian-dbw merged commit 67a3830 into PowerShell:master Oct 4, 2022
@daxian-dbw daxian-dbw deleted the minpkg branch October 4, 2022 17:17
@TravisEz13
Copy link
Copy Markdown
Member

/backport to release/v7.2.7

@TravisEz13
Copy link
Copy Markdown
Member

/backport to release/v7.3.0-rc.1

@ghost
Copy link
Copy Markdown

ghost commented Oct 26, 2022

🎉v7.3.0-rc.1 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link
Copy Markdown

ghost commented Dec 20, 2022

🎉v7.4.0-preview.1 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.2.x-Done Backport-7.3.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.

5 participants