Merge pull request #192 from Pythagora-io/project_load

fix loading of project from where we left off when using app_id
This commit is contained in:
LeonOstrez
2023-10-12 21:03:52 +01:00
committed by GitHub
4 changed files with 12 additions and 7 deletions

View File

@@ -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 = [

View File

@@ -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.

View File

@@ -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()

View File

@@ -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"]})'))