Repository navigation
Conversation
…ckage_version Queries for dependency SubscriberPackageVersions reused the target package's install key. The Tooling API only requires the InstallationKey filter when the queried version is itself protected by a key, and rejects a mismatched key with INSTALL_KEY_INVALID, so a dependency with a different key (or none) made release_unlocked_production fail. Dependency queries now retry once without the key filter when the configured key is rejected with INSTALL_KEY_INVALID. The target package's own queries are unchanged.
Added tests for handling dependency queries with install key validation and retry logic.
|
Thanks for the contribution! Before we can merge this, we need @jeromeyyy to sign the Salesforce Inc. Contributor License Agreement. |
…queries Handle exceptions when querying subscriber package versions without an install key.
Only exact structured INSTALL_KEY_INVALID errors trigger the proposed fallback. Preserve errors from its retry and remove the unsupported promotion workaround.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See #4007
Problem
release_unlocked_production(viapromote_package_version) queries every dependency'sSubscriberPackageVersionwith the target package'sinstall_keyin theInstallationKeyfilter. As reported in #4007, when a dependency unlocked package does not share that key, the Tooling API rejects the query withINSTALL_KEY_INVALIDand the release fails.What this changes (and what it does not)
Dependency
SubscriberPackageVersionqueries now retry once without theInstallationKeyfilter when the configured key is rejected withINSTALL_KEY_INVALID.InstallationKeyfilter when the queried version is itself protected by a key, so a keyless retry should let the release proceed in that case. However, the issue report involves a differently-keyed dependency, and there is no live-org or documented evidence here that a non-key-protected version rejects a mismatched key filter withINSTALL_KEY_INVALID- so this path is proposed behavior that needs maintainer qualification, not an established defect fix.Only a structured error response containing the exact
errorCodevalueINSTALL_KEY_INVALIDtriggers the retry. Unrelated API errors, malformed error payloads, and failures on the target-package path propagate unchanged.Queries for the target package itself are unchanged: its configured key is still used, and a rejection still fails the task.
Tests