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

Move psxml type definitions from SMA to Security module #16355

Merged
merged 5 commits into from
Jul 26, 2022

Conversation

iSazonov
Copy link
Collaborator

@iSazonov iSazonov commented Nov 2, 2021

PR Summary

Replace #16349
Fix #14095

PR Context

PR Checklist

@iSazonov iSazonov added the CL-Performance Indicates that a PR should be marked as a performance improvement in the Change Log label Nov 2, 2021
@Fs00
Copy link
Contributor

Fs00 commented Nov 8, 2021

I want to point out that this PR would also fix #14095 😃

@ghost ghost added the Review - Needed The PR is being reviewed label Nov 19, 2021
@ghost
Copy link

ghost commented Nov 19, 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

Copy link
Collaborator

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

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

LGTM

@JamesWTruher
Copy link
Member

i think the strong argument here is the breaking of the circular dependency.

@pull-request-quantifier-deprecated

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


Quantification details

Label      : Large
Size       : +102 -111
Percentile : 61.3%

Total files changed: 5

Change summary by file extension:
.psd1 : +1 -0
.ps1xml : +100 -0
.cs : +0 -109
.ps1 : +1 -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 daxian-dbw added Breaking-Change breaking change that may affect users and removed Review - Needed The PR is being reviewed labels Jul 25, 2022
@daxian-dbw
Copy link
Member

daxian-dbw commented Jul 25, 2022

@SteveL-MSFT and @JamesWTruher This is a breaking change:

  • Before this change, a user doesn't need to explicitly import the Microsoft.PowerShell.Security module to use the code properties defined for an instance of System.Security.AccessControl.ObjectSecurity.
  • After this change, a user needs to explicitly import Microsoft.PowerShell.Security module in order to use those code properties and code methods.

Are you fine to accept this breaking change?

@SteveL-MSFT
Copy link
Member

SteveL-MSFT commented Jul 25, 2022

@daxian-dbw I did a search on GitHub for use of AccessToString and all the cases I looked at use Get-Acl which comes from the Security module. Although it's possible using .NET APIs to get an ObjectSecurity instance, it would seem that most, if not all, usage is coming from this module. Seems unlikely that someone would be impacted and the workaround is to import the Security module.

@JamesWTruher
Copy link
Member

@SteveL-MSFT and @JamesWTruher This is a breaking change:

  • Before this change, a user doesn't need to explicitly import the Microsoft.PowerShell.Security module to use the code properties defined for an instance of System.Security.AccessControl.ObjectSecurity.
  • After this change, a user needs to explicitly import Microsoft.PowerShell.Security module in order to use those code properties and code methods.

Are you fine to accept this breaking change?

I think the general use case is going to because someone invoked Get-Acl or some other command from the module which will result in autoloading and those folks will never be affected by this change. However, there are some scenarios where this won't be the case, and those folks will need to load the module. I'm having trouble handicapping the probabilities of those scenarios, though. I don't think it's going to happen very often, and enabling the behavior is pretty easy. It will definitely need documenting, but I think it's ok.

@daxian-dbw
Copy link
Member

/rebase

@github-actions
Copy link
Contributor

github-actions bot commented Jul 26, 2022

Started rebase: https://github.com/PowerShell/PowerShell/actions/runs/2736080597

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

@daxian-dbw
Copy link
Member

Just checked on Linux, Access Control List APIs are only supported on Windows, so the changes to src/Modules/Windows/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 is sufficient, not need to change the Unix version of Microsoft.PowerShell.Security.psd1.

@daxian-dbw daxian-dbw merged commit 08e4596 into PowerShell:master Jul 26, 2022
@daxian-dbw daxian-dbw added CL-BreakingChange Indicates that a PR should be marked as a breaking change in the Change Log and removed Breaking-Change breaking change that may affect users labels Jul 26, 2022
@iSazonov iSazonov deleted the perf-startup-psxml-2 branch July 26, 2022 04:17
@ghost
Copy link

ghost commented Aug 12, 2022

🎉v7.3.0-preview.7 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
CL-BreakingChange Indicates that a PR should be marked as a breaking change in the Change Log CL-Performance Indicates that a PR should be marked as a performance improvement in the Change Log Large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Circular dependency at runtime between System.Management.Automation and Microsoft.PowerShell.Security
6 participants