Repository: Azure/azure-rest-api-specs
File: eng/tools/summarize-impact/src/cli.ts (TypeScript)

Code before:
        multiple: false,
      },
      owner: {
        type: "string",
        short: "o",
        multiple: false,
      },
      isDraft: {
        type: "boolean",
        multiple: false,
        default: false,
      },
    },
    allowPositionals: true,
  };

  const { values: opts } = parseArgs(config);

  // todo: refactor these opts
  const sourceDirectory = opts.sourceDirectory as string;
  const targetDirectory = opts.targetDirectory as string;
  const sourceGitRoot = await getRootFolder(sourceDirectory);
  const targetGitRoot = await getRootFolder(targetDirectory);
  const fileList = await getChangedFilesStatuses({
    cwd: sourceGitRoot,
    // code in diff-types.ts and impact.ts assumes the file list only contains add/modify/delete, not rename
    gitOptions: ["--no-renames"],
    logger: defaultLogger,
    paths: ["specification"],
  });
  const sha = opts.sha as string;
  const sourceBranch = opts.sourceBranch as string;
  const targetBranch = opts.targetBranch as string;
  const repo = opts.repo as string;
  const owner = opts.owner as string;
  const prNumber = opts.number as string;
  const isDraft = opts.isDraft as boolean;

  // create github client (use token if available, otherwise unauthenticated. we will throw if unhandled)
  const github = new Octokit({
    ...(process.env.GITHUB_TOKEN && { auth: process.env.GITHUB_TOKEN }),
  });

  // this is a request to get the list of RPaaS folders from azure-rest-api-specs -> main branch -> dump specification folder names
  const mainSpecFolders = await getRPaaSFolderList(github, owner, repo);

  const labelContext: LabelContext = {
    // summarize-impact only triggers on PR code changes, not label changes.  Since this code cannot depend
    // on the state of any labels at the time it runs, initialize the "present" set of labels to empty.
    present: new Set(),
    toAdd: new Set(),

Review comment (suggestion):
```suggestion
    // code in diff-types.ts and impact.ts assumes the file list only contains add/modify/delete, not renames
```

Code after:
        multiple: false,
      },
      owner: {
        type: "string",
        short: "o",
        multiple: false,
      },
      isDraft: {
        type: "boolean",
        multiple: false,
        default: false,
      },
    },
    allowPositionals: true,
  };

  const { values: opts } = parseArgs(config);

  // todo: refactor these opts
  const sourceDirectory = opts.sourceDirectory as string;
  const targetDirectory = opts.targetDirectory as string;
  const sourceGitRoot = await getRootFolder(sourceDirectory);
  const targetGitRoot = await getRootFolder(targetDirectory);
  const fileList = await getChangedFilesStatuses({
    cwd: sourceGitRoot,
    // code in diff-types.ts and impact.ts assumes the file list only contains add/modify/delete, not renames
    gitOptions: ["--no-renames"],
    logger: defaultLogger,
    paths: ["specification"],
  });
  const sha = opts.sha as string;
  const sourceBranch = opts.sourceBranch as string;
  const targetBranch = opts.targetBranch as string;
  const repo = opts.repo as string;
  const owner = opts.owner as string;
  const prNumber = opts.number as string;
  const isDraft = opts.isDraft as boolean;

  // create github client (use token if available, otherwise unauthenticated. we will throw if unhandled)
  const github = new Octokit({
    ...(process.env.GITHUB_TOKEN && { auth: process.env.GITHUB_TOKEN }),
  });

  // this is a request to get the list of RPaaS folders from azure-rest-api-specs -> main branch -> dump specification folder names
  const mainSpecFolders = await getRPaaSFolderList(github, owner, repo);

  const labelContext: LabelContext = {
    // summarize-impact only triggers on PR code changes, not label changes.  Since this code cannot depend
    // on the state of any labels at the time it runs, initialize the "present" set of labels to empty.
    present: new Set(),
    toAdd: new Set(),