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

Fix compatibility profile query API so that aliases referring to other modules appear #1194

Merged
merged 4 commits into from May 28, 2019

Conversation

rjmholt
Copy link
Contributor

@rjmholt rjmholt commented Mar 25, 2019

PR Summary

Previously because of bad assumptions I made, an alias in a module that aliases a command outside that module would just be omitted from that module's query API.

I originally "fixed" this by building a table of aliases at profiling time and putting the aliases back into the modules of the commands they referenced. Not only was that wrong, but it also made profiling much slower.

Functionally, rules will see no differences and there are no breaking changes in the API, BUT this fixes the alias thing and should speed up profiling significantly (the latter being something I need).

PR Checklist

@rjmholt rjmholt changed the title WIP: Fix compatibility profile query API so that aliases referring to other modules appear Fix compatibility profile query API so that aliases referring to other modules appear Mar 25, 2019
@rjmholt
Copy link
Contributor Author

rjmholt commented Mar 25, 2019

Not sure why the git diff is so large. I tried making the changes in that file again but the git diff is still huge. No encoding change either.

@bergmeister
Copy link
Collaborator

@rjmholt Using a whitespace ignoring diff, it is only a magnitude of ~ 100 lines changed, maybe there were some tabs in the original code (please don't tell me you're using tabs 😜)

@rjmholt
Copy link
Contributor Author

rjmholt commented Mar 25, 2019

maybe there were some tabs in the original code (please don't tell me you're using tabs 😜)

Shouldn't be -- I press Tab but that should expand to 4 spaces. Either way I wrote the file originally.

Anyway, I tried redoing the changes in a fresh commit and that didn't work... But the psm1 changes just delete the alias table stuff.

Copy link
Collaborator

@bergmeister bergmeister left a comment

Choose a reason for hiding this comment

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

Looks, Ok, just the questions around case insensitive dictionaries and one optional style comment about using named tuples

@rjmholt
Copy link
Contributor Author

rjmholt commented Apr 24, 2019

@JamesWTruher I've just added some extra tests to capture aliases that are created outside the module of the command they refer to. The only ones I'm aware of are in the engine, and I dealt with them a different way before this change, so the tests will pass in both cases. But they do test that aliases defined elsewhere are still picked up.

Copy link
Member

@JamesWTruher JamesWTruher left a comment

Choose a reason for hiding this comment

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

looks fine to me (once the merge conflicts are addressed), thanks for adding more tests!

@rjmholt
Copy link
Contributor Author

rjmholt commented May 17, 2019

Ok I've rebased now. Let's see what the tests say

@JamesWTruher JamesWTruher merged commit 64b77fb into PowerShell:development May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants