diff --git a/pilot/const/common.py b/pilot/const/common.py index 1e9f559d..4d57d74d 100644 --- a/pilot/const/common.py +++ b/pilot/const/common.py @@ -3,9 +3,9 @@ ROLES = { 'product_owner': ['project_description', 'user_stories', 'user_tasks'], 'architect': ['architecture'], 'tech_lead': ['development_planning'], - 'full_stack_developer': ['create_scripts', 'coding'], + 'full_stack_developer': ['coding'], 'dev_ops': ['environment_setup'], - 'code_monkey': ['create_scripts', 'coding', 'implement_changes'] + 'code_monkey': ['coding'] } STEPS = [ 'project_description', @@ -14,9 +14,8 @@ STEPS = [ 'architecture', 'environment_setup', 'development_planning', - 'create_scripts', 'coding', - 'implement_changes' + 'finished' ] IGNORE_FOLDERS = [ diff --git a/pilot/helpers/Project.py b/pilot/helpers/Project.py index ad7aa907..9eb37ebc 100644 --- a/pilot/helpers/Project.py +++ b/pilot/helpers/Project.py @@ -3,7 +3,7 @@ import os from typing import Tuple from utils.style import yellow_bold, cyan, white_bold from const.common import IGNORE_FOLDERS, STEPS -from database.database import delete_unconnected_steps_from, delete_all_app_development_data +from database.database import delete_unconnected_steps_from, delete_all_app_development_data, update_app_status from const.ipc import MESSAGE_TYPE from prompts.prompts import ask_user from helpers.exceptions.TokenLimitError import TokenLimitError @@ -140,6 +140,11 @@ class Project: }), type='info') self.developer.start_coding() + def finish(self): + update_app_status(self.args['app_id'], STEPS[-1]) + # TODO say that project is finished and ask user for additional features, fixes,... + return + def get_directory_tree(self, with_descriptions=False): """ Get the directory tree of the project. diff --git a/pilot/main.py b/pilot/main.py index 4aaf87e5..aaa89de0 100644 --- a/pilot/main.py +++ b/pilot/main.py @@ -51,7 +51,7 @@ if __name__ == "__main__": # TODO get checkpoint from database and fill the project with it project = Project(args, ipc_client_instance=ipc_client_instance) project.start() - # TODO say that project is finished and ask user for additional features, fixes,... + project.finish() except Exception: print(red('---------- GPT PILOT EXITING WITH ERROR ----------')) traceback.print_exc() diff --git a/pilot/utils/arguments.py b/pilot/utils/arguments.py index bd305118..4fa9eb99 100644 --- a/pilot/utils/arguments.py +++ b/pilot/utils/arguments.py @@ -7,6 +7,7 @@ from getpass import getuser from database.database import get_app, get_app_by_user_workspace from utils.style import green_bold from utils.utils import should_execute_step +from const.common import STEPS def get_arguments(): @@ -44,7 +45,7 @@ def get_arguments(): arguments['app_type'] = app.app_type arguments['name'] = app.name if 'step' not in arguments or ('step' in arguments and not should_execute_step(arguments['step'], app.status)): - arguments['step'] = app.status + arguments['step'] = 'finished' if app.status == 'finished' else STEPS[STEPS.index(app.status) + 1] print(green_bold('\n------------------ LOADING PROJECT ----------------------')) print(green_bold(f'{app.name} (app_id={arguments["app_id"]})'))