Skip to content

Commit b81a6ad

Browse files
jamietannagpt-4.1
andauthored
chore(azure): log the resolved MergeMethod for a given branch (#42847)
To aid with debugging, it would be useful to confirm what the resulting method is, in both paths. With help from GPT-4.1 to craft the enum-to-string conversion. Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>
1 parent f391c50 commit b81a6ad

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

lib/modules/platform/azure/azure-helper.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,26 @@ export async function getMergeMethod(
167167

168168
try {
169169
// TODO: fix me, wrong types
170-
return Object.keys(policyConfigurations)
170+
const method = Object.keys(policyConfigurations)
171171
.map(
172172
(p) =>
173173
GitPullRequestMergeStrategy[
174174
p.slice(5) as never
175175
] as never as GitPullRequestMergeStrategy,
176176
)
177177
.find((p) => p)!;
178+
logger.debug(
179+
{ policyConfigurations },
180+
// TODO: types (#22198)
181+
`getMergeMethod(branchRef=${branchRef!})=${GitPullRequestMergeStrategy[method]}`,
182+
);
183+
return method;
178184
} catch {
185+
logger.debug(
186+
{ policyConfigurations },
187+
// TODO: types (#22198)
188+
`getMergeMethod(branchRef=${branchRef!})=NoFastForward, as an error occured`,
189+
);
179190
return GitPullRequestMergeStrategy.NoFastForward;
180191
}
181192
}

0 commit comments

Comments
 (0)