-
Notifications
You must be signed in to change notification settings - Fork 447
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
WIP | Dev: Initial bit integration #1029
Conversation
8988f98
to
f66749b
Compare
f66749b
to
fe7a5f3
Compare
config.py
Outdated
db_user_arg=os.getenv("DB_USERNAME"), | ||
db_password_arg=os.getenv("DB_PASSWORD"), | ||
db_endpoint_arg=os.getenv("DB_ENDPOINT"), | ||
db_name_arg=os.getenv("DB_NAME"), |
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.
Then why not use the DB_NAME variable instead of refetching them from the environment variables?
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'm not sure I'm following, 🤔.
This was a continuation from the above comment. On line 44 there is a variable called DB_NAME that has this value, then why not use that here instead of fetching the environment variable again.
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.
Fixing it now. Thanks for pointing that out 😊
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.
@epicadk , done. Can you please check again? Thanks
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.
Looks good 💯
@@ -16,6 +19,8 @@ def create_app(config_filename: str) -> Flask: | |||
|
|||
migrate = Migrate(app, db) | |||
|
|||
cors.init_app(app, resources={r"*": {"origins": "http:localhost:5000"}}) |
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.
Does BIT required access to all endpoints of the mentorship backend or can we give access to specific endpoints instead of all the endpoints?
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.
Yes, @epicadk. With users functionaliities and mentorship relation are managed by Mentorship System, BIT does need to have access to all Mentoship System api endpoints 😉.
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 think we should fetch the origins property based on the build type i.e. production, dev, local etc.?
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.
@epicadk, I think it's best to keep it as it for now, coz majority of contributors work on local machine atm. When we have remote servers for dev and production, we can revisit this origin property.
6bdac97
to
c0c7e58
Compare
@epicadk and @annabauza . I'm trying to set up postgresql inside github action but having trouble getting it right. Here's the modification to |
It won't let you create a database for some reason it is setup just fine. Is there anyone to set these from the python code? |
can you explain what you mean by setting up on the python code, @epicadk ? |
56a531f
to
ee9f17c
Compare
I've done that, @epicadk , but still facing error 😓 |
9c868ff
to
6ee8b47
Compare
Update @epicadk : I also noticed that when the PR #654 for initial MS migration to GitHub action was merged, the |
6ee8b47
to
8a78c49
Compare
@mtreacy002 could you avoid force pushing the changes? Kinda makes it harder to review. I had discussed this with @isabelcosta in the QA open session and I think the conclusion was that only while merging the maintainer needs to follow the commit guidelines given in the contributing guidelines. cc @isabelcosta . 😅 |
Ok, it makes sense actually 😁. It's just a habit from squashing commits, I guess (which I actually forgot to do on the latest push 🤣). Will just do normal push the next one 😉 |
Oh, on the codecov report, I check the anitab codecov.io, and it looks like it's passing, so I'm not sure why it says failed here 🤔 |
I don't have much knowledge of the subject 😅. I think @devkapilbansal can help out here. |
no worries..., @epicadk 😉. @devkapilbansal can you please share some input 🙏. |
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.
@mtreacy002 this PR consists of 5 commits but only one is relevant. All four are possibly because bit
branch is not updated with develop
branch.
So they should be removed.
Otherwise it is good for me.
replace db uri add Flask-Cors to requirements.txt linting with black formatter remove fetch env variables duplication change pull-push branch for github action to bit branch add postgresql test db add shell_context_processor Add -h postgres to psql command Place PGPASSWORD at the start of psql command Add env for running test * Update main.yml (Patch #21) Co-authored-by: Aditya Kurkure use non-macOS syntax for db_uri and add db envs Add postgres db url for github action Add test for db_test_uri remove hard coded test db uri Add psycopg2 Fix db type to postgres+psycopg2 add env to Generate coverage report move env to global runner focus pytest cov on tests folder Remove print command
3ab6260
to
928bbe5
Compare
Done, @devkapilbansal , I removed the other 4 commits. It was initially to update |
@epicadk , should I also integrate your push for docker change in here? Or that can be done after? |
It can be done after. I'll send open the pr on this repository. |
@devkapilbansal and @epicadk , can you please re-approve this PR now so it can be merged? That way the contributors can push directly to upstream |
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.
💯
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.
Looks good to me! @mtreacy002 🤗
@mtreacy002 this is working for your specific case right? Should we test this again? or pass that, because you were already using this for BIT? |
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.
LGTM 👍
P.S.:- I haven't tested it
@mtreacy002 @epicadk looking into the codecov reports, it fails because of changes in |
@isabelcosta , I believe since the GitHub action shows that the build is passing here we won't need to do the manual testing again. I also have been using this branch for my BIT for MS backend server and able to use existing features as normal.
@devkapilbansal, can you tell me where the Are you talking on the codecov.io settings of AnitaB? Perhaps this must be done from the admins side since they have the authority on that? |
@devkapilbansal , @epicadk , can you please let me know what else I need to do for this PR? If nothing else needed, we can label this issue |
We have code approval . Now it needs testing . Busy with college this week i'll test it tonight. |
Okay I just realized I'll need to have postgreSQL installed to test this which I haven't installed yet. |
Will close this issue as we're moving to full BIT-MS integration as discussed on BIT Open Session Sunday, 11th April. |
Description
Add initial integration for BIT backend to MS backend
Fixes #1028
Type of Change:
Code/Quality Assurance Only
How Has This Been Tested?
4. run tests by executing the command `python -m unittest discover tests` and see all test run successfully
Checklist:
Code/Quality Assurance Only
Additional note
For the giithub action to run test successfully, the
main.yml
need to be modified to include adding postgresql plugin and creating test database with the 2 schemas as it was done on Travis.yml on BIT backend repository.