Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
0d569d4
Update local docker setup
arkid15r Mar 11, 2025
b36ee6a
initial tests
harsh3dev Apr 1, 2025
8f3a114
add
harsh3dev Apr 6, 2025
8362d04
fix
harsh3dev Apr 6, 2025
2115cbb
Merge branch 'main' of https://github.com/OWASP/Nest into backend-tes…
harsh3dev Apr 6, 2025
a63f47d
Merge branch 'main' of https://github.com/OWASP/Nest into backend-tes…
harsh3dev Apr 11, 2025
c750ead
Run make update
arkid15r Apr 11, 2025
3b26745
Clean up vite
arkid15r Apr 11, 2025
e3c3b14
Flatten /community URLs
arkid15r Apr 11, 2025
5e82e37
Move /projects/contribute to /contribute
arkid15r Apr 11, 2025
59f6713
Update Next.js config
arkid15r Apr 11, 2025
9954e71
Update proxy configuration
arkid15r Apr 11, 2025
3424aa9
Update home page
arkid15r Apr 11, 2025
136feb7
Update proxy configuration. Update home page.
arkid15r Apr 11, 2025
df13258
Update tests
arkid15r Apr 11, 2025
71f2d4d
Update redirects.conf
arkid15r Apr 11, 2025
f8dfd8a
Run make update
arkid15r Apr 12, 2025
f7e3108
updated line break issue (#1345)
nipunh Apr 12, 2025
0784518
Run make update
arkid15r Apr 12, 2025
0a3c569
Update MultiSearch.tsx
arkid15r Apr 12, 2025
d915c3a
Update home page e2e tests
arkid15r Apr 12, 2025
6b9991f
Run make update
arkid15r Apr 13, 2025
09de2e9
Improvement of leaders list component (#1362)
AbhayTopno Apr 13, 2025
2a4ad69
Run make update
arkid15r Apr 14, 2025
9f27a38
Bump @types/node from 20.17.30 to 22.14.1 in /frontend (#1366)
dependabot[bot] Apr 14, 2025
1f745bc
Bump actions/setup-node from 4.3.0 to 4.4.0 (#1365)
dependabot[bot] Apr 14, 2025
1de84f0
Added repository count and followers count for the users/organization…
abhayymishraa Apr 14, 2025
fa0f1b7
Added sentry config and global-error component (#1338)
Rajgupta36 Apr 14, 2025
92a0ee8
Added tooltip when hover && repository name (#1363)
abhayymishraa Apr 14, 2025
dcf0303
Clean up Issue::commentsCount
arkid15r Apr 14, 2025
99af549
Updat main page recent issues/PRs style
arkid15r Apr 14, 2025
317b881
Adding icons for left headings (#1359)
shining-bluemoon-11 Apr 15, 2025
dae6695
Run make update
arkid15r Apr 15, 2025
d6072ee
update TopContributors to use separate links for member and project n…
codic-yeeshu Apr 16, 2025
35930fc
Improve main page GraphQL performance (#1369)
ahmedxgouda Apr 16, 2025
d05b469
Update organization details page
arkid15r Apr 16, 2025
ffaf771
Run make update
arkid15r Apr 16, 2025
266695a
Moved `/repositories` under organization (#1380)
Dishant1804 Apr 16, 2025
b5ceaae
Updae main page
arkid15r Apr 16, 2025
da4214d
Clean up backend/apps/owasp/migrations/0031_alter_chapter_created_at_…
arkid15r Apr 16, 2025
a7c971c
Update icons
arkid15r Apr 16, 2025
8db7845
Run make update
arkid15r Apr 17, 2025
75a6d0f
Update organization pages
arkid15r Apr 17, 2025
ac9df4e
Update CardDetailsPage.tsx component
arkid15r Apr 18, 2025
d8d5231
Run make update
arkid15r Apr 18, 2025
6def4dd
Breadcrumb component implementation (#1397)
yashgoyal0110 Apr 19, 2025
ae61403
Update CI/CD
arkid15r Apr 19, 2025
b22a4e9
Use more GHA cache
arkid15r Apr 19, 2025
6071ab8
Run make update
arkid15r Apr 19, 2025
9cea49e
Try combined docker cache
arkid15r Apr 19, 2025
787a137
Update build-push-action syntax
arkid15r Apr 19, 2025
0cd3d07
Deal with N+1
arkid15r Apr 19, 2025
0c6d50e
Update docker cache settings
arkid15r Apr 19, 2025
db62075
Tune docker cache for e2e tests
arkid15r Apr 19, 2025
99e9f06
Use gha only for e2e cache
arkid15r Apr 19, 2025
7b69885
Use push/pull
arkid15r Apr 19, 2025
5ef73e5
Test no cache
arkid15r Apr 19, 2025
771a4f5
Update pnpm install options
arkid15r Apr 19, 2025
1972806
Remove mode=max for gha cache
arkid15r Apr 20, 2025
2535211
Extend user model with total contributions field. (#1209)
ahmedxgouda Apr 20, 2025
84ddd0e
fixed snapshot page where breadcrumb was overlapping (#1400)
codic-yeeshu Apr 20, 2025
4d60d52
Optimize Auto Labeling for GitHub Issues (#1326)
yashgoyal0110 Apr 20, 2025
7d2d4fc
Add Environment Variables Documentation (#1213)
rishyym0927 Apr 20, 2025
0af1ad6
Map Glitches Due to Unnecessary Re-Renders (#1156)
srinjoy933 Apr 20, 2025
4d4ae71
Use gha min cache
arkid15r Apr 21, 2025
a6ac33a
Disable gha cache
arkid15r Apr 21, 2025
03d8e6d
adding feature of anchor links (#960)
shining-bluemoon-11 Apr 21, 2025
501f46c
Run make update
arkid15r Apr 21, 2025
3f2527c
Add cache-from for run-frontend-e2e-tests
arkid15r Apr 21, 2025
aafa78a
Feature: NestBot block message template system (#1301)
Li-ChangC Apr 21, 2025
11970b6
Add recent PRs to project/repository pages (#1398)
Dishant1804 Apr 21, 2025
04c4119
Fixes 1396: UI for Mobile Homepage fixed (#1404)
KaranNegi20Feb Apr 21, 2025
a8e9cd6
Update users model
arkid15r Apr 21, 2025
ed6d944
Update pre-commit configuration
arkid15r Apr 21, 2025
d334b65
Update .pre-commit-config.yaml
arkid15r Apr 21, 2025
b4054f5
Rename NestBot templates
arkid15r Apr 22, 2025
af73d80
Run make update
arkid15r Apr 22, 2025
467e529
Update badges
arkid15r Apr 23, 2025
eaffcbc
Run make update
arkid15r Apr 23, 2025
fd7b995
Update README.md
arkid15r Apr 23, 2025
e26c97e
Add Turbo for Faster Compilation, Testing, and Build Times (#1415)
Rajgupta36 Apr 23, 2025
437504d
Run make update
arkid15r Apr 24, 2025
c9c8768
Bump actions/setup-python from 5.5.0 to 5.6.0 (#1418)
dependabot[bot] Apr 24, 2025
da73788
Bump github/codeql-action from 3.28.15 to 3.28.16 (#1419)
dependabot[bot] Apr 24, 2025
671bd61
Add owasp-sync-posts to update-data
arkid15r Apr 25, 2025
6648bec
Run make update
arkid15r Apr 25, 2025
a682702
Bump docker/build-push-action from 6.15.0 to 6.16.0 (#1422)
dependabot[bot] Apr 25, 2025
cdf80e5
Update about page leaders section
arkid15r Apr 26, 2025
bacb808
Update backend/data/nest.json.gz
arkid15r Apr 26, 2025
89afa34
Run make update
arkid15r Apr 26, 2025
58057ca
Improved AnchorTitle component used slug to get href from title (#1434)
M-ayank2005 Apr 27, 2025
7543ad8
Run make update
arkid15r Apr 27, 2025
17304a8
Nestbot /events command refactor (#1433)
Dishant1804 Apr 27, 2025
655bdfd
Run make update
arkid15r Apr 28, 2025
f5bbad5
Update docker configuration
arkid15r Apr 28, 2025
e6a8e18
Add prune target
arkid15r Apr 28, 2025
14b1286
Fixed breadcrumb styling and added tests (#1435)
samyak003 Apr 28, 2025
60d5b5d
Update proxy deploy process
arkid15r Apr 28, 2025
f0ecf4d
Run make update
arkid15r Apr 29, 2025
aca3ba9
Added Metadata for dynamic pages and static pages (#1414)
abhayymishraa Apr 29, 2025
e832de8
Run make update
arkid15r Apr 30, 2025
08fd09d
introduced separate component for dropdown to enhance the main menu (…
codic-yeeshu Apr 30, 2025
2c99e2d
Fixing anchor title for consistent behaviour (#1428)
shining-bluemoon-11 Apr 30, 2025
c4bd2e0
Add nest-architecture.png
arkid15r Apr 30, 2025
4ebb633
Added django-redis as default cache (#1371)
Rajgupta36 May 1, 2025
644237a
Update local docker setup
arkid15r Mar 11, 2025
7ae989c
initial tests
harsh3dev Apr 1, 2025
f8b6a1e
add
harsh3dev Apr 6, 2025
e4732ae
fix
harsh3dev Apr 6, 2025
cdc5efb
Merge branch 'backend-test-fix' of https://github.com/harsh3dev/Nest …
harsh3dev May 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion backend/apps/common/open_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def complete(self):

return response.choices[0].message.content
except openai.APIConnectionError:
logger.exception("A connection error occurred during OpenAI API request.")
logger.exception("An error occurred during OpenAI API request.")
return None
except Exception:
logger.exception("An error occurred during OpenAI API request.")
return None
29 changes: 6 additions & 23 deletions backend/apps/github/api/search/user.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""OWASP app user search API."""

from algoliasearch_django import raw_search
from __future__ import annotations

from apps.github.constants import default_attributes
from apps.github.models.user import User
from apps.github.utils import raw_search


def get_users(query, attributes=None, limit=25, page=1, searchable_attributes=None):
Expand All @@ -21,33 +23,14 @@ def get_users(query, attributes=None, limit=25, page=1, searchable_attributes=No
"""
params = {
"attributesToHighlight": [],
"attributesToRetrieve": attributes
or [
"idx_avatar_url",
"idx_bio",
"idx_company",
"idx_contributions",
"idx_created_at",
"idx_email",
"idx_followers_count",
"idx_following_count",
"idx_issues_count",
"idx_key",
"idx_location",
"idx_login",
"idx_name",
"idx_public_repositories_count",
"idx_title",
"idx_updated_at",
"idx_url",
],
"attributesToRetrieve": attributes or default_attributes,
"hitsPerPage": limit,
"minProximity": 4,
"page": page - 1,
"page": page - 1, # Algolia uses 0-based pagination
"typoTolerance": "min",
}

if searchable_attributes:
params["restrictSearchableAttributes"] = searchable_attributes

return raw_search(User, query, params)
return raw_search(User, query or "", params)
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,38 @@ def handle(self, *args, **options):
offset = options["offset"]
projects = []
for idx, project in enumerate(active_projects[offset:]):
prefix = f"{idx + offset + 1} of {active_projects_count}"
print(f"{prefix:<10} {project.owasp_url}")

repository_urls = project.related_urls.copy()
for repository_url in repository_urls:
repository_path = get_repository_path(repository_url)
if not repository_path:
logger.info("Couldn't get repository path for %s", repository_url)
continue

try:
gh_repository = gh.get_repo(repository_path)
except UnknownObjectException as e:
if e.data["status"] == "404" and "Not Found" in e.data["message"]:
project.invalid_urls.add(repository_url)
project.related_urls.remove(repository_url)
project.save(update_fields=("invalid_urls", "related_urls"))
continue

organization, repository = sync_repository(gh_repository)
if organization is not None:
organization.save()

project.repositories.add(repository)

projects.append(project)

# Bulk save data.
self.process_project(idx, offset, active_projects_count, project, gh, projects)

Project.bulk_save(projects)

def process_project(self, idx, offset, active_projects_count, project, gh, projects):
prefix = f"{idx + offset + 1} of {active_projects_count}"
print(f"{prefix:<10} {project.owasp_url}")

repository_urls = project.related_urls.copy()
for repository_url in repository_urls:
self.process_repository_url(repository_url, project, gh)

projects.append(project)

def process_repository_url(self, repository_url, project, gh):
repository_path = get_repository_path(repository_url)
if not repository_path:
logger.info("Couldn't get repository path for %s", repository_url)
return

try:
gh_repository = gh.get_repo(repository_path)
organization, repository = sync_repository(gh_repository)

if organization:
organization.save()
project.repositories.add(repository)
except UnknownObjectException as e:
self.handle_unknown_object_exception(e, project, repository_url)

def handle_unknown_object_exception(self, exception, project, repository_url):
if exception.data["status"] == "404" and "Not Found" in exception.data["message"]:
project.invalid_urls.add(repository_url)
project.related_urls.remove(repository_url)
project.save(update_fields=("invalid_urls", "related_urls"))
5 changes: 5 additions & 0 deletions backend/apps/github/models/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ def bulk_save(labels):
"""Bulk save labels."""
BulkSaveModel.bulk_save(Label, labels)

@staticmethod
def get_node_id(gh_label):
"""Get node ID from GitHub label."""
return gh_label.raw_data.get("node_id", "")

@staticmethod
def update_data(gh_label, save=True):
"""Update label data.
Expand Down
10 changes: 6 additions & 4 deletions backend/apps/github/models/managers/repository_contributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ class RepositoryContributorQuerySet(models.QuerySet):
"""Repository contributor queryset."""

def by_humans(self):
"""Return human repository contributors only."""
return self.filter(user__is_bot=False).exclude(
user__login__in=User.get_non_indexable_logins()
)
"""Filter out bots and non-indexable users."""
queryset = self.filter(user__is_bot=False)
non_indexable_logins = User.get_non_indexable_logins()
if non_indexable_logins:
queryset = queryset.exclude(user__login__in=non_indexable_logins)
return queryset

def to_community_repositories(self):
"""Return community repositories contributors only."""
Expand Down
3 changes: 2 additions & 1 deletion backend/apps/slack/commands/chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from apps.slack.apps import SlackConfig
from apps.slack.blocks import markdown
from apps.slack.common.constants import COMMAND_HELP, COMMAND_START
from apps.slack.common.handlers.chapters import get_blocks
from apps.slack.common.presentation import EntityPresentation
from apps.slack.utils import get_text

Expand Down Expand Up @@ -38,6 +37,8 @@ def chapters_handler(ack, command, client):
),
]
else:
from apps.slack.common.handlers.chapters import get_blocks

search_query = "" if command_text in COMMAND_START else command_text
blocks = get_blocks(
search_query=search_query,
Expand Down
4 changes: 3 additions & 1 deletion backend/apps/slack/commands/committees.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from django.conf import settings

from apps.slack.apps import SlackConfig
from apps.slack.common.handlers.committees import get_blocks
from apps.slack.common.presentation import EntityPresentation
from apps.slack.utils import get_text

Expand All @@ -24,6 +23,9 @@ def committees_handler(ack, command, client):
return

search_query = command["text"].strip()

from apps.slack.common.handlers.committees import get_blocks

blocks = get_blocks(
search_query=search_query,
limit=10,
Expand Down
5 changes: 4 additions & 1 deletion backend/apps/slack/commands/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def events_handler(ack, command, client):

events_data = get_events_data()

valid_events = [event for event in events_data if event.start_date]
valid_events = []
if events_data:
valid_events = [event for event in events_data if event.start_date]

sorted_events = sorted(valid_events, key=lambda x: x.start_date)

categorized_events = {}
Expand Down
18 changes: 13 additions & 5 deletions backend/apps/slack/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,22 @@ def from_slack(self, context, payload):

command = payload.get("command", "")
text = payload.get("text", "")
self.command = command.lstrip("/")

if command and command == OWASP_COMMAND:
try:
command, *args = text.strip().split()
text = " ".join(args)
parts = text.strip().split(maxsplit=1)
if parts and parts[0]:
self.command = parts[0]
self.text = parts[1] if len(parts) > 1 else ""
else:
self.command = OWASP_COMMAND.lstrip("/")
self.text = text
except ValueError:
pass
self.command = command.lstrip("/")
self.text = text
self.command = OWASP_COMMAND.lstrip("/")
self.text = text
else:
self.text = text

# In this order.
self.trigger = self.command or payload.get("action_id", "") or payload.get("type", "")
Expand Down
48 changes: 25 additions & 23 deletions backend/apps/slack/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,32 +190,33 @@ def get_text(blocks):
if "text" in block and block["text"].get("type") == "mrkdwn":
text.append(strip_markdown(block["text"]["text"]))
elif "fields" in block:
text.append(
NL.join(
strip_markdown(field["text"])
for field in block["fields"]
if field.get("type") == "mrkdwn"
)
)
field_texts = [
strip_markdown(field["text"])
for field in block["fields"]
if field.get("type") == "mrkdwn"
]
if field_texts:
text.append(NL.join(field_texts))
case "divider":
text.append("---")
case "context":
text.append(
NL.join(
strip_markdown(element["text"])
for element in block["elements"]
if element.get("type") == "mrkdwn"
)
)
context_texts = [
strip_markdown(element["text"])
for element in block.get("elements", [])
if element.get("type") == "mrkdwn" and "text" in element
]
if context_texts:
text.append(NL.join(context_texts))
case "actions":
text.append(
NL.join(
strip_markdown(element["text"]["text"])
for element in block["elements"]
if element.get("type") == "button"
)
)
# TODO(arkid15r): consider removing this.
button_texts = [
strip_markdown(element["text"]["text"])
for element in block.get("elements", [])
if element.get("type") == "button"
and "text" in element
and "text" in element["text"]
]
if button_texts:
text.append(NL.join(button_texts))
case "image":
text.append(f"Image: {block.get('image_url', '')}")
case "header":
Expand All @@ -236,4 +237,5 @@ def strip_markdown(text):

"""
slack_link_pattern = re.compile(r"<(https?://[^|]+)\|([^>]+)>")
return slack_link_pattern.sub(r"\2 (\1)", text).replace("*", "")
text = slack_link_pattern.sub(r"\2 (\1)", text)
return text.replace("*", "")
Loading
Loading