Skip to content

OGPの事後対応#2910

Merged
ramdos0207 merged 4 commits intomasterfrom
opg-logcut
Mar 1, 2026
Merged

OGPの事後対応#2910
ramdos0207 merged 4 commits intomasterfrom
opg-logcut

Conversation

@ramdos0207
Copy link
Copy Markdown
Contributor

@ramdos0207 ramdos0207 commented Jan 17, 2026

  • 調査用のログを元に戻す
  • ネガティブキャッシュ対象が誤っていたので、修正

Summary by CodeRabbit

  • バグ修正

    • ParserのErrNotAllowedを含む特定エラーに対する一貫したキャッシング挙動を実装
    • 非パース・非ネットワークエラー時の短期メモリキャッシュ処理を最適化し、不要なキャッシュミスを抑制
  • その他の変更

    • 実行時の内部ログ出力を削除し、ログ関連の出力が減少

@ramdos0207 ramdos0207 requested a review from a team January 17, 2026 03:26
cp-20
cp-20 previously approved these changes Jan 17, 2026
Comment thread service/ogp/service_impl.go Outdated
@@ -126,7 +123,7 @@ func (s *ServiceImpl) getMetaOrCreate(_ context.Context, urlStr string) (res fet
if err != nil {
s.logger.Info("failed to fetch OGP meta", zap.String("url", urlStr), zap.Error(err))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

これは消さない感じですか? (どっちでもよいと思うけど)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

消し忘れなので消しました!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5482e9 and 66178e9.

📒 Files selected for processing (2)
  • service/ogp/parser/parser.go
  • service/ogp/service_impl.go
💤 Files with no reviewable changes (1)
  • service/ogp/parser/parser.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • service/ogp/service_impl.go

📝 Walkthrough

Walkthrough

OGP パーサーとサービス実装からログ出力を削除し、service_impl の getMetaOrCreate における ParseMetaForURL のエラーハンドリングに ErrNotAllowed を追加して負の OGP キャッシュを作成するように変更しました。制御フローと公開 API には変更はありません。

Changes

Cohort / File(s) Summary
ロギング除去
service/ogp/parser/parser.go, service/ogp/service_impl.go
zap ロガーの import と logger 変数、SetLogger 相当の接続を削除し、該当するログ出力(Info 等)を全て除去。
エラーハンドリング更新
service/ogp/service_impl.go
getMetaOrCreate 内の ParseMetaForURL エラー分岐に ErrNotAllowed を追加し、非5xx と同様に負の OGP キャッシュを作成する処理を追加。HTTP 生成/実行時のログ呼び出しも削除。
メタ情報
manifest_file, go.mod
変更行は小規模(-13 行)で、依存や公開 API 宣言に対する直接的な変更はなし。

推定コードレビュー労力

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive タイトル「OGPの事後対応」はPRの主な変更内容(ログ削除とネガティブキャッシュの修正)を具体的に説明しておらず、曖昧で一般的な表現となっています。 タイトルをより具体的に変更してください。例:「OGP: ログ削除とネガティブキャッシュ対象の修正」のように、主要な変更を明確に反映させることをお勧めします。
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch opg-logcut

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

cp-20
cp-20 previously approved these changes Mar 1, 2026
@ramdos0207 ramdos0207 merged commit 06b3a15 into master Mar 1, 2026
8 checks passed
@ramdos0207 ramdos0207 deleted the opg-logcut branch March 1, 2026 03:31
@github-project-automation github-project-automation Bot moved this from Inbox to Done in traQ Server Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants