Skip to content

Fix version equality when hashes collide - #50

Closed
sylvesterkaczmarek wants to merge 1 commit into
gchq:mainfrom
sylvesterkaczmarek:fix/version-equality
Closed

sylvesterkaczmarek wants to merge 1 commit into
gchq:mainfrom
sylvesterkaczmarek:fix/version-equality

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #49.

Compare concrete version types and flattened data instead of hashes. Distinct versions remain separate when hashes collide, and comparisons with unrelated objects return NotImplemented.

Adds regression coverage for collisions, unhashable objects, different version types, private attributes and custom flattening.

Validation:

  • TZ=UTC python -m unittest discover .: 269 tests passed, including Docker wrappers.
  • python -m mypy concoursetools: passed.
  • Pre-commit checks on both changed files: passed.

@sonarqubecloud

Copy link
Copy Markdown

@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Revalidated #50 with the full project checks: 269 unit tests pass under TZ=UTC, mypy reports no issues across 17 source files, the complete pre-commit stack passes, and a clean Sphinx HTML build succeeds. I also ran the new equality tests against unchanged upstream main; they reproduce the defect with four failures and two errors, including hash-collision equality and comparisons with unhashable unrelated objects.

The source tree is unchanged; I refreshed the commit as SSH-verified 4cddf5f. The PR is 0 behind and mergeable, and the existing Sonar quality gate is passing. The three fork-triggered Actions workflows are currently action_required pending maintainer approval. Ready for review.

@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Hi maintainers, following up on this PR as it hasn’t had a maintainer review yet. The implementation and local validation are documented above, while the hosted workflows are still waiting for maintainer approval. Could someone approve the workflows and review the PR when convenient? Happy to address any feedback.

@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Could someone review the hash-collision equality fix when convenient? The workflows still need maintainer approval.

@gchqdev227

Copy link
Copy Markdown
Member

Hi @sylvesterkaczmarek, thank you for your contribution.

Unfortunately this repository currently only accepts pull requests from organisation members or approved outside collaborators.

Thank you for bringing this bug to our attention.

@gchqdev227 gchqdev227 closed this Oct 23, 2026
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.

Version equality uses hashes instead of version data

2 participants