Skip to content

Commit 86eed91

Browse files
committed
Merge branch 'main' into pr/space-techy/845
2 parents 4bd0594 + efa0ec4 commit 86eed91

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1559
-335
lines changed

.coderabbit.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
chat:
2+
auto_reply: true
3+
code_generation:
4+
docstrings:
5+
language: en-US
6+
early_access: true
7+
language: en-US
8+
reviews:
9+
assess_linked_issues: true
10+
auto_apply_labels: false
11+
auto_review:
12+
enabled: true
13+
drafts: true
14+
collapse_walkthrough: false
15+
high_level_summary: true
16+
high_level_summary_in_walkthrough: true
17+
labeling_instructions: []
18+
poem: false
19+
profile: chill
20+
request_changes_workflow: false
21+
review_status: true
22+
sequence_diagrams: false

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
bug_report.md
12
---
3+
24
name: Bug report
35
about: Create a report to help us improve
46
title: ''
5-
labels: ''
7+
labels: ['bug']
68
assignees: ''
7-
89
---
910

1011
**Describe the bug**
@@ -22,7 +23,9 @@ Steps to reproduce the behavior:
2223
A clear and concise description of what you expected to happen.
2324

2425
**Are you going to work on fixing this?**
25-
No.
26+
27+
- [ ] Yes
28+
- [x] No
2629

2730
**Screenshots**
2831
If applicable, add screenshots to help explain your problem.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
name: Feature request
33
about: Suggest an idea for this project
44
title: ''
5-
labels: ''
5+
labels: ['enhancement']
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**
@@ -16,5 +15,10 @@ A clear and concise description of what you want to happen.
1615
**Describe alternatives you've considered**
1716
A clear and concise description of any alternative solutions or features you've considered.
1817

18+
**Are you going to work on implementing this?**
19+
20+
- [ ] Yes
21+
- [x] No
22+
1923
**Additional context**
2024
Add any other context or screenshots about the feature request here.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Auto Label Issues"
2+
on:
3+
issues:
4+
types:
5+
- edited
6+
- opened
7+
8+
jobs:
9+
label:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Apply Labels to Issues
13+
uses: actions/[email protected]
14+
with:
15+
script: |
16+
const issue = context.payload.issue;
17+
const keywords = {
18+
"bug": ["error", "failure", "not working"],
19+
"enhancement": ["add", "feature request", "improve"],
20+
"question": ["clarification", "help", "how to"]
21+
};
22+
23+
let labels = [];
24+
for (const [label, words] of Object.entries(keywords)) {
25+
if (words.some(word => issue.title.toLowerCase().includes(word) || issue.body.toLowerCase().includes(word))) {
26+
labels.push(label);
27+
}
28+
}
29+
30+
if (labels.length > 0) {
31+
github.rest.issues.addLabels({
32+
issue_number: context.issue.number,
33+
labels: labels,
34+
owner: context.repo.owner,
35+
repo: context.repo.repo
36+
});
37+
}

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ If you are adding new functionality, include relevant test cases.
266266
### 1. Find Something to Work On
267267

268268
- Check the **Issues** tab for open issues: [https://github.com/owasp/nest/issues](https://github.com/owasp/nest/issues)
269-
- If you want to work on something specific, create a new issue or comment on an existing one to let others know.
269+
- Found a bug or have a feature request? Open a new issue.
270+
- Want to work on an existing issue? Ask the maintainers to assign it to you before submitting a pull request.
271+
- New to the project? Start with issues labeled `good first issue` for an easier onboarding experience.
270272

271273
### 2. Create a Branch
272274

backend/Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ owasp-process-snapshots:
7878
@echo "Processing OWASP snapshots"
7979
@CMD="python manage.py owasp_process_snapshots" $(MAKE) exec-backend-command
8080

81+
owasp-update-project-health-metrics:
82+
@echo "Updating OWASP project health requirements"
83+
@CMD="python manage.py owasp_update_project_health_metrics" $(MAKE) exec-backend-command
84+
85+
owasp-update-project-health-requirements:
86+
@echo "Updating OWASP project health metrics"
87+
@CMD="python manage.py owasp_update_project_health_requirements" $(MAKE) exec-backend-command
88+
8189
owasp-scrape-chapters:
8290
@echo "Scraping OWASP site chapters data"
8391
@CMD="python manage.py owasp_scrape_chapters" $(MAKE) exec-backend-command
@@ -90,6 +98,10 @@ owasp-scrape-projects:
9098
@echo "Scraping OWASP site projects data"
9199
@CMD="python manage.py owasp_scrape_projects" $(MAKE) exec-backend-command
92100

101+
owasp-update-events:
102+
@echo "Getting OWASP events data"
103+
@CMD="python manage.py owasp_update_events" $(MAKE) exec-backend-command
104+
93105
purge-data:
94106
@CMD="python manage.py purge_data" $(MAKE) exec-backend-command
95107

@@ -123,4 +135,5 @@ update-data: \
123135
owasp-scrape-committees \
124136
owasp-scrape-projects \
125137
github-update-project-related-repositories \
126-
owasp-aggregate-projects
138+
owasp-aggregate-projects \
139+
owasp-update-events

backend/apps/common/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
"""Common app utils."""
22

3+
import re
34
from datetime import datetime, timezone
45

56
from django.conf import settings
67
from django.template.defaultfilters import pluralize
78
from django.utils.text import Truncator
9+
from django.utils.text import slugify as django_slugify
810
from humanize import intword, naturaltime
911

1012

@@ -35,6 +37,7 @@ def natural_date(value):
3537
value = datetime.strptime(value, "%Y-%m-%d").replace(tzinfo=timezone.utc)
3638
elif isinstance(value, int):
3739
value = datetime.fromtimestamp(value, tz=timezone.utc)
40+
3841
return naturaltime(value)
3942

4043

@@ -44,6 +47,11 @@ def natural_number(value, unit=None):
4447
return f"{number} {unit}{pluralize(value)}" if unit else number
4548

4649

50+
def slugify(text):
51+
"""Return slug for text."""
52+
return re.sub(r"-{2,}", "-", django_slugify(text))
53+
54+
4755
def truncate(text, limit, truncate="..."):
4856
"""Truncate text to the given limit."""
4957
return Truncator(text).chars(limit, truncate=truncate)

backend/apps/github/management/commands/github_update_owasp_organization.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from apps.owasp.constants import OWASP_ORGANIZATION_NAME
1414
from apps.owasp.models.chapter import Chapter
1515
from apps.owasp.models.committee import Committee
16-
from apps.owasp.models.event import Event
1716
from apps.owasp.models.project import Project
1817

1918
logger = logging.getLogger(__name__)
@@ -48,7 +47,6 @@ def handle(self, *_args, **options):
4847

4948
chapters = []
5049
committees = []
51-
events = []
5250
projects = []
5351

5452
offset = options["offset"]
@@ -84,17 +82,12 @@ def handle(self, *_args, **options):
8482
elif entity_key.startswith("www-project-"):
8583
projects.append(Project.update_data(gh_repository, repository, save=False))
8684

87-
# OWASP events.
88-
elif entity_key.startswith("www-event-"):
89-
events.append(Event.update_data(gh_repository, repository, save=False))
90-
9185
# OWASP committees.
9286
elif entity_key.startswith("www-committee-"):
9387
committees.append(Committee.update_data(gh_repository, repository, save=False))
9488

9589
Chapter.bulk_save(chapters)
9690
Committee.bulk_save(committees)
97-
Event.bulk_save(events)
9891
Project.bulk_save(projects)
9992

10093
# Check repository counts.

backend/apps/github/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_repository_path(url):
4646

4747

4848
def normalize_url(url, check_path=False):
49-
"""Normalize GitHub URL."""
49+
"""Normalize URL."""
5050
parsed_url = urlparse(url)
5151
if not parsed_url.netloc or (check_path and not parsed_url.path):
5252
return None

backend/apps/owasp/admin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from apps.owasp.models.committee import Committee
88
from apps.owasp.models.event import Event
99
from apps.owasp.models.project import Project
10+
from apps.owasp.models.project_health_metrics import ProjectHealthMetrics
11+
from apps.owasp.models.project_health_requirements import ProjectHealthRequirements
1012
from apps.owasp.models.snapshot import Snapshot
1113

1214

@@ -63,7 +65,6 @@ class CommitteeAdmin(admin.ModelAdmin):
6365

6466

6567
class EventAdmin(admin.ModelAdmin):
66-
autocomplete_fields = ("owasp_repository",)
6768
list_display = ("name",)
6869
search_fields = ("name",)
6970

@@ -141,4 +142,6 @@ class SnapshotAdmin(admin.ModelAdmin):
141142
admin.site.register(Committee, CommitteeAdmin)
142143
admin.site.register(Event, EventAdmin)
143144
admin.site.register(Project, ProjectAdmin)
145+
admin.site.register(ProjectHealthMetrics)
146+
admin.site.register(ProjectHealthRequirements)
144147
admin.site.register(Snapshot, SnapshotAdmin)

0 commit comments

Comments
 (0)