Skip to content

fix: honor explicit apihost throughout deploy - #661

Open
mvanhorn wants to merge 1 commit into
slackapi:mainfrom
mvanhorn:fix/129-apihost-consistency
Open

fix: honor explicit apihost throughout deploy#661
mvanhorn wants to merge 1 commit into
slackapi:mainfrom
mvanhorn:fix/129-apihost-consistency

Conversation

@mvanhorn

Copy link
Copy Markdown

Changelog

  • Treat a non-empty APIHostFlag as the signal that this invocation is intentionally targeting a custom endpoint: preserve its existing precedence in ResolveAPIHost, and bypass automatic rotation of saved credentials so rotation cannot contact a different stored host. In the deploy path, use the resolved explicit host for SLACK_API_URL regardless of whether its first hostname label begins with dev, while retaining current behavior for invocations without an explicit custom host. Move the environment-variable update into a small production helper called by deployApp so host-selection and error behavior can be tested directly, and propagate an AddVariable failure through the existing deploy error path rather than discarding it.

Summary

Treat a non-empty APIHostFlag as the signal that this invocation is intentionally targeting a custom endpoint: preserve its existing precedence in ResolveAPIHost, and bypass automatic rotation of saved credentials so rotation cannot contact a different stored host. In the deploy path, use the resolved explicit host for SLACK_API_URL regardless of whether its first hostname label begins with dev, while retaining current behavior for invocations without an explicit custom host. Move the environment-variable update into a small production helper called by deployApp so host-selection and error behavior can be tested directly, and propagate an AddVariable failure through the existing deploy error path rather than discarding it.

The hidden --apihost flag is intended to direct a CLI invocation to a custom Slack API endpoint, but deploy only writes SLACK_API_URL when the resolved hostname matches the narrower dev* convention. As a result, an explicit endpoint such as api.your.test.endpoint can 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.

@mvanhorn
mvanhorn requested a review from a team as a code owner August 29, 2026 03:32
@salesforce-cla salesforce-cla Bot added the cla:signed The CLA was signed by the pull request author label Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:signed The CLA was signed by the pull request author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: --apihost flag limitations

1 participant