fix: honor explicit apihost throughout deploy - #661
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
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.
Changelog
APIHostFlagas the signal that this invocation is intentionally targeting a custom endpoint: preserve its existing precedence inResolveAPIHost, and bypass automatic rotation of saved credentials so rotation cannot contact a different stored host. In the deploy path, use the resolved explicit host forSLACK_API_URLregardless of whether its first hostname label begins withdev, while retaining current behavior for invocations without an explicit custom host. Move the environment-variable update into a small production helper called bydeployAppso host-selection and error behavior can be tested directly, and propagate anAddVariablefailure through the existing deploy error path rather than discarding it.Summary
Treat a non-empty
APIHostFlagas the signal that this invocation is intentionally targeting a custom endpoint: preserve its existing precedence inResolveAPIHost, and bypass automatic rotation of saved credentials so rotation cannot contact a different stored host. In the deploy path, use the resolved explicit host forSLACK_API_URLregardless of whether its first hostname label begins withdev, while retaining current behavior for invocations without an explicit custom host. Move the environment-variable update into a small production helper called bydeployAppso host-selection and error behavior can be tested directly, and propagate anAddVariablefailure through the existing deploy error path rather than discarding it.The hidden
--apihostflag is intended to direct a CLI invocation to a custom Slack API endpoint, but deploy only writesSLACK_API_URLwhen the resolved hostname matches the narrowerdev*convention. As a result, an explicit endpoint such asapi.your.test.endpointcan handle the CLI's API requests while being silently omitted from the deployed app environment. The thread also identifies that credential loading can rotate tokens against a saved host before the explicitly requested host takes effect. The fix must make the explicit flag authoritative for the invocation and report failures instead of silently completing a deploy with inconsistent configuration.Fixes #129
Preview
(Add screenshots, GIFs, or recordings that show the changes)
Testing
(List the steps used to verify these changes)
Notes
(Add any additional context, trade-offs, or follow-up items)
Requirements
AI was used for assistance.