Repository navigation
fix: keep the deployment delete request on the workflow mapping DTO - #7063
Open
arpitjain099 wants to merge 1 commit into
Open
arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude <[email protected]> Signed-off-by: Arpit Jain <[email protected]>
arpitjain099
requested review from
prakarsh-dt and
vivek-devtron
as code owners
October 18, 2026 13:09
|
Bito Review Skipped - Source Branch Not Found |
|
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.



Description
FindAllAppWorkflowMappinglooks up which CD pipelines have a pending deployment delete request, then tries to set the flag on the DTOs it is about to return:workflowMappingDtosis a[]bean4.AppWorkflowMappingDto, a value slice, soworkflowMappingis a copy and the write is discarded. TheFilterDeploymentDeleteRequestedPipelineIdsquery above it runs and its result can never reach the response, soDeploymentAppDeleteRequestis always false on every mapping this function returns.The two sibling functions building the same DTO,
FindAppWorkflowMappingandFindAppWorkflowMappingForEnv, both set the field on a local before appending and are correct.IsLasta few lines earlier in this same loop region is also set before the append, which is why that one arrives and this one does not.Two live GET routes serve the result,
/app/app-wf/{app-id}and/app/app-wf/view/{app-id}, and the field is serialized asdeploymentAppDeleteRequest. No Go code reads it back off this DTO, so the consumer is the dashboard, which branches on it inCDNode.tsxto open the delete popup rather than the editor, refuse a trigger, and render the DELETE badge. I have not traced which dashboard fetch maps to which route, so I would put it as: both routes return false unconditionally while the database says otherwise, and the badge is the probable visible effect rather than a proven one.The fix is the indexed loop, and it uses
bean4.CD_PIPELINE_TYPEinstead of the"CD_PIPELINE"literal since the same function already uses the constant ten lines above.Fixes #
pkg/appWorkflowhad no test file. The new one stubs only the two repository methods this function calls, embedding the interfaces so anything else would fail loudly. Three cases: no delete request, one of two CD pipelines, then both. The first passes either way; the other two fail on main withDeploymentAppDeleteRequest = false, want true. Each case also assertsIsLast, which is set on the local before the append, so a passingIsLastshows the DTOs really were populated and the failure is the dropped write rather than an empty fixture.Plain correctness, no authz or tenancy surface involved; the flag is only ever written server-side.
AI assistance was used on this change and is disclosed in the commit trailer.