8000 refresh package_version in upload sbom by dejima-shikou · Pull Request #818 · nttcom/threatconnectome · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refresh package_version in upload sbom #818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2025
Merged

Conversation

dejima-shikou
Copy link
Collaborator
@dejima-shikou dejima-shikou commented Jul 8, 2025

PR の目的

  • 同じSBOM「misp-cycclondx.json」をTCに2回アップロードした際、1回目アップロードした時のチケット数が、アップロード直後よい2回目アップロード後の方が多い問題を修正する
    • [原因]
      • dependencyをDBに格納後にTicketを生成する際、ORMマッピングによりPackageVersionからdependencyを取得しようとしたが、取得できなかった。
      • 同じSBOMを2回投入した際、1回目と同じPackageVersionに紐づくTicketを処理する際に、1回目のdependencyを処理していたため、1回目のTicketが正常に生成されていた
    • [対策]
      問題となる処理の前に、PackageVersionに対してdb.refresh()を実行することで、PackageVersionオブジェクトに追加したdependencyを読み込んでおく
  • 本修正により、SBOM投入テストがエラーになったため、修正する。
    • SBOM投入時に生成されるチケット数の期待値を1としていたが、実際は2だった。本PRのバグにより不正に1件のチケットが生成できていなかった。

< 8000 div class="d-flex flex-auto">
@dejima-shikou dejima-shikou marked this pull request as ready for review July 8, 2025 07:49
Copy link
Collaborator
@mshim03 mshim03 left a comment

Choose a reason for hiding this comment

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

LGTM

@mshim03 mshim03 merged commit 00f6d05 into main Jul 8, 2025
5 checks passed
@mshim03 mshim03 deleted the bugfix/refresh-packageVersion branch July 8, 2025 10:05
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.

2 participants
0