-
Notifications
You must be signed in to change notification settings - Fork 157
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
Update Completer/Validator classes for #299, cache and class accessibility improvements #313
Update Completer/Validator classes for #299, cache and class accessibility improvements #313
Conversation
…lity improvements
…d spelling mistake in WIT Cache class
@jhoneill did you notice that all your PRs fail with the same error message on all environments? @DarqueWarrior is this coming from changes from us? UPDATE: Problem is explained in #315 |
Now, some thin skinned people would get offended at the suggestion they didn't build code before making a PR. :-) I don't think you can have read the change log, which explains that your build and my build are different, why and the choice you need to make It references a issue over on the PowerShell repo which advises Previously you were unhappy that I changed too much so I didn't want to check in a change to your build process and gave you a choice, either change 1 line in each of two of your files to load the classes "properly" PSM, or undo one of my changes to keep dot sourcing. I've changed the build files and it builds on Mac and Windows but the Linux build dies and there is no way to get the files that it built to see why. There are some pester tests which don't pass but Azure devops won't show me the test summary, so I can't see which of tests have an issue. It may the old problem of tests relying on loading specific PS1 files rather than loading the module. Following past advice I haven't even tried to run the unit tests locally. |
I didn't want to offend you. I just didn't understand the implications. As we are very cautious about changes in the core functionality we need to fully understand that the change for inclusion of the classes is a must-have. I have read your issue on the PowerShell repo. Does it have to do only with the completer classes? Why do classes have to be accessible from outside of the module? Could you shortly explain? I am not against best practices, but also need to trust that core functionalities are changing with the right quality and intend of the module and @DarqueWarrior. |
I should have put a :-) I'm not one of those thin skinned people, and no offence was taken . We are all trying very hard not to offend anybody (I think) and that might be having other side effects. Don't worry; I have the skin of a Rhino and I assume shared good will on github.
Yes, rightly so, and fully understood. Spacing is a "You might ,if you want..." change, Strictmode is a "Really, you must..." change and where you put classes is a "You should" change, it's better if you do, but nothing breaks if you don't. So it is your call but I need to explain it, to which leads to...
It is most visible with parameter attribute classes but it applies to all classes. Some things work OK with the classes private, for example The Microsoft docs say you can write a class with the name
Omitting "Attribute" when you use the class. This fails if the class is Dot Sourced. TBH I have stopped writing the name without the attribute part - it breaks in too many cases. Here are some examples of what fails with the dot sourcing method.
These were painful writing "Add-VsTeamProcess", because the parameters could not use the attributes which were private to the module, and an Add operation must either update the cache or invalidate it. During development Add-VsTeamProcess wasn't part of the module, it feels right to write a function & ensure it works before making it part of the module, without loading dependencies (and their dependencies) from the source tree during development. Here's what happens if the classes are loaded from the PSM1
The last one tab completes and I can see the Currently there is a function Get-VSTeamProcess {
[CmdletBinding(DefaultParameterSetName = 'List')]
[OutputType([vsteamprocess])]
...
} allows a line like this |
Well at least it is now up-to-date with master, and all the tests pass on Windows and MacOS. still don't know what the issue is with linux |
Thanks for taking the time to explain the changes. I don't want any classes or properties of classes exposed outside the module. Therefore, work might need to be done to abstract all that behind functions. Classes were originally introduced to support the use of ShiPS for the provider. Their use as expanded but the desire to expose them has not changed. I don't want to change the build process at this time. |
OK, understood. |
I moved the changes for the spaces to another PR that has been merged already. All the values are strings so there is no reason not to just quote all the results. |
We do return some classes from Functions that is true. But at this point what problem is that causing? I don't want to change our build process to fix a problem we don't have. |
I have experienced this and it is a bit annoying. But not so much so that I want to change the core build at this time. As a contributor it is a pain but as a user it is a nonissue. |
Agreed and understood. The developer workround is OK, and if build changes feel wrong, park them, at least for the time being
Well, the absence of unhappy users tells you all you need to know :-) There is a chance to make things better in the future if you make the change but no imperative to do it right now.
I saw. In other places PowerShell leaves the quotes out when they are not needed so I tried to follow that but not 100% necessary, just tidy. |
PR Summary
Updates to completers , validators and their associated caches
Detailed in changelog.md.
PR Checklist
No changes to user functionality
Existing tests should still work
Yes. Although most of the detail can be removed before publishing.