Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: Move int to UUID #286

Merged
merged 4 commits into from
Jun 1, 2024
Merged

Conversation

kairoaraujo
Copy link
Collaborator

@kairoaraujo kairoaraujo commented May 27, 2024

What this PR does / why we need it

Move the table ID from incremental int to UUID to bring uniqueness.

UUIDs are globally unique. In other words, we can identify each record in the database with an ID that is unique across tables, databases, and systems. The latter is especially important in distributed systems where we may add or remove nodes dynamically, and coordination between them can be challenging. The collision is only theoretically possible.

Furthermore, they provide additional security since the next value is hard to predict. Therefore, it makes it almost impossible for a malicious user to guess the ID. On the other hand, such a user can easily guess the next value of sequential IDs.

Acceptance Criteria Met

  • Docs changes if needed
  • Testing changes if needed
  • All workflow checks passing (automatically enforced)
  • All review conversations resolved (automatically enforced)
  • DCO Sign-off

Special notes for your reviewer:

It breaks compatibility as implementing migrations for it can be complex and generate a mess.
It starts over the migrations using a new database initialization.

The last commit include the automatic generated files make db-migrations

@kairoaraujo kairoaraujo force-pushed the move_int_to_uuid branch 2 times, most recently from da55e14 to a14502b Compare May 27, 2024 08:53
Copy link

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 3.70066% with 1171 lines in your changes are missing coverage. Please review.

Project coverage is 1.61%. Comparing base (a035c62) to head (a14502b).
Report is 89 commits behind head on main.

Current head a14502b differs from pull request most recent head 040dd65

Please upload reports for the commit 040dd65 to get more accurate results.

Files Patch % Lines
ent/mutation.go 0.00% 135 Missing ⚠️
ent/gql_node.go 0.00% 71 Missing ⚠️
ent/gql_pagination.go 0.00% 60 Missing ⚠️
ent/gql_collection.go 0.00% 54 Missing ⚠️
ent/statement_update.go 0.00% 46 Missing ⚠️
ent/client.go 0.00% 40 Missing ⚠️
ent/dsse_update.go 0.00% 38 Missing ⚠️
ent/statement_create.go 0.00% 34 Missing ⚠️
ent/dsse_create.go 0.00% 31 Missing ⚠️
ent/signature_create.go 0.00% 28 Missing ⚠️
... and 58 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #286       +/-   ##
==========================================
- Coverage   82.40%   1.61%   -80.79%     
==========================================
  Files          10     118      +108     
  Lines         358   28817    +28459     
==========================================
+ Hits          295     465      +170     
- Misses         43   28295    +28252     
- Partials       20      57       +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Auto generated by migrations

- `./generated.go`
- `./ent.resolvers.go`

Signed-off-by: Kairo Araujo <[email protected]>
@jkjell jkjell force-pushed the move_int_to_uuid branch from a14502b to 040dd65 Compare June 1, 2024 04:35
@jkjell jkjell merged commit 0a41b48 into in-toto:main Jun 1, 2024
11 checks passed
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.

2 participants