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 empty guid in HelpModuleInfo when module is CoreSnapin #15551

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

Conversation

davidBar-On
Copy link
Contributor

PR Summary

Suggested fix for issue #15353. The root cause of the problem is the call to UpdatableHelpModuleInfo with GUID.Empty in case module is InitialSessionState.CoreSnapin. However, that conflics with the assertions for empty GUID in UpdatableHelpModuleInfo and UpdatableHelpUri. As described in #15353 the problem happens in my computer in both Windows and WSL environments.

The suggested fix is actually a workaround that doesn't perform the assertion in case the module is InitialSessionState.CoreSnapin. It may be that the right approach is to eliminate the use of GUID.Empty.

No automatic tests were added as I don't understand what is causing the problem in my computer, but probably not in most other environments.

PR Context

Hard code calling UpdatableHelpModuleInfo with GUID.Empty conflicts with the assertion that the GUID should not be empty.

PR Checklist

@ghost
Copy link

ghost commented Jun 16, 2021

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

@adityapatwardhan
Copy link
Member

@davidBar-On Please have a look at merge conflict

@ghost ghost removed the Review - Needed The PR is being reviewed label Aug 3, 2022
@pull-request-quantifier-deprecated

This PR has 57 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       : +57 -0
Percentile : 22.8%

Total files changed: 3

Change summary by file extension:
.cs : +6 -0
.psd1 : +51 -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.

@davidBar-On
Copy link
Contributor Author

Please have a look at merge conflict

Cached-up with master and resolved the merge conflicts.
The conflicts were because the Debug.Assert(moduleGuid != Guid.Empty) were removed, while this PR does not make these tests only on specific condition. This PR is relevant only if the the conditional test is regarded as a better solution than removing the test.

@PaulHigin
Copy link
Contributor

We definitely don't want a conditional assert, if the assert is not always true than it should not be an assert. I think the fix by @JamesWTruher is correct.

@ghost ghost added the Review - Needed The PR is being reviewed label Aug 12, 2022
@ghost
Copy link

ghost commented Aug 12, 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.

None yet

3 participants