-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
add the connection configuration directly into knex.js
…ished Now directly calling the knex connection to the db models instead
package.json start will now compile ts and js files into out folder and then run index from there add 'out' directory to gitignore updated tsconfig to allow for implicit any types for the time being
Added a tsc build script in package.json to individually run build command
removed the .js extension on the logger file
…DayValues anyways
It will make it easier and standard for calling a date from the function then to constantly call 'new Date(**)' everywhere
Changed config-template.js to ts
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.
CR 🗡️
QA 🎬 |
So @deltuh-vee and I ran into a very weird bug when running the tests. It seems by using Veryable/__tests__/day.spec.ts Lines 71 to 74 in 8f39632
Anyone have an idea on why using |
dev_block ☁️ going to change the test variables to |
un_dev_block 🌻 replaced |
@ardelato Is it possible that it's not correctly connecting to the database? |
@andyg0808 actually we just debugged, it is an issue with Jest trying to run tests in parallel and so by using This was an issue on @deltuh-vee 's computer because it is an older macbook pro |
un_dev_block ☁️ |
QA 🎬 |
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.
CR 🗡️
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.
Partial review; feel free to use your judgment on the suggestions or to delay them to happen in some other PR.
I'll try and finish the review Monday or so.
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.
Rest of CR.
db/db_pull.ts
Outdated
let dev_block = '' | ||
signatures.tags.forEach(tag => { | ||
let regex = new RegExp(tag.regex + signatures.emoji, 'i') | ||
if (regex.test(comment)) { | ||
tags['dev_block'] = tag.state | ||
dev_block = tag.state.toString() | ||
} | ||
}) | ||
return dev_block |
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.
I think you might be able to take advantage of find
to simplify this code:
let dev_block = '' | |
signatures.tags.forEach(tag => { | |
let regex = new RegExp(tag.regex + signatures.emoji, 'i') | |
if (regex.test(comment)) { | |
tags['dev_block'] = tag.state | |
dev_block = tag.state.toString() | |
} | |
}) | |
return dev_block | |
const tag = signatures.tags.find(tag => (new RegExp(tag.regex + signatures.emoji, 'i')).test(comment)); | |
return tag?.state.toString() |
Note that this will now return the first element of signatures.tags
that matches, rather than the last. If I'm correct in believing that signatures.tags
comes from the configuration, it's probably a bug to be order-sensitive in the first place, so if this change causes problems from that standpoint, we might want to think about changing how we're using the config.
CR 🐟 through 309e32f |
un_deploy_block 👍 addressed all suggestions |
Description
This pull address #4 .
Changes
Converts all
*.js
to*.ts
.Ensures mostly complete test coverage for main files now.
lcov-report.zip
Adds typescript configuration and package.json scripts to setup and run the application.
CR Notes
The only major logic changes are:
db_pull
instead to make use of referencing object's properties instead of using a temporary object and replacing all values in the pull object with it.dev blocked
or notOther than that, it may look like a lot of changes, but if you go commit by commit, it should show that that the basic logic is still there, we are now just adding type validation.
QA
Validate you can run the application and run the tests locally on your machine.
Requirements
node 14
installed (usenvm
to help manage your node versions)mysql
server runningqa_pulls
andqa_metrics
table.schema.sql
file in thedb
folder to create the tables..env.dev
& a.env.test
file in the root directory (ping me for a copy)config.ts
in yourconfig
directory (ping me for a copy)Steps
npm install
npm run lint:types
jest
ran all the tests in__test__/
(day.spec.ts
,pull.spec.ts
) and all tests were passingnpm start
qa_pulls
andqa_metrics
has been populated with allOPEN
pullsCurrent Pulls Today
readout shows the same number listed in the QA column of Pulldasher (Note: there might be a pull that is labeledCryogenic Storage
so it does not show up in Pulldasher and it has not been excluding from the parsing logic yet)Closes #4