Skip to content

Conversation

@Naoki427
Copy link
Contributor

@Naoki427 Naoki427 commented Sep 30, 2025

このPRはプロトタイプ実装なのでMergeを目的とないためDraftとしています
方針の確認や認識のすり合わせ、改善点のフィードバックをいただければと思います。

動作の様子

2025-09-30.18.28.11.mov

内部仕様 -> https://dev.growi.org/68b96f7fcde220ddd8dad822
外部仕様 -> https://dev.growi.org/68b694cdabc93bd7957d265c

@Naoki427 Naoki427 changed the title job作成、export用のcron、それを起動させるcheck用cronの作成まで feat: audit log bulk export [prototype] Sep 30, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

全言語対応する後続タスクは作ってある?

import next from 'next';

import instanciateAuditLogBulkExportJobCronService from '~/features/audit-log-export/server/service/audit-log-bulk-export-job-cron';
import '~/features/audit-log-export/server/models/audit-log-bulk-export-job';
Copy link
Contributor

Choose a reason for hiding this comment

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

models の import は違和感がある
他のモデル群の取り扱いに倣ってほしい

'env:useOnlyEnvVars:app:isAuditLogExportEnabled': defineConfig<boolean>({
envVarName: 'AUDIT_LOG_EXPORT_ENABLED_USES_ONLY_ENV_VARS',
defaultValue: false,
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

audit log のエクスポートは管理者以外は使わない機能なので、並列数や cron 頻度をカスタマイズできるようにする必要はない (ヘビーウェイとな使い方は想定されてないという建て付けでよい)

そのため、これらの設定値はサービス層でハードコードしてよい

Copy link
Contributor

Choose a reason for hiding this comment

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

core package を改修するので、

/資料/開発ガイドライン/ADR - Architecture Decision Record/[CI] changesets によるパッケージリリース

を参考に .changeset ディレクトリに changeset ファイルを作ってほしい
(これがなぜ必要なのか、どう作ればいいのかわからなかったら口頭で武井に聞きに来て)


export const parseSnapshot = (snapshot: string): IAuditLogExportJobSnapshot => {
try {
return JSON.parse(snapshot);
Copy link
Contributor

Choose a reason for hiding this comment

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

type guard を導入し、IAuditLogExportJobSnapshot 型であることを保証して

Copy link
Contributor

Choose a reason for hiding this comment

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

コード内コメントはすべて英語で

Copy link
Contributor

Choose a reason for hiding this comment

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

サービス層に対してはインテグレーションテストが必要

Copy link
Contributor

Choose a reason for hiding this comment

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

このファイル魔改造されてる気がする

mousedown イベントハンドラや stopPropagation() が必要になるケースは稀なので、なにか変なことをやっていないか要チェック


if (res.status === 204) {
toastSuccess(t('audit_log_export.export_started'));
toastSuccess(t('audit_log_export.notification_message'));
Copy link
Contributor

Choose a reason for hiding this comment

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

toastr 二つもいらないかな

Copy link
Contributor

Choose a reason for hiding this comment

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

コンポーネントの実体が Modal なのに、名前が Button なのは名が体を表していない

また、このモーダルの仕様は固まっているのだろうか?
ユーザー・期間の選択部分の使い勝手をもうちょっと拡張する余地もありそう

そうするとこのコンポーネントに全て詰め込むと fat component になってしまうので、モジュールは分割すべきかもしれない
後続ストーリーで改善すべき

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.

3 participants