fix: explicit check for Node.js key import #1380
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Situation
PR #1377 implemented an emergency workaround to unblock building a Cypress Docker image based on Node.js 22.17.0 (Active LTS version) and signed with the key
C0D6248439F1D5604AAFFB4021D900FFDB233756.The original issue was that the keyserver hkps://keys.openpgp.org recognized the key
C0D6248439F1D5604AAFFB4021D900FFDB233756and then skipped importing it. The user ID[email protected]had been moved to the newly created key5BE8A3F6C8A5C01D106C0AD820B1A390B168D356and was no longer available for the older key. This left thecypress/factoryprocess unable to verify the Node.js 22.17.0 package and so the build failed. (#1376 contains slightly more background information about the issue.)In the meantime, the nodejs/docker-node repo has faced the same issue and has implemented a more robust solution which checks the presence of the key after attempting to import, and thus does not rely on the misleading "success" return code if a key import is skipped.
Change
Add a check to list an imported key. If the key has not been imported, then an explicit error code is generated. In the case of the problematic key, this will then fallback to an attempt on the second keyserver.
gpg --batch --fingerprint "$key"The original priority of keyservers:
is also restored.
FACTORY_VERSIONbecomes5.11.3Verification
Confirm that key is imported