Skip to content
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

Remove unverified role from discord on /verify #2156

Conversation

shobhan-sundar-goutam
Copy link
Contributor

@shobhan-sundar-goutam shobhan-sundar-goutam commented Sep 14, 2024

Date: 14/09/24

Developer Name: Shobhan Sundar Goutam


Issue Ticket Number

Closes first issue - Real-Dev-Squad/discord-slash-commands#234

Description

This PR fixes the first issue which is removing unverified role from discord when user runs /verify and connects their RDS Discord

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1
discord-verify.mp4

Test Coverage

Screenshot 1

image

image

vinit717 and others added 6 commits September 15, 2024 13:47
…or migration (Real-Dev-Squad#2134)

* fix: username generation for new user

* chore: add username function to nee file to avoid circular dependency

* chore: add test for username utils

* chore: fix validator and write test for it

* chore: remove .only from test and fix count functionality

* chore: fix format username function and write it's test

* chore: add test case for model function

* chore: add more test for format uername function

* chore: fix model tests

* chore: fix format function logic and it's test

* chore: fix failing test

* chore: fix generate username function

* chore: move generate username to user service
…ggled off (Real-Dev-Squad#2132)

* Revoke roles temporarily based on revoked_roles

* Extended validator PATCH \users\self

* UpdateUser Set revoked_roles in user object

minor changes:
- fix typo in middlewares/validator to allow only member and super_user role

* Test coverage for the changes

* Modify Response

* Changes Property name from revoked_roles to disabled_roles

* refactored controller/users.js

* [refactor] controller logic & test/unit/model

* [fix] updateSelf developers can only updated disabled role property

udpateSelf funciton update data of those people people who are
either new or not in discord, in order case the user of the
feature are those who are in the discord as well as have
their userDetailsCompelete,

Before, users who lied in this category couldn't update their
user profile for that they need profile service

if someone falls in this category, he can only update the
disabled_roles property, for other properties such people
need to use profile services

* [chore-Real-Dev-Squad#2132] Add Test Case & refactor users model

* [refactor] remove redundent reassignment
* Revoke roles temporarily based on revoked_roles

* Extended validator PATCH \users\self

* UpdateUser Set revoked_roles in user object

minor changes:
- fix typo in middlewares/validator to allow only member and super_user role

* Test coverage for the changes

* Modify Response

* Changes Property name from revoked_roles to disabled_roles

* refactored controller/users.js

* [refactor] controller logic & test/unit/model

* [fix] updateSelf developers can only updated disabled role property

udpateSelf funciton update data of those people people who are
either new or not in discord, in order case the user of the
feature are those who are in the discord as well as have
their userDetailsCompelete,

Before, users who lied in this category couldn't update their
user profile for that they need profile service

if someone falls in this category, he can only update the
disabled_roles property, for other properties such people
need to use profile services

* [chore-Real-Dev-Squad#2132] Add Test Case & refactor users model

* [refactor] remove redundent reassignment

* added dev flag and fallback if discord response isn't as expected

* fix lint error

---------

Co-authored-by: Amit Prakash <[email protected]>
Co-authored-by: Achintya Chatterjee <[email protected]>
Copy link
Member

@iamitprakash iamitprakash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is tests ..?

@@ -40,6 +43,38 @@ const getExternalAccountData = async (req, res) => {
return res.boom.unauthorized("Token Expired. Please generate it again");
}

const { id: userId, roles } = req.userData;

if (!roles.in_discord) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • can we move this inside a function and return the data required here? it will make it easy to test the logic that's written here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I'll do that

iamitprakash and others added 8 commits September 18, 2024 01:52
* chore: make firstname and lastname to lowercase

* chore: remove type check
* added condition to prevent mavens being added to idle,idle7d

* edited test for group-idle-7d and added test for group-idle

* resolving build error

* resolving test errors

* fixing tests

* fixed the tests

* added model tests

* added line break

* resolving Tejas's comments

* fixed model function

* added feature flag

* adding feature flag

* edited tests

* fixing unit

* added FF

---------

Co-authored-by: Amit Prakash <[email protected]>
@shubhdevelop
Copy link
Contributor

Instead of putting a screenshot of no. of test passed. Put in the screenshot of the test coverage you added

iamitprakash and others added 7 commits September 22, 2024 00:03
* chore: remove feature flag for GET /logs API

* chore: remove dev FF from GET /logs integration tests
* chore: remove feature flag for GET /requests API

* chore: remove empty query from GET /requests middleware test
…Real-Dev-Squad#2153)

* chore: remove feature flag for POST /requests API

* chore: remove feature flag for PUT /requests/:id API

* chore: remove dev query param from request query type

* chore: remove empty query from POST /requests API middleware test
samarpan1738 and others added 15 commits September 22, 2024 15:01
* enhancement: adding remaining applications count and removing View Details button

* added integration test

* Revert "added integration test"

This reverts commit e90cebc.

* added integration test

* removed comments

* added changes as per the comment

* Update application-validator.test.ts

* Update applications.ts

* Update application-validator.test.ts

* Update application.test.ts

---------

Co-authored-by: Vinit khandal <[email protected]>
…ationInProfileDiffsAPI

Added Pagination in profile diffs API
@shobhan-sundar-goutam shobhan-sundar-goutam deleted the update-/verify-functionality branch October 1, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants