Skip to content

use md5 hash for controlled list item value, re #13086 - #13087

Merged
apeters merged 3 commits into
dev/8.2.xfrom
anp/13086_md5hash_controlled_list_item_value
Oct 30, 2026
Merged

apeters merged 3 commits into
dev/8.2.xfrom
anp/13086_md5hash_controlled_list_item_value

Conversation

@apeters

@apeters apeters commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

Long strings used as controlled list item values raises an OperationError because of limitations with b-tree indexing.

Issues Solved

Closes #13086

Checklist

  • I targeted one of these branches:
    • dev/8.2.x (under development): features, bugfixes not covered below
    • dev/8.1.x (main support): regressions, crashing bugs, security issues, major bugs in new features
    • dev/7.6.x (extended support): major security issues, data loss issues
  • I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Copilot AI 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.

🟢 Approval recommended

No active review issues remain for the hash-based uniqueness change supporting long controlled-list values.

No open issues 🎉

What changed in this PR

This PR addresses #13086 by hashing controlled-list values in the uniqueness index, allowing long text to be stored without exceeding PostgreSQL’s B-tree index size limit.

Changes:

  • Replace the indexed value with its MD5 hash while retaining the full stored text.
  • Add a migration to update the existing uniqueness constraint.
  • Add regression tests for long values, duplicate rejection, and distinct item/type/language combinations, plus a release note.
File Description
tests/​extensions/​controlled_lists/​test_models.py Test long-value storage and uniqueness enforcement.
releases/​8.2.0.md Document the long controlled-list value fix.
arches/​extensions/​controlled_lists/​models.py Use MD5 in the value uniqueness constraint.
arches/​extensions/​controlled_lists/​migrations/​0013_hash_listitemvalue_unique_constraint.py Replace the database constraint with the hash-based index.

Review effort: Balanced

@apeters
apeters requested a review from chiatt October 30, 2026 00:34

@chiatt chiatt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me if you'll entertain my pickiness regarding the changelog entry.

Comment thread releases/8.2.0.md Resolved
Co-authored-by: Cyrus Hiatt <chiatt@fargeo.com>
@apeters
apeters merged commit 2bcee06 into dev/8.2.x Oct 30, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this to ✅ Done in pipeline Oct 30, 2026
@apeters
apeters deleted the anp/13086_md5hash_controlled_list_item_value branch October 30, 2026 17:17
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.

Controlled list value can't hold large strings

3 participants