Skip to content

Seed DynamoDB Local#197

Merged
jonhoo merged 10 commits into
jonhoo:mainfrom
rustworthy:seed-dynamodb-local
Jan 5, 2025
Merged

Seed DynamoDB Local#197
jonhoo merged 10 commits into
jonhoo:mainfrom
rustworthy:seed-dynamodb-local

Conversation

@rustworthy
Copy link
Copy Markdown
Contributor

Addresses thread

Comment thread server/src/main.rs Outdated
@rustworthy rustworthy changed the title [WIP] See DynamoDB Local [WIP] Seed DynamoDB Local Dec 28, 2024
Comment thread CONTRIBUTING.md
@rustworthy rustworthy changed the title [WIP] Seed DynamoDB Local Seed DynamoDB Local Dec 28, 2024
Comment thread server/src/main.rs Outdated
Comment thread server/src/main.rs Outdated
@rustworthy rustworthy requested a review from jonhoo December 29, 2024 20:22
Comment thread server/src/main.rs Outdated
Comment thread server/src/main.rs
Co-authored-by: Jon Gjengset <jon@thesquareplanet.com>
@rustworthy rustworthy requested a review from jonhoo December 30, 2024 12:44
Comment thread server/src/main.rs Outdated
@rustworthy rustworthy requested a review from jonhoo January 5, 2025 11:28
Copy link
Copy Markdown
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

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

Nice, yeah, this is way better, thank you!

Left one nit, but will merge and we can fix that in a follow-up.

Comment thread server/src/main.rs
.expect("id is in projection")
.as_s()
.expect("id is of type string");
ulid::Ulid::from_string(id).ok()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Shouldn't we just .expect here too? This is for testing after all, and all the IDs should be valid ULIDs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When testing, one can add some questions to dynamodb directly via the admin web UI. The ids of those manually added questions can be invalid ULIDs and so we are just skipping those questions, i.e. not going to vote for them in the vote-over-time task. That was the idea. We could add a comment on this, wdyt?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think we're probably better served by asserting here — the convenience of being able to use non-ULIDs is outweighed (I think) by the risk of us encoding the assuming of ULIDs elsewhere in the system that may break in more subtle ways

@jonhoo jonhoo merged commit 1c1f77e into jonhoo:main Jan 5, 2025
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