-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add interview match activity #30
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
_DEFAULT_IMAGE_PATH: str = os.path.dirname(os.path.realpath(__file__)) + "/image.jpg" | ||
_COLOR_TEXT: str = "black" | ||
_COLOR_OUTLINE: str = "gray" | ||
_COLOR_BACKGROUND: str = "white" |
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.
All these vars may be better on a config file, so then we can make a config component to read it from instead of leaving them in the global scope, WDT?
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.
Unless we're doing something else with them I don't think is worth it, I would prefer to keep them here for now but if some moment we add another functionality where we use them again we can add them to the config file.
image_canvas.text((width + 55, 5), second_column, fill=_COLOR_TEXT, font=font) | ||
image_canvas.rectangle((0, 0, width + 50, height + 20), outline=_COLOR_OUTLINE) | ||
image_canvas.rectangle( | ||
(width + 50, 0, (width + width2) + 100, height + 20), |
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.
Can we create a utility function to calculate all this kind of magic stuff?
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.
Do you want 4 functions for each of these calculations? I think this is too specific for this use case and not worth creating a new utility unless you think we can generalize these calculations (imo is a waste of time and is better just to believe in the magic).
for attrib_name, attrib_value in list(globals().items()) | ||
if attrib_name.endswith("DIR") | ||
) | ||
ALL_DIRS = (attrib_value for attrib_name, attrib_value in list(globals().items()) if attrib_name.endswith("DIR")) |
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.
Why one liners? This makes my life harder to read this kind of code
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.
Because when I increased the line size it was updated automatically, not sure why is harder to read, 120 chars is more than enough imo unless you have a square monitor or use a letter size really big lol
2a6b798
to
e04a699
Compare
6bc29b6
to
e2e7e3a
Compare
9bb8589
to
031a3c4
Compare
031a3c4
to
d7ec29b
Compare
04e3130
to
d48c9a0
Compare
d7ec29b
to
8bdd7e6
Compare
d48c9a0
to
e508d6c
Compare
8bdd7e6
to
5b60556
Compare
# Description ### Context The interview match activity that happens every week is one of the remaining activities in the previous bot. To finish the deprecation process we're migrating the activity to the new bot. ### This diff * Add interview match command # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? `pre-commit` ran locally. Then tested with a test bot on a test server. # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works
# Description ### Context The interview match activity that happens every week is one of the remaining activities in the previous bot. To finish the deprecation process we're migrating the activity to the new bot. ### This diff * Add interview match command # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? `pre-commit` ran locally. Then tested with a test bot on a test server. # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works
* Add poetry skeleton * Add precommit file config * Add discord as dependency * Add tox configuration files and pass precommit * Change the author of the project * GitHub actions (#2) Create build using github action * Bot skeleton (#4) * Add dummy commit to test GH * Change name of precommit file * Add dummy skeleton to test build * Add Dockerfile * Add production github action * Add author to dockerfile * Fix docker file not getting image in FROM (#5) * Docker file fix v2 (#6) Fix problem with name in the registry * Add PR template file (#7) * Add PR template file * Change semantic of type of change * Add documentation as option * Rename az registries information (#8) * Rename az registries information * Rename pull request template * Rename PR template * React with reaction (#9) * Test PR template * Update version of discordpy dependency * Initial architecture of bot * Change tox and preconfig files * Test build * Add cog automatical registration * Add discord token as secure env var * Test no cog registration (#10) * Fix problem with relative path (#11) * Fix linter config (#14) * Unit test and documentation for blueprint bot (#12) * Add unit test for intent registration * Add unit testing for startup * Add test for startup cogs * Create unit testing for formatters * Update constants.py Co-Authored-By: Manuel CH <26100917+akotadi@users.noreply.github.com> * Test precommit * Create unit testing for formatters * Add Readme * Fix typo in readme * Ignore rule to avoid unneccesary comments * Delete unnecesary comments * Move fixture to conftest Co-authored-by: Manuel CH <26100917+akotadi@users.noreply.github.com> * Add initial base for timeline (#15) * Add initial base for timeline * Add unit testing for hiring formatter * Add cron testing * Add unit testing for cog * Change formatter access * Migrate cron to enum * Add annoucement channel as secret for deployment * Add start stop cron schedule * Missing root folder name was failing deploy to Azure (#16) * Debug state * Change to PR * Add analytics to container * Add cogs again * Remove path * Enable cogs again * Test * Rename Docker root file * Add module parameter to Dockerfile * Add complete path * Uncomment cogs * Comment hiring * Add logg * Test * Add complete path to cogs * Put release again on merge * Fix tox passing failing tests * Fix tox * Change tox * FIx tox * Tox should trigger * Skip update dependency * Delete install * Add pytest * Return pytest * Test should fail * Change test to build * Uncomment test cog * Revert push to prod to merge * Prepare deploy with different envs * Test dev deploy * Test secrets * Add env vars for deploy * Fix if * Split dev and prod * Comment test phase * Disable beta command (#18) * Comment beta command * Modify tests * Add logging decorator (#20) * Add logging decorator * Test log in az dev * Test in developent environment * Change policy (#23) * Change policy * Disable push in pull request * Fix lintern problems * Comment logger (#26) * Enable Logging (#24) * Add poetry skeleton * Add precommit file config * Add discord as dependency * Add tox configuration files and pass precommit * Change the author of the project * GitHub actions (#2) Create build using github action * Bot skeleton (#4) * Add dummy commit to test GH * Change name of precommit file * Add dummy skeleton to test build * Add Dockerfile * Add production github action * Add author to dockerfile * Fix docker file not getting image in FROM (#5) * Docker file fix v2 (#6) Fix problem with name in the registry * Add PR template file (#7) * Add PR template file * Change semantic of type of change * Add documentation as option * Rename az registries information (#8) * Rename az registries information * Rename pull request template * Rename PR template * React with reaction (#9) * Test PR template * Update version of discordpy dependency * Initial architecture of bot * Change tox and preconfig files * Test build * Add cog automatical registration * Add discord token as secure env var * Test no cog registration (#10) * Fix problem with relative path (#11) * Fix linter config (#14) * Unit test and documentation for blueprint bot (#12) * Add unit test for intent registration * Add unit testing for startup * Add test for startup cogs * Create unit testing for formatters * Update constants.py Co-Authored-By: Manuel CH <26100917+akotadi@users.noreply.github.com> * Test precommit * Create unit testing for formatters * Add Readme * Fix typo in readme * Ignore rule to avoid unneccesary comments * Delete unnecesary comments * Move fixture to conftest Co-authored-by: Manuel CH <26100917+akotadi@users.noreply.github.com> * Add initial base for timeline (#15) * Add initial base for timeline * Add unit testing for hiring formatter * Add cron testing * Add unit testing for cog * Change formatter access * Migrate cron to enum * Add annoucement channel as secret for deployment * Add start stop cron schedule * Missing root folder name was failing deploy to Azure (#16) * Debug state * Change to PR * Add analytics to container * Add cogs again * Remove path * Enable cogs again * Test * Rename Docker root file * Add module parameter to Dockerfile * Add complete path * Uncomment cogs * Comment hiring * Add logg * Test * Add complete path to cogs * Put release again on merge * Fix tox passing failing tests * Fix tox * Change tox * FIx tox * Tox should trigger * Skip update dependency * Delete install * Add pytest * Return pytest * Test should fail * Change test to build * Uncomment test cog * Revert push to prod to merge * Prepare deploy with different envs * Test dev deploy * Test secrets * Add env vars for deploy * Fix if * Split dev and prod * Comment test phase * Disable beta command (#18) * Comment beta command * Modify tests * Add logging decorator (#20) * Add logging decorator * Test log in az dev * Test in developent environment * Change policy (#23) * Change policy * Disable push in pull request * Fix lintern problems Co-authored-by: Manuel CH <26100917+akotadi@users.noreply.github.com> * Comment logger --------- Co-authored-by: Manuel CH <26100917+akotadi@users.noreply.github.com> * Akotadi/update common rules (#25) * Update pre-commit and fix issues * Fix issues * Remove eof * Update pre-commit and address comments * Add readme env variables * Linter * Add documentation for command * Disable logging (#32) * Add reaction check handler (#29) * Update pre-commit and fix issues * Fix issues * Remove eof * Update pre-commit and address comments * Add readme env variables * Linter * Add role when react to welcome message * Update readme * Add tests * Add test * Update description * Address comments * Update pytest version * Create settings file * Add comment * Add orm with guild checks (#34) * Remove local database (#47) # Description ### Context In order to improve the system we'll go back to using a database that can be accessed easily from different places. The previous Sqlite3 database will be used just as "cache" on the bot, while MongoDB will be set up to be used widely. ### This diff * Remove the previous local database and let it as local cache ### Incoming diffs * Add logger to track the interaction with the database * Configure the bot to work with MongoDB * Add handler to interact with the database * Add Guild Model again on MongoDB # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? Locally run to be sure that is still working fine # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works * Add logger (#48) # Description ### Context In order to improve the system we'll go back to using a database that can be accessed easily from different places. The previous Sqlite3 database will be used just as "cache" on the bot, while MongoDB will be set up to be used widely. ### This diff * Add and configure a basic logger on the bot ### Incoming diffs * Add logger to track the interaction with the database * Configure the bot to work with MongoDB * Add handler to interact with the database * Add Guild Model again on MongoDB # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? Locally tested to see that is working fine # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works * Add external database (MongoDB) (#49) # Description ### Context In order to improve the system we'll go back to using a database that can be accessed easily from different places. The previous Sqlite3 database will be used just as "cache" on the bot, while MongoDB will be set up to be used widely. ### This diff * Add logger to track the interaction with the database * Configure the bot to work with MongoDB * Configure docker to work with MongoDB if desired * Update documentation ### Incoming diffs * Add handler to interact with the database * Add Guild Model again on MongoDB # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] Documentation update # How Has This Been Tested? Locally tested to see that is working fine # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works * Add guild model (#50) # Description ### Context In order to improve the system we'll go back to using a database that can be accessed easily from different places. The previous Sqlite3 database will be used just as "cache" on the bot, while MongoDB will be set up to be used widely. ### This diff * Add handler to interact with the database * Add Guild Model again on MongoDB # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? Locally tested and added unit tests # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works * Improve testing (#52) # Description Including tests and clean/improve a bit the test files. # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] Documentation update # How Has This Been Tested? Running `pytest` # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works * Add a command template for reference (#46) * Add a command template for reference * Add interview match model (#56) # Description ### Context The interview match activity that happens every week is one of the remaining activities in the previous bot. To finish the deprecation process we're migrating the activity to the new bot. ### This diff * Add handler to interact with the database * Add InterviewMatch Model for MongoDB ### Incoming diffs * Create image utils * Add interview match command # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? Locally tested and added unit tests # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works * Create image utils (#57) # Description ### Context The interview match activity that happens every week is one of the remaining activities in the previous bot. To finish the deprecation process we're migrating the activity to the new bot. ### This diff * Create image utils ### Incoming diffs * Add interview match command # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? Locally tested and added unit tests # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works * Add interview match activity (#30) # Description ### Context The interview match activity that happens every week is one of the remaining activities in the previous bot. To finish the deprecation process we're migrating the activity to the new bot. ### This diff * Add interview match command # Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? `pre-commit` ran locally. Then tested with a test bot on a test server. # Checklist: - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works * Fix workflows (#58) # Description Fixing the prefix change made some PRs before. For the workflows, removing the option to deploy the bot to dev until is pushed to develop branch (before is tried to deploy every time that is a PR), and allowing to run the build workflow (run bot and test) for any pull request created. # Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? Locally tested # Checklist: - [ ] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works * Use logger in interview match (#59) # Description As title. # Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update # How Has This Been Tested? Locally tested # Checklist: - [ ] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works * Merge master to develop (#64) Develop (#33) * Add poetry skeleton * Add precommit file config * Add discord as dependency * Add tox configuration files and pass precommit * Change the author of the project * GitHub actions (#2) Create build using github action * Bot skeleton (#4) * Add dummy commit to test GH * Change name of precommit file * Add dummy skeleton to test build * Add Dockerfile * Add production github action * Add author to dockerfile * Fix docker file not getting image in FROM (#5) * Docker file fix v2 (#6) Fix problem with name in the registry * Add PR template file (#7) * Add PR template file * Change semantic of type of change * Add documentation as option * Rename az registries information (#8) * Rename az registries information * Rename pull request template * Rename PR template * React with reaction (#9) * Test PR template * Update version of discordpy dependency * Initial architecture of bot * Change tox and preconfig files * Test build * Add cog automatical registration * Add discord token as secure env var * Test no cog registration (#10) * Fix problem with relative path (#11) * Fix linter config (#14) * Unit test and documentation for blueprint bot (#12) * Add unit test for intent registration * Add unit testing for startup * Add test for startup cogs * Create unit testing for formatters * Update constants.py * Test precommit * Create unit testing for formatters * Add Readme * Fix typo in readme * Ignore rule to avoid unneccesary comments * Delete unnecesary comments * Move fixture to conftest * Add initial base for timeline (#15) * Add initial base for timeline * Add unit testing for hiring formatter * Add cron testing * Add unit testing for cog * Change formatter access * Migrate cron to enum * Add annoucement channel as secret for deployment * Add start stop cron schedule * Missing root folder name was failing deploy to Azure (#16) * Debug state * Change to PR * Add analytics to container * Add cogs again * Remove path * Enable cogs again * Test * Rename Docker root file * Add module parameter to Dockerfile * Add complete path * Uncomment cogs * Comment hiring * Add logg * Test * Add complete path to cogs * Put release again on merge * Fix tox passing failing tests * Fix tox * Change tox * FIx tox * Tox should trigger * Skip update dependency * Delete install * Add pytest * Return pytest * Test should fail * Change test to build * Uncomment test cog * Revert push to prod to merge * Prepare deploy with different envs * Test dev deploy * Test secrets * Add env vars for deploy * Fix if * Split dev and prod * Comment test phase * Disable beta command (#18) * Comment beta command * Modify tests * Add logging decorator (#20) * Add logging decorator * Test log in az dev * Test in developent environment * Change policy (#23) * Change policy * Disable push in pull request * Fix lintern problems * Comment logger (#26) * Enable Logging (#24) * Add poetry skeleton * Add precommit file config * Add discord as dependency * Add tox configuration files and pass precommit * Change the author of the project * GitHub actions (#2) Create build using github action * Bot skeleton (#4) * Add dummy commit to test GH * Change name of precommit file * Add dummy skeleton to test build * Add Dockerfile * Add production github action * Add author to dockerfile * Fix docker file not getting image in FROM (#5) * Docker file fix v2 (#6) Fix problem with name in the registry * Add PR template file (#7) * Add PR template file * Change semantic of type of change * Add documentation as option * Rename az registries information (#8) * Rename az registries information * Rename pull request template * Rename PR template * React with reaction (#9) * Test PR template * Update version of discordpy dependency * Initial architecture of bot * Change tox and preconfig files * Test build * Add cog automatical registration * Add discord token as secure env var * Test no cog registration (#10) * Fix problem with relative path (#11) * Fix linter config (#14) * Unit test and documentation for blueprint bot (#12) * Add unit test for intent registration * Add unit testing for startup * Add test for startup cogs * Create unit testing for formatters * Update constants.py * Test precommit * Create unit testing for formatters * Add Readme * Fix typo in readme * Ignore rule to avoid unneccesary comments * Delete unnecesary comments * Move fixture to conftest * Add initial base for timeline (#15) * Add initial base for timeline * Add unit testing for hiring formatter * Add cron testing * Add unit testing for cog * Change formatter access * Migrate cron to enum * Add annoucement channel as secret for deployment * Add start stop cron schedule * Missing root folder name was failing deploy to Azure (#16) * Debug state * Change to PR * Add analytics to container * Add cogs again * Remove path * Enable cogs again * Test * Rename Docker root file * Add module parameter to Dockerfile * Add complete path * Uncomment cogs * Comment hiring * Add logg * Test * Add complete path to cogs * Put release again on merge * Fix tox passing failing tests * Fix tox * Change tox * FIx tox * Tox should trigger * Skip update dependency * Delete install * Add pytest * Return pytest * Test should fail * Change test to build * Uncomment test cog * Revert push to prod to merge * Prepare deploy with different envs * Test dev deploy * Test secrets * Add env vars for deploy * Fix if * Split dev and prod * Comment test phase * Disable beta command (#18) * Comment beta command * Modify tests * Add logging decorator (#20) * Add logging decorator * Test log in az dev * Test in developent environment * Change policy (#23) * Change policy * Disable push in pull request * Fix lintern problems * Comment logger --------- * Akotadi/update common rules (#25) * Update pre-commit and fix issues * Fix issues * Remove eof * Update pre-commit and address comments * Add readme env variables * Linter * Add documentation for command * Disable logging (#32) --------- Co-authored-by: Roberto <reyesfragosoroberto@gmail.com> * Update new_user_joins.py * Fix env variables issues (#66) * Fix env variables issues (#67) --------- Co-authored-by: goberinfinity <reyesfragosoroberto@gmail.com>
Description
Context
The interview match activity that happens every week is one of the remaining activities in the previous bot. To finish the deprecation process we're migrating the activity to the new bot.
This diff
Type of change
How Has This Been Tested?
pre-commit
ran locally. Then tested with a test bot on a test server.Checklist: