MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / resolveSelectedWorkflows

Function resolveSelectedWorkflows

src/utils/tool-registry.ts:339–370  ·  view source on GitHub ↗
(
  manifest: ResolvedManifest,
  requestedWorkflows: string[] | undefined,
  ctx: PredicateContext,
)

Source from the content-addressed store, hash-verified

337}
338
339function resolveSelectedWorkflows(
340 manifest: ResolvedManifest,
341 requestedWorkflows: string[] | undefined,
342 ctx: PredicateContext,
343): WorkflowManifestEntry[] {
344 const customSelection = createCustomWorkflowsFromConfig(manifest, ctx.config.customWorkflows);
345 for (const warning of customSelection.warnings) {
346 log('warning', warning);
347 emitConfigWarningMetric('invalid_custom_workflow');
348 }
349 const allWorkflows = [...manifest.workflows.values(), ...customSelection.workflows];
350
351 const normalizedRequestedWorkflows = requestedWorkflows
352 ?.map(normalizeName)
353 .filter((name) => name.length > 0);
354
355 const selectedWorkflows = selectWorkflowsForMcp(allWorkflows, normalizedRequestedWorkflows, ctx);
356 const knownWorkflowIds = new Set(allWorkflows.map((workflow) => workflow.id));
357 const unknownRequestedWorkflows = (normalizedRequestedWorkflows ?? []).filter(
358 (workflowName) => !knownWorkflowIds.has(workflowName),
359 );
360 if (unknownRequestedWorkflows.length > 0) {
361 const uniqueUnknownRequestedWorkflows = [...new Set(unknownRequestedWorkflows)];
362 log(
363 'warning',
364 `[config] Ignoring unknown workflow(s): ${uniqueUnknownRequestedWorkflows.join(', ')}`,
365 );
366 emitConfigWarningMetric('unknown_workflow');
367 }
368
369 return selectedWorkflows;
370}
371
372async function tryImportToolModule(
373 toolManifest: ToolManifestEntry,

Callers 1

Calls 4

logFunction · 0.90
selectWorkflowsForMcpFunction · 0.90
emitConfigWarningMetricFunction · 0.85

Tested by

no test coverage detected