Skip to content

Fix GPG ID lookup and remove hardcoded test credentials#2274

Open
Copilot wants to merge 9 commits intomainfrom
copilot/fix-issue-2263
Open

Fix GPG ID lookup and remove hardcoded test credentials#2274
Copilot wants to merge 9 commits intomainfrom
copilot/fix-issue-2263

Conversation

Copy link

Copilot AI commented Feb 27, 2026

  • Fix GetGpgId walk-up logic (previous session)
  • Replace "letmein123" hardcoded fake password with Guid.NewGuid().ToString("N") in new tests
  • Inline InitializePasswordStoreWithGpgIdInSubdirectory helper directly into GnuPassCredentialStore_ReadWriteDelete_GpgIdInSubdirectory test (per reviewer request)
  • All 5 GnuPassCredentialStore tests pass

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…2263)

Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue 2263 in the codebase Fix pass credential store: support .gpg-id in subdirectories Feb 27, 2026
…teFiles

Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
Copilot AI and others added 3 commits February 27, 2026 15:44
Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
… in GetGpgId

Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
Copilot AI changed the title Fix pass credential store: support .gpg-id in subdirectories Remove credentialPath parameter from GetGpgId, use StoreRoot Feb 27, 2026
// Search for a .gpg-id file anywhere under the store root.
// This handles configurations where .gpg-id is in a subdirectory
// (e.g., a git submodule) rather than the store root itself.
foreach (string gpgIdPath in FileSystem.EnumerateFiles(StoreRoot, ".gpg-id"))
Copy link
Contributor

Choose a reason for hiding this comment

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

This is incorrect. This is going to do a top-down walk from the StoreRoot looking for any .gpg-id file.

We should instead be searching UP from the full credential path looking for the closest .gpg-id. Otherwise doing the top-down walk could result in us picking an incorrect GPG identity for the given credential.

We must align the behaviour with GNU Pass.

…behaviour

Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
Copilot AI changed the title Remove credentialPath parameter from GetGpgId, use StoreRoot Fix GetGpgId: walk up from credential path to StoreRoot to match GNU Pass behaviour Mar 3, 2026
…asswords

Co-authored-by: marekzmyslowski <1062877+marekzmyslowski@users.noreply.github.com>
Copilot AI changed the title Fix GetGpgId: walk up from credential path to StoreRoot to match GNU Pass behaviour Fix GPG ID lookup and remove hardcoded test credentials Mar 3, 2026
@marekzmyslowski marekzmyslowski marked this pull request as ready for review March 12, 2026 08:04
@marekzmyslowski marekzmyslowski requested a review from a team as a code owner March 12, 2026 08:04
@mjcheetham mjcheetham self-assigned this Mar 12, 2026
Copy link
Contributor

@mjcheetham mjcheetham left a comment

Choose a reason for hiding this comment

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

Last request to simplify one of the tests, but this is a good direction now!

return storePath;
}

private static string InitializePasswordStoreWithGpgIdInSubdirectory(TestFileSystem fs, TestGpg gpg, string subdirectory)
Copy link
Contributor

Choose a reason for hiding this comment

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

This method is now only used in one test. Can we inline this in the GnuPassCredentialStore_ReadWriteDelete_GpgIdInSubdirectory test, so that it matches the other test (GnuPassCredentialStore_WriteCredential_MultipleGpgIds_UsesNearestGpgId) that does all the store/.gpg-id setup in the test method?

Copy link
Author

Choose a reason for hiding this comment

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

Done in b641577. The InitializePasswordStoreWithGpgIdInSubdirectory helper has been removed and its logic inlined directly into GnuPassCredentialStore_ReadWriteDelete_GpgIdInSubdirectory, matching the style of the MultipleGpgIds test.

Co-authored-by: mjcheetham <5658207+mjcheetham@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.29/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.29/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

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