Katolus / functions

Use of FIXME/XXX/TODO encountered PYL-W0511
Documentation
Minor
2 years ago3 years old
TODO: To be updated when tackling generic docker runtimes
 22def generate_dockerfile_content(function: FunctionRecord) -> str:
 23    """Generates Dockerfile content for a GCP resource"""
 24
 25    # TODO: To be updated when tackling generic docker runtimes 26    # Consider if this is the best place to handle this and implications on other types
 27    # Perhaps this should be stored in the cloud function module.
 28    return """
TODO: Figure out the correct types for this
49def handle_function_build_errors(error: FunctionBuildError) -> NoReturn:
50    """Handles the base case for all the function errors"""
51    # Log the build logs
52    logs.debug(error.build_log)  # TODO: Figure out the correct types for this53    logs.exception(error)
54    raise UsageError(f"{error.message}. Reason: {error.reason}")
55
TODO: Validate if there is a better way to do this
 83
 84def get_nested_commands() -> List[NestedCommand]:
 85    """Get nested commands"""
 86    # TODO: Validate if there is a better way to do this 87    from functions import commands
 88
 89    return [
TODO: Add caching to this functions or it will be too slow
 95        logs.debug(f"Writing function registry to file: {cls.filepath()}")
 96        write_to_file(cls.filepath(), content.json())
 97
 98    # TODO: Add caching to this functions or it will be too slow 99    @classmethod
100    def load(cls) -> FunctionRegistry:
101        """Loads the main configuration from file"""
TODO: Find a better way to do this
 36    @classmethod
 37    def check_components(cls) -> Sequence[ComponentType]:
 38        """Checks the components and returns a list of the components"""
 39        # TODO: Find a better way to do this 40        # Loads GCP and Docker components so that they can be seen by the subclass method
 41        # Doing this defeats the purpose of using the subclass command
 42        from functions.components.docker import DockerComponent