Repository navigation
Enable the access rights modification feature(#63818) - #1951
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnables search-index access-rights modification through a new instance configuration setting, enabled by default. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
🔍 Claude レビュー統合Claude の追加指摘 1 件 — 🔴 高 0 / 🟠 中 0 / 🟡 低 1
1. 🟡 [低] ファイル末尾に改行がない(Claude の追加指摘)
追加した docstring の行の末尾に改行がありません(差分に 修正案 最終行の末尾に改行を追加してください。 根拠確認: 差分と scripts/instance.cfg:889-893 を確認しました。 次にすること: 外部データに具体的な指摘はありません。CodeRabbit は自動レビューをスキップしており、その旨の通知があるだけです。 モデル sonnet / 2 回実行して和集合 / コスト $0.1498。同じ入力でも結果が揺れるため複数回まわし、一部のパスでしか挙がらなかったものには回数を添えています 他レビューを踏まえた自動レビューです。誤りが含まれることがあります。 |
API インベントリ差分(件数のみ)
ベースラインとの差分(生成されませんでした) 台帳との突き合わせ(生成されませんでした) ソース由来の経路検知(生成されませんでした) |
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="scripts/instance.cfg" line_range="892" />
<code_context>
WEKO_RECORDS_UI_S3_TRANSFER_MAX_CONCURRENCY = 10
"""Number of threads for multipart upload/download for S3 compatible service transfer. Default is 10."""
+WEKO_SEARCH_FIX_ACCESSRIGHTS = True
+"""Fix access rights for search indexes. True if fixing access rights."""
\ No newline at end of file
</code_context>
<issue_to_address>
**Harvest fails on timestamp dates**
When a file’s `dateValue` is present but is not exactly `YYYY-MM-DD`, such as a valid date-time value, `Record.updated` passes the file’s `dateValue` directly to `datetime.strptime(..., "%Y-%m-%d")`, raising `ValueError`; OAI-PMH response generation then fails when it reads `record.updated`.
Validate or safely parse `dateValue` before calling `strptime`, and skip values that cannot be parsed as dates.
</issue_to_address>
### Comment 2
<location path="scripts/instance.cfg" line_range="892" />
<code_context>
WEKO_RECORDS_UI_S3_TRANSFER_MAX_CONCURRENCY = 10
"""Number of threads for multipart upload/download for S3 compatible service transfer. Default is 10."""
+WEKO_SEARCH_FIX_ACCESSRIGHTS = True
+"""Fix access rights for search indexes. True if fixing access rights."""
\ No newline at end of file
</code_context>
<issue_to_address>
**Indexing adds per-record database work**
When a bulk indexing or reindexing job processes many records, indexing reads `record.updated` in `_prepare_record`; with this setting enabled, that property queries record metadata and resolves its item-type mapping for each record. Bulk indexing therefore adds per-record database and mapping work, slowing reindexing and other indexing workloads.
Avoid per-record metadata queries during indexing, for example by batching the required metadata or reusing data already loaded for the record.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 2 findings to address first, and enabling this setting can change access rights applied to search indexes; if it grants access to records that should be restricted, those records may be exposed before the issue is noticed. Reverting the setting stops future fixes but may not restore rights already changed in the indexes.
Blocking findings: scripts/instance.cfg:892, scripts/instance.cfg:892
| WEKO_RECORDS_UI_S3_TRANSFER_MAX_CONCURRENCY = 10 | ||
| """Number of threads for multipart upload/download for S3 compatible service transfer. Default is 10.""" | ||
|
|
||
| WEKO_SEARCH_FIX_ACCESSRIGHTS = True |
There was a problem hiding this comment.
🟡 Medium · Harvest fails on timestamp dates
When a file’s dateValue is present but is not exactly YYYY-MM-DD, such as a valid date-time value, Record.updated passes the file’s dateValue directly to datetime.strptime(..., "%Y-%m-%d"), raising ValueError; OAI-PMH response generation then fails when it reads record.updated.
Validate or safely parse dateValue before calling strptime, and skip values that cannot be parsed as dates.
Prompt for AI agents
In `scripts/instance.cfg` at line 892:
**Harvest fails on timestamp dates**
When a file’s `dateValue` is present but is not exactly `YYYY-MM-DD`, such as a valid date-time value, `Record.updated` passes the file’s `dateValue` directly to `datetime.strptime(..., "%Y-%m-%d")`, raising `ValueError`; OAI-PMH response generation then fails when it reads `record.updated`.
Validate or safely parse `dateValue` before calling `strptime`, and skip values that cannot be parsed as dates.| WEKO_RECORDS_UI_S3_TRANSFER_MAX_CONCURRENCY = 10 | ||
| """Number of threads for multipart upload/download for S3 compatible service transfer. Default is 10.""" | ||
|
|
||
| WEKO_SEARCH_FIX_ACCESSRIGHTS = True |
There was a problem hiding this comment.
🟡 Medium · Indexing adds per-record database work
When a bulk indexing or reindexing job processes many records, indexing reads record.updated in _prepare_record; with this setting enabled, that property queries record metadata and resolves its item-type mapping for each record. Bulk indexing therefore adds per-record database and mapping work, slowing reindexing and other indexing workloads.
Avoid per-record metadata queries during indexing, for example by batching the required metadata or reusing data already loaded for the record.
Prompt for AI agents
In `scripts/instance.cfg` at line 892:
**Indexing adds per-record database work**
When a bulk indexing or reindexing job processes many records, indexing reads `record.updated` in `_prepare_record`; with this setting enabled, that property queries record metadata and resolves its item-type mapping for each record. Bulk indexing therefore adds per-record database and mapping work, slowing reindexing and other indexing workloads.
Avoid per-record metadata queries during indexing, for example by batching the required metadata or reusing data already loaded for the record.
Summary by Sourcery
New Features: