-
Notifications
You must be signed in to change notification settings - Fork 2
reservations display bug fix #619
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JobDoesburg
approved these changes
Mar 1, 2023
Jer111
pushed a commit
to GiPHouse/giphouse-website-spring2023
that referenced
this pull request
Mar 3, 2023
* AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com>
BrentHag
added a commit
to GiPHouse/giphouse-website-spring2023
that referenced
this pull request
Mar 3, 2023
* AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com>
henkberendsen
added a commit
to GiPHouse/giphouse-website-spring2023
that referenced
this pull request
Apr 22, 2023
* AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) * Db sync (#16) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids --------- Co-authored-by: Henk <hb130502@outlook.com> * Db sync (#25) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids * Changed email data dict to struct * added test for TypeError exception for eq operator * resolved linting errors * changed comment to correct datatype * dramatically improved test class name --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> * Added function to generate which users have to be invited after the sync button is pressed (#23) * Added 'generate_aws_sync_list' function and tests * solved black errors * changed generate_aws_sync_list to use SyncData structure * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * 12 moto helper (#36) * merged with development and added create_c_i_OU * Added some tests for create_c_i_OU * Added some tests for create_c_i_ou * Linting * Changed the mock_api call back to orginal * Added create_team_ou with tests * Fix problems with moto testing * Worked on tests and added apitalkerclass * Make test asserts more meaningful * black * Added tests for create_ou's without parts * Added one test that gets all children under OU * Fix linting * Changed return of response create team ou did not save the name of the team OU * Fix test create team OU * Resolved linting issues * Fix flake8 * remove create_team_ou --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Add checks for edge cases between AWS and Giphouse databases (#37) * added double user check (partly) * added some checks and made two new fancy classes for the storage of AWS tree dictionaries * added tests * added equals for AWSTree and Iteration objects * test stupid error * does it work now? * resolved merge conflicts with rebasing on development * cleaned up code based on pull request comments * Extraction of AWS data * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Removed classes for merge * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Linting fix * git fixes * Black fix * pydocstyle fix * Black fix again * removed flake8 'fix' * Final flake8 fix * Final final flake8 fix * spelling error fix --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> * AWS synchronization pipeline (and integration bug fixes) (#42) * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * Add function template * Fix 'a/an' grammar mistake * Add pipeline preconditions * Add pipeline preconditions tests * Add checks for required API actions * Add test cases for checking required API actions * Added implementation of creating and attaching policy in the pipeline * Remove double API actions * Added implementation of creating and moving accounts in the pipeline. This should still be divided into smaller functions. * Increase code readability * Stop checking account request status after known failure * Fixed small typos and added account details to a debug message about account creation failure * Added tests for pipeline policy and fixed typos in debug messages. * Split creating and moving accounts into multiple functions, and handle exceptions * added update_course_itation_ou with tests * updated pipeline_update_current_course_iteration * Add test cases for creating and moving member accounts * Bug fixes for pipeline dependencies that arose from integration sprint 2 tasks * Revised pipeline policy function and corresponding tests so that it should not fail after first pipeline run * Change duplicate policy attachment to soft-fail; replace organization ID with root ID --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> --------- Co-authored-by: Henk Berendsen <61596108+hb140502@users.noreply.github.com> Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>
flam123
added a commit
to GiPHouse/giphouse-website-spring2023
that referenced
this pull request
May 9, 2023
* Updated deliverable sprint 1 (#22) * AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> * Sprint 2 deliverable (#43) * AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) * Db sync (#16) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids --------- Co-authored-by: Henk <hb130502@outlook.com> * Db sync (#25) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids * Changed email data dict to struct * added test for TypeError exception for eq operator * resolved linting errors * changed comment to correct datatype * dramatically improved test class name --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> * Added function to generate which users have to be invited after the sync button is pressed (#23) * Added 'generate_aws_sync_list' function and tests * solved black errors * changed generate_aws_sync_list to use SyncData structure * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * 12 moto helper (#36) * merged with development and added create_c_i_OU * Added some tests for create_c_i_OU * Added some tests for create_c_i_ou * Linting * Changed the mock_api call back to orginal * Added create_team_ou with tests * Fix problems with moto testing * Worked on tests and added apitalkerclass * Make test asserts more meaningful * black * Added tests for create_ou's without parts * Added one test that gets all children under OU * Fix linting * Changed return of response create team ou did not save the name of the team OU * Fix test create team OU * Resolved linting issues * Fix flake8 * remove create_team_ou --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Add checks for edge cases between AWS and Giphouse databases (#37) * added double user check (partly) * added some checks and made two new fancy classes for the storage of AWS tree dictionaries * added tests * added equals for AWSTree and Iteration objects * test stupid error * does it work now? * resolved merge conflicts with rebasing on development * cleaned up code based on pull request comments * Extraction of AWS data * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Removed classes for merge * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Linting fix * git fixes * Black fix * pydocstyle fix * Black fix again * removed flake8 'fix' * Final flake8 fix * Final final flake8 fix * spelling error fix --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> * AWS synchronization pipeline (and integration bug fixes) (#42) * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * Add function template * Fix 'a/an' grammar mistake * Add pipeline preconditions * Add pipeline preconditions tests * Add checks for required API actions * Add test cases for checking required API actions * Added implementation of creating and attaching policy in the pipeline * Remove double API actions * Added implementation of creating and moving accounts in the pipeline. This should still be divided into smaller functions. * Increase code readability * Stop checking account request status after known failure * Fixed small typos and added account details to a debug message about account creation failure * Added tests for pipeline policy and fixed typos in debug messages. * Split creating and moving accounts into multiple functions, and handle exceptions * added update_course_itation_ou with tests * updated pipeline_update_current_course_iteration * Add test cases for creating and moving member accounts * Bug fixes for pipeline dependencies that arose from integration sprint 2 tasks * Revised pipeline policy function and corresponding tests so that it should not fail after first pipeline run * Change duplicate policy attachment to soft-fail; replace organization ID with root ID --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> --------- Co-authored-by: Henk Berendsen <61596108+hb140502@users.noreply.github.com> Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Added class for API calls and preliminary version of the tests * Added final test for API talker class * Changed folder structure to organize AWS-related files * Fixed tests which failed due to not being mocked correctly * Removed aws files which have been moved to different folders * Fixed bug which caused mocking to not work * Added version of the api talker test which attempts to fix the error in test_simulate_principal_policy * Fix mocking issue * Added three remaining API calls and a test for one of them (list_tags_for_resource). Also added a function in the tests which creates an organization and returns its ID to clean up the other tests a bit. * Added function and test for list_roots API call * Fixed review comments * Fixed formatting issue in test_awssync.py and resolved review comment in test_awsapitalker.py --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Filip Łysak <92109241+FilipLysak001@users.noreply.github.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>
1058274
added a commit
to GiPHouse/giphouse-website-spring2023
that referenced
this pull request
Jun 9, 2023
* Updated deliverable sprint 1 (#22) * AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> * Sprint 2 deliverable (#43) * AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) * Db sync (#16) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids --------- Co-authored-by: Henk <hb130502@outlook.com> * Db sync (#25) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids * Changed email data dict to struct * added test for TypeError exception for eq operator * resolved linting errors * changed comment to correct datatype * dramatically improved test class name --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> * Added function to generate which users have to be invited after the sync button is pressed (#23) * Added 'generate_aws_sync_list' function and tests * solved black errors * changed generate_aws_sync_list to use SyncData structure * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * 12 moto helper (#36) * merged with development and added create_c_i_OU * Added some tests for create_c_i_OU * Added some tests for create_c_i_ou * Linting * Changed the mock_api call back to orginal * Added create_team_ou with tests * Fix problems with moto testing * Worked on tests and added apitalkerclass * Make test asserts more meaningful * black * Added tests for create_ou's without parts * Added one test that gets all children under OU * Fix linting * Changed return of response create team ou did not save the name of the team OU * Fix test create team OU * Resolved linting issues * Fix flake8 * remove create_team_ou --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Add checks for edge cases between AWS and Giphouse databases (#37) * added double user check (partly) * added some checks and made two new fancy classes for the storage of AWS tree dictionaries * added tests * added equals for AWSTree and Iteration objects * test stupid error * does it work now? * resolved merge conflicts with rebasing on development * cleaned up code based on pull request comments * Extraction of AWS data * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Removed classes for merge * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Linting fix * git fixes * Black fix * pydocstyle fix * Black fix again * removed flake8 'fix' * Final flake8 fix * Final final flake8 fix * spelling error fix --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> * AWS synchronization pipeline (and integration bug fixes) (#42) * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * Add function template * Fix 'a/an' grammar mistake * Add pipeline preconditions * Add pipeline preconditions tests * Add checks for required API actions * Add test cases for checking required API actions * Added implementation of creating and attaching policy in the pipeline * Remove double API actions * Added implementation of creating and moving accounts in the pipeline. This should still be divided into smaller functions. * Increase code readability * Stop checking account request status after known failure * Fixed small typos and added account details to a debug message about account creation failure * Added tests for pipeline policy and fixed typos in debug messages. * Split creating and moving accounts into multiple functions, and handle exceptions * added update_course_itation_ou with tests * updated pipeline_update_current_course_iteration * Add test cases for creating and moving member accounts * Bug fixes for pipeline dependencies that arose from integration sprint 2 tasks * Revised pipeline policy function and corresponding tests so that it should not fail after first pipeline run * Change duplicate policy attachment to soft-fail; replace organization ID with root ID --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> --------- Co-authored-by: Henk Berendsen <61596108+hb140502@users.noreply.github.com> Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Added class for API calls and preliminary version of the tests * Added final test for API talker class * Changed folder structure to organize AWS-related files * Fixed tests which failed due to not being mocked correctly * Removed aws files which have been moved to different folders * Fixed bug which caused mocking to not work * Added version of the api talker test which attempts to fix the error in test_simulate_principal_policy * Fix mocking issue * Added three remaining API calls and a test for one of them (list_tags_for_resource). Also added a function in the tests which creates an organization and returns its ID to clean up the other tests a bit. * Added function and test for list_roots API call * Fixed review comments * Fixed formatting issue in test_awssync.py and resolved review comment in test_awsapitalker.py --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Filip Łysak <92109241+FilipLysak001@users.noreply.github.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>
1058274
added a commit
to GiPHouse/giphouse-website-spring2023
that referenced
this pull request
Jun 9, 2023
* AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) * Db sync (#16) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids --------- Co-authored-by: Henk <hb130502@outlook.com> * Db sync (#25) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids * Changed email data dict to struct * added test for TypeError exception for eq operator * resolved linting errors * changed comment to correct datatype * dramatically improved test class name --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> * Added function to generate which users have to be invited after the sync button is pressed (#23) * Added 'generate_aws_sync_list' function and tests * solved black errors * changed generate_aws_sync_list to use SyncData structure * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * 12 moto helper (#36) * merged with development and added create_c_i_OU * Added some tests for create_c_i_OU * Added some tests for create_c_i_ou * Linting * Changed the mock_api call back to orginal * Added create_team_ou with tests * Fix problems with moto testing * Worked on tests and added apitalkerclass * Make test asserts more meaningful * black * Added tests for create_ou's without parts * Added one test that gets all children under OU * Fix linting * Changed return of response create team ou did not save the name of the team OU * Fix test create team OU * Resolved linting issues * Fix flake8 * remove create_team_ou --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Add checks for edge cases between AWS and Giphouse databases (#37) * added double user check (partly) * added some checks and made two new fancy classes for the storage of AWS tree dictionaries * added tests * added equals for AWSTree and Iteration objects * test stupid error * does it work now? * resolved merge conflicts with rebasing on development * cleaned up code based on pull request comments * Extraction of AWS data * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Removed classes for merge * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Linting fix * git fixes * Black fix * pydocstyle fix * Black fix again * removed flake8 'fix' * Final flake8 fix * Final final flake8 fix * spelling error fix --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> * AWS synchronization pipeline (and integration bug fixes) (#42) * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * Add function template * Fix 'a/an' grammar mistake * Add pipeline preconditions * Add pipeline preconditions tests * Add checks for required API actions * Add test cases for checking required API actions * Added implementation of creating and attaching policy in the pipeline * Remove double API actions * Added implementation of creating and moving accounts in the pipeline. This should still be divided into smaller functions. * Increase code readability * Stop checking account request status after known failure * Fixed small typos and added account details to a debug message about account creation failure * Added tests for pipeline policy and fixed typos in debug messages. * Split creating and moving accounts into multiple functions, and handle exceptions * added update_course_itation_ou with tests * updated pipeline_update_current_course_iteration * Add test cases for creating and moving member accounts * Bug fixes for pipeline dependencies that arose from integration sprint 2 tasks * Revised pipeline policy function and corresponding tests so that it should not fail after first pipeline run * Change duplicate policy attachment to soft-fail; replace organization ID with root ID --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> * Dedicated module for AWS helper data structures (#47) * Separate AWS helper data structures into a dedicated module * Fix asserts for exceptions in tests * Add missing type hinting * Replace str calls with repr * 44 class for handling all aws api calls (#50) * Updated deliverable sprint 1 (#22) * AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> * Sprint 2 deliverable (#43) * AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) * Db sync (#16) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids --------- Co-authored-by: Henk <hb130502@outlook.com> * Db sync (#25) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids * Changed email data dict to struct * added test for TypeError exception for eq operator * resolved linting errors * changed comment to correct datatype * dramatically improved test class name --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> * Added function to generate which users have to be invited after the sync button is pressed (#23) * Added 'generate_aws_sync_list' function and tests * solved black errors * changed generate_aws_sync_list to use SyncData structure * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * 12 moto helper (#36) * merged with development and added create_c_i_OU * Added some tests for create_c_i_OU * Added some tests for create_c_i_ou * Linting * Changed the mock_api call back to orginal * Added create_team_ou with tests * Fix problems with moto testing * Worked on tests and added apitalkerclass * Make test asserts more meaningful * black * Added tests for create_ou's without parts * Added one test that gets all children under OU * Fix linting * Changed return of response create team ou did not save the name of the team OU * Fix test create team OU * Resolved linting issues * Fix flake8 * remove create_team_ou --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Add checks for edge cases between AWS and Giphouse databases (#37) * added double user check (partly) * added some checks and made two new fancy classes for the storage of AWS tree dictionaries * added tests * added equals for AWSTree and Iteration objects * test stupid error * does it work now? * resolved merge conflicts with rebasing on development * cleaned up code based on pull request comments * Extraction of AWS data * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Removed classes for merge * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Linting fix * git fixes * Black fix * pydocstyle fix * Black fix again * removed flake8 'fix' * Final flake8 fix * Final final flake8 fix * spelling error fix --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> * AWS synchronization pipeline (and integration bug fixes) (#42) * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * Add function template * Fix 'a/an' grammar mistake * Add pipeline preconditions * Add pipeline preconditions tests * Add checks for required API actions * Add test cases for checking required API actions * Added implementation of creating and attaching policy in the pipeline * Remove double API actions * Added implementation of creating and moving accounts in the pipeline. This should still be divided into smaller functions. * Increase code readability * Stop checking account request status after known failure * Fixed small typos and added account details to a debug message about account creation failure * Added tests for pipeline policy and fixed typos in debug messages. * Split creating and moving accounts into multiple functions, and handle exceptions * added update_course_itation_ou with tests * updated pipeline_update_current_course_iteration * Add test cases for creating and moving member accounts * Bug fixes for pipeline dependencies that arose from integration sprint 2 tasks * Revised pipeline policy function and corresponding tests so that it should not fail after first pipeline run * Change duplicate policy attachment to soft-fail; replace organization ID with root ID --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> --------- Co-authored-by: Henk Berendsen <61596108+hb140502@users.noreply.github.com> Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Added class for API calls and preliminary version of the tests * Added final test for API talker class * Changed folder structure to organize AWS-related files * Fixed tests which failed due to not being mocked correctly * Removed aws files which have been moved to different folders * Fixed bug which caused mocking to not work * Added version of the api talker test which attempts to fix the error in test_simulate_principal_policy * Fix mocking issue * Added three remaining API calls and a test for one of them (list_tags_for_resource). Also added a function in the tests which creates an organization and returns its ID to clean up the other tests a bit. * Added function and test for list_roots API call * Fixed review comments * Fixed formatting issue in test_awssync.py and resolved review comment in test_awsapitalker.py --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Filip Łysak <92109241+FilipLysak001@users.noreply.github.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Merge #41 (check double iteration names, members in correct iteration) into development * refactored only the necessary checks to other files, as well as their tests. * made changes based on pull request * Refactor pipeline preconditions (#54) * Move all AWS files to dedicated AWS directory * Add refactored pipeline preconditions * Add coverage unit tests * Refactor creating course OU and attaching policy (#57) * Add new refactored AWSSync class * Refactored creating course OU and attaching policy * Add coverage unit tests * Add additional OU name check to unit test * Replace deprecated unittest method alias * Improve naming coverage unit tests * Fix test to check name and ID for single OU instead of over possibly multiple OUs * Remove not used logger * Rename function to be more accurate in what it does * Remove unnecessary moto_client variables in test_awsapitalker.py (#56) * Changed moto_client into self.api_talker.org_client * Use class decorators for mocking instead of start and stop functions * Refactor generate synchronization list and extract AWS tree * refactored files * removed create_aws_org from refactored * flake8 * Correct refactored functions * Changed extract_aws_setup to be more elegant * rm list_all_mailing_lists and update extract_aws * Changed extract_aws * black * Changed extract_aws to get_values * pydocstring * pydocstring * Black * Refactor create and move accounts function * Changed comments * Refactored create move * Refractored create_account * Changed test * Added my functions * Add api talker function for describe_create_account_status * Deleted create_account function * Added test * Fix describe_create_account_status docstring * Changed describe function * Finished basic test * Finished refactor create move * Black formattting * Duplicate code * Finished refractor --------- Co-authored-by: Henk <hb130502@outlook.com> * 62 policy id and tag fields on frontend panel (#65) * Added aws policy field on admin page * Added view paremeters for aws policies * Added a '.' to satisfy linting * Updated the AWS policy model * Added get_current_policy_id function * Satisfy docstring * Added test for save function in AWSPolicy model * Added test case for the save AWSPolicy model * Added tags values in aws policies * Updated test_get_policy_id * Changed GiPHouse name and get_policy name * Refactor AWSSync pipeline (#67) * Changed comments * Refactored create move * Refractored create_account * Changed test * Added my functions * Add api talker function for describe_create_account_status * Deleted create_account function * Added test * Fix describe_create_account_status docstring * Changed describe function * Finished basic test * Create structure of refactored pipeline * Finished refactor create move * Black formattting * Duplicate code * Reorganize files and complete merge * Refactor according to finished create_and_move_account, aws data extraction * first attempt at printing an error box when something fails in the pipeline (functional but not too pretty). * Hotfixes pipeline for working sprint 3 demo * Add pipeline test cases * Fix 100% code coverage * Fix tests for error box in pipeline * Added the current policy to the pipeline * Add API talker function and test for untag_resource AWS API call * Remove most debug messages when testing * Rename awssync_refactored to awssync * Increase sleep time between requesting account info * Implement pull request feedback --------- Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Mitchell <boesveld.mitchell@gmail.com> Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> * changes for resolving security (#68) * Documentation AWS integration feature (#70) * Add initial draft AWS integration documentation * Add pipeline flowchart and remove create organization * Apply review changes * Finishing touches (#71) * Disable all logging output when running tests * Add additional logging messages * Reduce testing account request interval * Remove redundant member account tags * Remove redundant logging message and variable * Add function retrieving the AWS policy tag from admin panel * Change global account counter attributes to local * Make base OU ID configurable in admin panel * Fixed spacing between GitHub and AWS sync buttons * Replace hard-coded security tags to retrieved from admin panel * Incorporate security flaw tag into create_move_account tests --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> * Documentation AWS configuration (#72) * added AWS deployment instructions to README * corrected typo * added part about base OU id * Add info configurable base * Change configuration instructions to be concise and complete * Replace old incorrect reference * Fix spelling mistake * Add info about new account request interval and attempts --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> --------- Co-authored-by: Henk Berendsen <61596108+hb140502@users.noreply.github.com> Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> Co-authored-by: Filip Łysak <92109241+FilipLysak001@users.noreply.github.com> Co-authored-by: Mitchell <boesveld.mitchell@gmail.com>
henkberendsen
added a commit
to GiPHouse/giphouse-website-spring2023
that referenced
this pull request
Jun 10, 2023
* Updated deliverable sprint 1 (#22) * AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> * Sprint 2 deliverable (#43) * AWS synchronisation button (#8) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Removed unnecessary docstrings. * Add boto3 and moto dependencies (#11) * Add logger and replace prints with logs * Add function to create AWS organization * Add unit tests for creating AWS organization * bugfix (GiPHouse#619) Co-authored-by: nvoers <nick-vanoers@hotmail.com> * Added logger setlevel (#20) * Db sync (#16) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids --------- Co-authored-by: Henk <hb130502@outlook.com> * Db sync (#25) * Added button to /admin/projects/project page on website * Framework for AWS synchronisation button functionality * Linked synchronisation button to framework * Fixed import order to comply with flake8 * Added docstring to synchronise_to_AWS * Changed redirect in synchronise_to_AWS function so that it redirects to the page from which the AWS sync button was pressed. * Added tests and changed awssync.py to allow for testing the button_pressed function. * Added get mailinglist to the awssync file * Added first version of get_all_managers * Added test case for mailing lists * Removed some prints * reformatted using black * flake8 intentation added * flake8 intentation correction * Removed get manager * Linting added * unused import removed * Added get_teamid_from_email * Changed function email with teamid * Updated get_emails_with_teamids, working now * Added test for get_emails_with_ids * Added linting * linting * Added more test * Linting in awssync and its test file * Moved the imports around * moved the imports around * Black linting * switched imports around * Switched imports around part 2 * Switched imports around part 3 * Switched imports around part 4 * Fixed when no project exist for mailing list * Added some more tests * Removed exeption try expect * Black linting * Changed get_email_with_teamid to new format * Changed get_emails_with_teamids to go over project * Added tests for get_emails_with_teamids * changed info for get_emails_with_teamids * Changed email data dict to struct * added test for TypeError exception for eq operator * resolved linting errors * changed comment to correct datatype * dramatically improved test class name --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> * Added function to generate which users have to be invited after the sync button is pressed (#23) * Added 'generate_aws_sync_list' function and tests * solved black errors * changed generate_aws_sync_list to use SyncData structure * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * 12 moto helper (#36) * merged with development and added create_c_i_OU * Added some tests for create_c_i_OU * Added some tests for create_c_i_ou * Linting * Changed the mock_api call back to orginal * Added create_team_ou with tests * Fix problems with moto testing * Worked on tests and added apitalkerclass * Make test asserts more meaningful * black * Added tests for create_ou's without parts * Added one test that gets all children under OU * Fix linting * Changed return of response create team ou did not save the name of the team OU * Fix test create team OU * Resolved linting issues * Fix flake8 * remove create_team_ou --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Add checks for edge cases between AWS and Giphouse databases (#37) * added double user check (partly) * added some checks and made two new fancy classes for the storage of AWS tree dictionaries * added tests * added equals for AWSTree and Iteration objects * test stupid error * does it work now? * resolved merge conflicts with rebasing on development * cleaned up code based on pull request comments * Extraction of AWS data * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Removed classes for merge * Added function for extracting data * Added mock format * finished function (testing needed) * Linting fix * fix no return of tree * Fix AttributeError * Unwrap tuple instead of accessing by element to increase code readability * Fixed for new struct * Implementation bug fixes * added tests (not done) * Linting fix * git fixes * Black fix * pydocstyle fix * Black fix again * removed flake8 'fix' * Final flake8 fix * Final final flake8 fix * spelling error fix --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> * AWS synchronization pipeline (and integration bug fixes) (#42) * Create and attach SCP policies (#29) * Add functions for creating and attaching SCP policies * Improve test cases * Add function template * Fix 'a/an' grammar mistake * Add pipeline preconditions * Add pipeline preconditions tests * Add checks for required API actions * Add test cases for checking required API actions * Added implementation of creating and attaching policy in the pipeline * Remove double API actions * Added implementation of creating and moving accounts in the pipeline. This should still be divided into smaller functions. * Increase code readability * Stop checking account request status after known failure * Fixed small typos and added account details to a debug message about account creation failure * Added tests for pipeline policy and fixed typos in debug messages. * Split creating and moving accounts into multiple functions, and handle exceptions * added update_course_itation_ou with tests * updated pipeline_update_current_course_iteration * Add test cases for creating and moving member accounts * Bug fixes for pipeline dependencies that arose from integration sprint 2 tasks * Revised pipeline policy function and corresponding tests so that it should not fail after first pipeline run * Change duplicate policy attachment to soft-fail; replace organization ID with root ID --------- Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> --------- Co-authored-by: Henk Berendsen <61596108+hb140502@users.noreply.github.com> Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Henk <hb130502@outlook.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com> * Added class for API calls and preliminary version of the tests * Added final test for API talker class * Changed folder structure to organize AWS-related files * Fixed tests which failed due to not being mocked correctly * Removed aws files which have been moved to different folders * Fixed bug which caused mocking to not work * Added version of the api talker test which attempts to fix the error in test_simulate_principal_policy * Fix mocking issue * Added three remaining API calls and a test for one of them (list_tags_for_resource). Also added a function in the tests which creates an organization and returns its ID to clean up the other tests a bit. * Added function and test for list_roots API call * Fixed review comments * Fixed formatting issue in test_awssync.py and resolved review comment in test_awsapitalker.py --------- Co-authored-by: 1058274 <70607431+1058274@users.noreply.github.com> Co-authored-by: BrentHag <123667942+BrentHag@users.noreply.github.com> Co-authored-by: Nick van Oers <39125833+nvoers@users.noreply.github.com> Co-authored-by: nvoers <nick-vanoers@hotmail.com> Co-authored-by: Jer111 <82157107+Jer111@users.noreply.github.com> Co-authored-by: Filip Łysak <92109241+FilipLysak001@users.noreply.github.com> Co-authored-by: mitchellboes <49476235+mitchellboes@users.noreply.github.com> Co-authored-by: Jer111 <j.vanoort7@gmail.com> Co-authored-by: Fouad Lamsettef <fouadlamsettef123@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #617