Skip to content

Commit 75a4bc1

Browse files
committed
fix audit iter
1 parent 29c6c2d commit 75a4bc1

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/seclab_taskflows/mcp_servers/repo_context.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,19 @@ def get_apps(self, repo):
220220

221221
def get_app_issues(self, repo, component_id):
222222
with Session(self.engine) as session:
223-
issues = session.query(Application, ApplicationIssue).filter(Application.id == component_id
224-
).filter(Application.id == ApplicationIssue.component_id).all()
223+
issues = session.query(Application, ApplicationIssue).filter(Application.repo == repo
224+
)
225+
if component_id is not None:
226+
issues = issues.filter(Application.id == component_id)
227+
issues = issues.filter(Application.id == ApplicationIssue.component_id).all()
225228
return [{
226229
'component_id': app.id,
227230
'location' : app.location,
228231
'repo' : app.repo,
229232
'component_notes' : app.notes,
230233
'issue_type' : issue.issue_type,
231-
'issue_notes': issue.notes
234+
'issue_notes': issue.notes,
235+
'issue_id' : issue.id
232236
} for app, issue in issues]
233237

234238
def get_app_audit_results(self, repo, component_id, has_non_security_error, has_vulnerability):
@@ -561,6 +565,16 @@ def get_component_issues(owner: str = Field(description="The owner of the GitHub
561565
repo = process_repo(owner, repo)
562566
return json.dumps(backend.get_app_issues(repo, component_id))
563567

568+
@mcp.tool()
569+
def get_component_issues_for_repo(owner: str = Field(description="The owner of the GitHub repository"),
570+
repo: str = Field(description="The name of the GitHub repository")):
571+
"""
572+
Get issues for the component.
573+
"""
574+
repo = process_repo(owner, repo)
575+
return json.dumps(backend.get_app_issues(repo, None))
576+
577+
564578
@mcp.tool()
565579
def get_component_results(owner: str = Field(description="The owner of the GitHub repository"),
566580
repo: str = Field(description="The name of the GitHub repository"),

0 commit comments

Comments
 (0)