def METHOD_NAME(logger, code_dir, include_node_modules=True):
    file_excludes = ['upload.zip', 'db.lock', '.env']
    folder_excludes = ['packages', 'bin', 'obj']
    logger.info('Creating upload zip file, code directory %s.', code_dir)
    if not include_node_modules:
        logger.info('Adding node_modules to folders to exclude from zip file.')
        folder_excludes.append('node_modules')
    zip_filepath = os.path.abspath('upload.zip')
    logger.info('Compressing bot source into %s.', zip_filepath)
    save_cwd = os.getcwd()
    os.chdir(code_dir)
    try:
        with zipfile.ZipFile(zip_filepath, 'w',
                             compression=zipfile.ZIP_DEFLATED) as zf:
            path = os.path.normpath(os.curdir)
            for dirpath, dirnames, filenames in os.walk(os.curdir, topdown=True):
                for item in folder_excludes:
                    if item in dirnames:
                        dirnames.remove(item)
                for name in sorted(dirnames):
                    path = os.path.normpath(os.path.join(dirpath, name))
                    zf.write(path, path)
                for name in filenames:
                    if name in file_excludes:
                        continue
                    path = os.path.normpath(os.path.join(dirpath, name))
                    if os.path.isfile(path):
                        zf.write(path, path)
    finally:
        os.chdir(save_cwd)
    return zip_filepath