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

Allow partial culture matching in Update-Help #18037

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

Conversation

dkaszews
Copy link
Contributor

@dkaszews dkaszews commented Sep 6, 2022

PR Summary

Allows the help locale to match, if it is in the list of parents (fallback chain) of the provided (or implicit) one.

Fixes #18021

PR Context

Currently, if the help has locale 'en-US' as most do, only the following will work and everything else will throw an error:

> Update-Help -UICulture 'en-US'
> Update-Help  # when system's culture is also "en-US"

The PR changes it so that the following will also work:

> Update-Help -UICulture 'en'
> Update-Help  # when system's culture is 'en' or child of 'en', because system culture also uses fallback chain

Explicit Update-Help -UICulture 'en-GB' will still not work, because explicit culture does not use fallback chain.

This solves the bug of fallback chain not actually working, as fallback culture 'en' did not match anything. It was supposed to work by use of globbing, but lack of + "*" meant that the glob still used exact matching. It also allows the user to use explicit -UICulture 'en' to mean "any English will do, regardless of region".

PR Checklist

@dkaszews dkaszews changed the title Allow partial culture matching in Get-Help Allow partial culture matching in Update-Help Sep 6, 2022
@dkaszews
Copy link
Contributor Author

dkaszews commented Sep 7, 2022

There is a single test failing, looks like some empty case for Save-Help I will have to investigate.

@pull-request-quantifier
Copy link

pull-request-quantifier bot commented Sep 14, 2022

This PR has 79 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       : +58 -21
Percentile : 31.6%

Total files changed: 5

Change summary by file extension:
.cs : +23 -20
.ps1 : +35 -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 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? 👍  👌  👎 (Email)
Customize PullRequestQuantifier for this repository.

@dkaszews
Copy link
Contributor Author

dkaszews commented Sep 14, 2022

Looks like the failing test case was because of a typo in AfterEach { SetTestHook("nmae", $value) }, as it ignores any hook whose name it cannot find. What is the reasoning behind it? Can I make a non-breaking change for it to return fieldInfo != null; saying if it successfully set or not, that the caller can then check, or should I avoid making changes not strictly related to this change?`

@iSazonov
Copy link
Collaborator

iSazonov commented Sep 15, 2022

or should I avoid making changes not strictly related to this change?`

Unrelated and style changes should be moved to separate PRs.

@msftbot msftbot bot added the Review - Needed The PR is being reviewed label Sep 22, 2022
@msftbot
Copy link

msftbot bot commented Sep 22, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review - Needed The PR is being reviewed Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update-Help does not work with partial locale
3 participants