-
Notifications
You must be signed in to change notification settings - Fork 144
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
NEOS-1593: Business name transformer #2892
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2892 +/- ##
==========================================
+ Coverage 38.69% 38.71% +0.01%
==========================================
Files 315 317 +2
Lines 36140 36273 +133
==========================================
+ Hits 13985 14042 +57
- Misses 20462 20531 +69
- Partials 1693 1700 +7 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! That is a big add 3 million additions.
Did you find this to affect build times at all?
@@ -68,7 +68,7 @@ func main() { | |||
|
|||
for _, line := range lines { | |||
trimmedLine := strings.TrimSpace(line) | |||
if len(trimmedLine) == 0 || strings.ContainsAny(trimmedLine, " -_") { | |||
if len(trimmedLine) == 0 || strings.ContainsAny(trimmedLine, "-_") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'm guessing there was a reason why I originally wrote this to exclude first/last names with spaces. But who knows if that is still relevant. Part of me wants to expose any bugs removing the space here would cause...
This feature adds in support to randomly generate a realistic looking business name with a new transformer called Generate Business Name. We pre-generate like 1.6M business names as part of the
go generate
script and store them in the/transformers/data-sets/datasets
directory.If we're concerned about that .txt file being too big, we can reduce it but I took the approach that business names are more likely to be required to be unique compared to first or last names, so we should have more than less. But if we want to knock it down to like 100k like the others, happy to update it.
Demo
https://www.loom.com/share/b7c01ba19b8c433e9bfca8f7b667ab57
Edit:
Did some benchmarking - here's what I'm seeing.
I checked the build time for each generator in the
generators.go
file as well as mem + cpu usage.Overall, it doesn't seem to spike memory or cpu, but does take about 4 seconds to run the businessName generator.
@nickzelei