Skip to content

Commit 700a4da

Browse files
committed
fix: handle DELETED status from GitHub GraphQL API
The GitHub GraphQL API returns uppercase status values (DELETED, ADDED, MODIFIED) but the code only checked for lowercase 'removed'. This caused deleted files to attempt content retrieval instead of being added to the deprecation queue. - Update status check to handle both 'DELETED' and 'removed' - Add test case for DELETED status handling
1 parent 5c14c4d commit 700a4da

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

services/workflow_processor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ func (wp *workflowProcessor) processFileForWorkflow(
127127
})
128128

129129
// Handle file based on status
130-
if file.Status == "removed" {
130+
// GitHub GraphQL API returns uppercase status: "DELETED", "ADDED", "MODIFIED", etc.
131+
if file.Status == "DELETED" || file.Status == "removed" {
131132
// Add to deprecation map
132133
wp.addToDeprecationMap(workflow, targetPath)
133134
} else {

services/workflow_processor_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,11 @@ func TestWorkflowProcessor_FileStatusHandling(t *testing.T) {
731731
status: "removed",
732732
expectDeprecated: true,
733733
},
734+
{
735+
name: "DELETED file goes to deprecation (GraphQL API format)",
736+
status: "DELETED",
737+
expectDeprecated: true,
738+
},
734739
{
735740
name: "added file does not go to deprecation",
736741
status: "added",

0 commit comments

Comments
 (0)