Skip to content

Commit

Permalink
fix(run): ai analyze clone
Browse files Browse the repository at this point in the history
  • Loading branch information
yakeJiang committed Sep 5, 2023
1 parent 2be2657 commit 4e7dad0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion backend/app/controllers/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ def getAll():
@json_response
def analyze_service():
_ = getI18n("controllers")
tenantID = session['tenant_id']
gitPath = request.json.get('service_git_path')

info, success = analyzeService(gitPath)
info, success = analyzeService(tenantID, gitPath)
if not success:
raise Exception(_("Failed to analysis applications."))

Expand Down
12 changes: 6 additions & 6 deletions backend/app/pkgs/knowledge/app_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,29 @@ def getServiceLib(appID, serviceName):
obj = AppInfoBasic()
else:
obj = AppInfoPro()

return obj.getServiceLib(appID, serviceName)

def getServiceStruct(appID, serviceName):
if GRADE == "base":
obj = AppInfoBasic()
else:
obj = AppInfoPro()

return obj.getServiceStruct(appID, serviceName)

def getServiceSpecification(appID, serviceName, LibName):
if GRADE == "base":
obj = AppInfoBasic()
else:
obj = AppInfoPro()

return obj.getServiceSpecification(appID, serviceName, LibName)

def analyzeService(gitPath):
def analyzeService(tenant_id, gitPath):
if GRADE == "base":
obj = AppInfoBasic()
else:
obj = AppInfoPro()
return obj.analyzeService(gitPath)

return obj.analyzeService(tenant_id, gitPath)
2 changes: 1 addition & 1 deletion backend/app/pkgs/knowledge/app_info_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def getServiceSpecification(self, appID, serviceName, LibName):

return specification, True

def analyzeService(self, gitPath):
def analyzeService(self, tenant_id, gitPath):
time.sleep(2)
_ = getI18n("controllers")
reJson = {
Expand Down
5 changes: 3 additions & 2 deletions backend/app/pkgs/knowledge/app_info_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from config import GRADE


class AppInfoInterface(ABC):
@abstractmethod
def getServiceLib(self, appID, serviceName):
Expand All @@ -16,5 +17,5 @@ def getServiceSpecification(self, appID, serviceName, LibName):
pass

@abstractmethod
def analyzeService(gitPath):
pass
def analyzeService(self, tenant_id, git_path):
pass

0 comments on commit 4e7dad0

Please sign in to comment.