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

⬆️ SecretManagement 1.1.0 Compatibility #55

Merged
merged 17 commits into from
Aug 22, 2021

Conversation

JustinGrote
Copy link
Owner

SecretManagement 1.1.0 moves the vault extension into its own runspace and adds a new Unlock-SecretVault mechanism. This adds support for that new operating model.

JustinGrote and others added 12 commits May 17, 2021 17:00
SecretManagement 1.1.0 moves the vault extension into its own runspace and adds a new Unlock-SecretVault mechanism. This adds support for that new operating model.
* Added PSFramework Logging prereq

* Added updating an existing entry to Set-Secret and to SecretManagement.KeePass/Tests/SecretManagementVault.Tests.ps1

* Logging added to Unlock-SecretVault
Version increase

* Removed investigative logging

* Update Dependencies
@JustinGrote
Copy link
Owner Author

@Callidus2000 if you can find out why Write-PSFMessage -Error has different behavior than write-error that causes the trap tests to fail I'd appreciate it, otherwise I'm just going to revert them to write-error for now.

@Callidus2000
Copy link
Contributor

@JustinGrote The PSFramework works with an Opt-In-Exception concept. Because of this Write-PSFMessage -Level Error does not throw exceptions/trigger traps. If this should be necessary/desired a few more changes have to be implemented, more details documented by Fred in the documentation.

@Callidus2000
Copy link
Contributor

Hi,
any idea when the new module version will be build and submitted?

@JustinGrote
Copy link
Owner Author

Hi,
any idea when the new module version will be build and submitted?

Still failing tests I haven't gotten around to troubleshooting yet.

Copy link

@OranguTech OranguTech left a comment

Choose a reason for hiding this comment

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

Microsoft.Powershell.SecretManagement 1.1.0 GA has been released, FWIW. (.config/RequiredModules.psd1)

https://devblogs.microsoft.com/powershell/announcing-secretmanagement-1-1-ga/

@JustinGrote
Copy link
Owner Author

Yeah I'm aware, this is a volunteer project and I only have so much time in the day, if you want to sponsor me to pay to get it done I can dedicate more time to it, or you can help contribute to fix the bugs so that the tests pass :)

@Callidus2000
Copy link
Contributor

Taking a look at it, first encounter with GitHub actions for me....
Press Build / Build is already working, the Press Build / Test is ongoing... Did miss that not all pester tests are located within the test-folder....

@Callidus2000
Copy link
Contributor

Yargh...
In my fork the build workflow runs perfectly, tests work everywhere but under windows os.
https://github.com/Callidus2000/SecretManagement.KeePass/runs/3371843015?check_suite_focus=true

image

If I comment out the windows os everything runs.
https://github.com/Callidus2000/SecretManagement.KeePass/actions/runs/1146988885
image

For me currently a mystery is why the tests fail on windows. I've eliminated all bugs caused by my lazy PSFramework integration (and missing the other pester test files), all tests run on my windows system.
Either the windows os should be excluded from the workflow or I need more time for a GitHub Actions deep dive....

@JustinGrote
Copy link
Owner Author

Looks like PSFramework hasn't been added to the Press prerequisite module list so it's not downloading it.
image

@Callidus2000
Copy link
Contributor

Any hint where to do this?

@JustinGrote
Copy link
Owner Author

JustinGrote commented Aug 19, 2021

Any hint where to do this?

.config/RequiredModules.ps1, secretmanagement should be bumped too

@Callidus2000
Copy link
Contributor

Nope, this one I'd already found:
https://github.com/Callidus2000/SecretManagement.KeePass/blob/fix/SecretManagement1.1.0/.config/RequiredModules.psd1

@{
    'Microsoft.Powershell.SecretManagement' = '1.1.0'
    'PowerConfig'                           = '0.1.3'
    'PSFramework'                           = '1.6.205'
}

@JustinGrote
Copy link
Owner Author

@Callidus2000 I'm just saying that's why it's failing in this PR currently.

@Callidus2000
Copy link
Contributor

Hi @JustinGrote, misunderstood you...

I want to help to get rid of the errors. In order to do so I created a new fork and fixed everything but the workflow tests under Windows. I do not understand why as (now all) the pester tests work fine my Win10 real system.

In my previous commit I added PSFramework into the module as one change. Doing so I totally missed that there are more than one pester file. Now all the following tests work under my win10 system:

Register-KeePassSecretVault.Tests.ps1
Get-Secret.Tests.ps1
Remove-Secret.Tests.ps1
Test-SecretVault.Tests.ps1
SecretManagementVault.Tests.ps1
(used Get-ChildItem *.Tests.ps1 -Recurse|ForEach-Object {. $_.FullName} for running all tests)

After a little digging into the GitHub Actions the automatic build&test now work, too. With one exception: the windows-os-runners fail the tests with "missing modules" error messages (The required module 'Microsoft.Powershell.SecretManagement' is not loaded). This work week was too long, cannot find the specific tree in the forest. Therefor I commented the windows entries in press.yml out to make the workflow work without it.

-Sascha aka callidus2000

* Update press.yml

Added PSFramework

* Added PSFramework

* Corrected Spelling Error "PSFramwork" (missing 'e')

* Fixed pester tests errors caused by converting to Write-PSFMessage

* -Removed os:
 ubuntu-16.04 (as deprecated)
 macos-latest (as identical with explicit version)
 windows-latest (as identical with explicit version)
 ubuntu-latest (as identical with explicit version)

* Removed Windows os

* Update press.yml
@JustinGrote
Copy link
Owner Author

@Callidus2000 what looks like is happening is the pester tests are run in a separate standalone job for some tests, and secretmanagement is not getting loaded into that job. It's looking pretty good otherwise, I imagine I can fix that pretty quick tonight. Thanks for your hard work on this.

@JustinGrote
Copy link
Owner Author

@Callidus2000 it's the Windows Powershell (5.1) tests that are failing
image

@JustinGrote
Copy link
Owner Author

There appears to be a recursion issue with running the WInPS tests in a Windows Powershell Job, doesnt happen when run as a main process though. I'll see if I can workaround it for now and fully fix later.

@JustinGrote
Copy link
Owner Author

I'm pretty sure the problem is the PSModulePath isn't carrying into the 5.1 job
image

@JustinGrote
Copy link
Owner Author

The problem is a transient stacktrace problem when doing winPS tests. I've disabled the tests with a warning for now since they all pass locally and will merge.
pester/Pester#1974

@JustinGrote JustinGrote merged commit b63765a into main Aug 22, 2021
@JustinGrote JustinGrote deleted the fix/SecretManagement1.1.0 branch August 22, 2021 16:17
@JustinGrote
Copy link
Owner Author

@Callidus2000 thanks for your patience on this.

@Callidus2000
Copy link
Contributor

@JustinGrote No problem, I fully understand the problem of missing free times for personal projects. I'm glad that the problems had some base within the underlying/used eco system ;-)

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.

3 participants