Skip to content

Commit

Permalink
Merge pull request #101 from kuafuai/feat/ai_clone
Browse files Browse the repository at this point in the history
fix(run): ai analyze clone
  • Loading branch information
booboosui authored Sep 5, 2023
2 parents 2be2657 + 4e7dad0 commit b8665ae
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 b8665ae

Please sign in to comment.