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

Addition of Contribute Section in Home of Slack NestBot #593

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

AbhayTopno
Copy link
Collaborator

Screenshot 2025-01-24 020128

Finished adding the Contribute section to the home of Slack NestBot. If there are any conflicts, feel free to reach out to me

@AbhayTopno AbhayTopno requested a review from arkid15r as a code owner January 23, 2025 23:28
@arkid15r arkid15r linked an issue Jan 24, 2025 that may be closed by this pull request
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

Good work but it seems you've overdone it a bit.
We already have Issue entity in the index which is essentially a building block for Contribute page.

The tasks' aim here was to reuse slack/commands/contribute.py code by refactoring it into a shared handler similar to chapters.

BTW here @nitinawari suggested the right approach to solve this.

Please remove redundant functionality and owasp app API changes while keeping essential changes only.

@AbhayTopno
Copy link
Collaborator Author

Ok i'll do it

Copy link
Collaborator

@nitinawari nitinawari left a comment

Choose a reason for hiding this comment

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

hey @AbhayTopno,

Great work! I can see the effort you've put in, but it seems like there was a slight misunderstanding of the original issue.

When you have time, please check out these suggestions:

I understand what you did — you created a new entity in apps/owaspas Contributor. However, we don’t need to create a new one. We already have issue entities in apps/github. Please use those instead.

You can refer to this comment for the actual steps to resolve this.

Hints for you:

  • You don’t need to make any changes outside of apps/slack.

  • This is not related to this PR, but please make sure to create a separate branch for your PRs in the future, rather than pushing directly to the main branch. don't close this PR until get merged

I hope these comments and suggestions help you resolve the issue.

Thank you!

@@ -5,6 +5,7 @@

from apps.owasp.models.chapter import Chapter
from apps.owasp.models.committee import Committee
from apps.owasp.models.contribute import Contribute
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't need to do this because we have alreadyissue model added in apps/github , revert changes for this file

Copy link
Collaborator

Choose a reason for hiding this comment

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

we already have issue entity in apps/github/api , use that don't create this one

@@ -4,12 +4,14 @@

from apps.owasp.api.chapter import ChapterViewSet
from apps.owasp.api.committee import CommitteeViewSet
from apps.owasp.api.contribute import ContributeViewSet
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove this

Copy link
Collaborator

Choose a reason for hiding this comment

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

we already have github/index/issue use that don't create duplicate

Copy link
Collaborator

Choose a reason for hiding this comment

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

don't create this contribution model we already have apps.github/model/issue.py utilize that

Copy link
Collaborator

Choose a reason for hiding this comment

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

remove this not part of task we already have issue in github/models/managers`

Copy link
Collaborator

Choose a reason for hiding this comment

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

same goes for this also

backend/apps/slack/commands/contribute.py Show resolved Hide resolved
):
"""Get contribute blocks."""
from apps.owasp.api.search.issue import get_issues
from apps.owasp.models.contribute import Contribute
Copy link
Collaborator

Choose a reason for hiding this comment

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

plz use issue model from apps/github/models don't create extra model , it is a duplicate

Suggested change
from apps.owasp.models.contribute import Contribute
from apps.github.models.issue import Issue

Copy link
Collaborator

Choose a reason for hiding this comment

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

please write required test cases for new files and update for modified files

@AbhayTopno
Copy link
Collaborator Author

AbhayTopno commented Jan 25, 2025

Thanks for the correction. I'll make the changes as you suggested, and sorry for the trouble I'm causing @nitinawari

@nitinawari
Copy link
Collaborator

nitinawari commented Jan 25, 2025

Hey @AbhayTopno, no need to apologize for anything. We’re all in the learning phase. 👍 If you need any help, feel free to reach out to me on Slack DM. I’ll be happy to assist.

@arkid15r
Copy link
Collaborator

@nitinawari thanks for helping with reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add NestBot home page Contribute section
3 participants