fix(preview-deployment): refetch github provider before authenticating - #4933
Open
CyrilBIENNE wants to merge 1 commit into
Open
fix(preview-deployment): refetch github provider before authenticating#4933CyrilBIENNE wants to merge 1 commit into
CyrilBIENNE wants to merge 1 commit into
Conversation
`findApplicationById` redacts `githubPrivateKey` from the `github` relation, but `createPreviewDeployment` passed that redacted object straight to `authGithub`. Since `haveGithubRequirements` requires the private key, it always returned false and `authGithub` threw `TRPCError NOT_FOUND: "Github Account not configured correctly"`. That throw is uncaught in `pages/api/deploy/github.ts`, so every `pull_request` webhook returned a bare 500 and no preview deployment was ever created. Resolve the provider through `findGithubById(application.githubId)` instead, matching how every other call site obtains credentials. This keeps the redaction introduced for `findApplicationById` intact. Fixes Dokploy#4898 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Confirmed working on a self-hosted Dokploy v0.29.13 instance. We independently diagnosed the same root cause and applied an equivalent patch: Validated end-to-end with GitHub App authentication:
The fix has therefore been exercised against real GitHub webhook events, not only through a unit-level code review. |
|
Waiting for this! |
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.
findApplicationByIdredactsgithubPrivateKeyfrom thegithubrelation, butcreatePreviewDeploymentpassed that redacted object straight toauthGithub. SincehaveGithubRequirementsrequires the private key, it always returned false andauthGithubthrewTRPCError NOT_FOUND: "Github Account not configured correctly".That throw is uncaught in
pages/api/deploy/github.ts, so everypull_requestwebhook returned a bare 500 and no preview deployment was ever created.Resolve the provider through
findGithubById(application.githubId)instead, matching how every other call site obtains credentials. This keeps the redaction introduced forfindApplicationByIdintact.Fixes #4898
What is this PR about?
Please describe in a short paragraph what this PR is about.
Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
closes #123
Screenshots (if applicable)