Skip to content

Feat/risk analyse#1444

Open
JetDrag wants to merge 13 commits into
TencentBlueKing:mainfrom
JetDrag:feat/risk_analyse
Open

Feat/risk analyse#1444
JetDrag wants to merge 13 commits into
TencentBlueKing:mainfrom
JetDrag:feat/risk_analyse

Conversation

@JetDrag

@JetDrag JetDrag commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae0c94b7ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +199 to +201
def perform_request(self, validated_request_data):
report_id = validated_request_data["report_id"]
return get_object_or_404(AnalyseReport, report_id=report_id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict report reads to the report creator

list_analyse_report is explicitly scoped to created_by=get_request_username(), but this lookup fetches by report_id only. In environments where users have LIST_RISK, anyone who can obtain or guess a report ID can read another user's analysis content and prompt parameters through ID-based endpoints (retrieve/export/risk linkage), which breaks the per-user isolation implied by the list API.

Useful? React with 👍 / 👎.

Comment on lines +646 to +648
self.retry(exc=exc, countdown=60)
except MaxRetriesExceededError:
logger_celery.error("[GenerateAnalyseReport] Max retries reached for report_id=%s", report_id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Re-raise after max retries to preserve failure task state

When retries are exhausted, this branch only logs and then falls through, so the Celery task returns normally and is recorded as SUCCESS even though generation failed. That makes get_analyse_report_task_result report success for terminal failures, causing clients to stop polling and treat failed jobs as successful.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant