Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
25 changes: 7 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,28 +223,16 @@ Follow these steps to set up the OWASP Nest application:

1. **Create Environment Files**:

- Create a local environment file in the `backend` directory:
- Copy the contents from the template file into your new backend local environment file:

```bash
touch backend/.env
cp backend/.env.example backend/.env
```

- Copy the contents from the template file into your new local environment file:
- Copy the contents from the template file into your new frontend local environment file:

```bash
cat backend/.env.example > backend/.env
```

- Create a local environment file in the `frontend` directory:

```bash
touch frontend/.env
```

- Copy the contents from the template file into your new local environment file:

```bash
cat frontend/.env.example > frontend/.env
cp frontend/.env.example frontend/.env
```

Ensure that all `.env` files are saved in **UTF-8 format without BOM (Byte Order Mark)**. This is crucial to prevent "Unexpected character" errors during application execution or Docker image building.
Expand All @@ -262,15 +250,16 @@ Ensure that all `.env` files are saved in **UTF-8 format without BOM (Byte Order
1. **Set Up Algolia**:

- Go to [Algolia](https://www.algolia.com/) and create a free account.
- After creating an account, create an Algolia app.
- An Algolia app is automatically created for you when you sign up.
- During the sign up process, you may be asked to import data. You can skip this step.
Comment on lines +253 to +254
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, find the CONTRIBUTING.md file
git ls-files | grep -i "contributing.md"

Repository: OWASP/Nest

Length of output: 90


🏁 Script executed:

# Read lines 253-254 from CONTRIBUTING.md
sed -n '250,260p' CONTRIBUTING.md | cat -n

Repository: OWASP/Nest

Length of output: 659


🌐 Web query:

hyphenation rules "sign up" vs "sign-up" adjective English grammar

💡 Result:

Short answer

  • Use sign up (two words) for the verb: "Please sign up for the class." [1][2]
  • Use sign-up (hyphen) or signup (one word, per some dictionaries) for the noun or an attributive adjective: "The sign-up sheet" / "the signup form." Style guides differ, so follow your house style. [1][2][3][4]

Sources

  • U.S. web style guide (HRSA): verb = "sign up"; noun/adjective = "sign‑up." [1]
  • Merriam‑Webster (dictionary): lists sign up (verb) and sign‑up (noun/adjective); also recognizes signup. [2]
  • GSA style guidance & Dictionary.com: similar notes on usage and forms. [3][4]

Fix hyphenation in Algolia setup narrative.

Line 254 contains a grammar issue: "sign up process" should be "sign-up process" when used as an adjective. Standard English conventions (Merriam-Webster, GSA style guide) require hyphenation for the attributive form, matching the style used in technical documentation.

🔎 Proposed grammar fix
- - During the sign up process, you may be asked to import data. You can skip this step.
+ - During the sign-up process, you may be asked to import data. You can skip this step.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- An Algolia app is automatically created for you when you sign up.
- During the sign up process, you may be asked to import data. You can skip this step.
- An Algolia app is automatically created for you when you sign up.
- During the sign-up process, you may be asked to import data. You can skip this step.
🧰 Tools
🪛 LanguageTool

[grammar] ~254-~254: Use a hyphen to join words.
Context: ...u when you sign up. - During the sign up process, you may be asked to import d...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
In CONTRIBUTING.md around lines 253 to 254, the phrase "sign up process" is used
attributively and should be hyphenated; change "sign up process" to "sign-up
process" (both occurrences in those lines) to follow standard English
hyphenation for compound modifiers.

- Update your `backend/.env` file with the following keys from your Algolia app (use **write** API key for backend):

```plaintext
DJANGO_ALGOLIA_APPLICATION_ID=<your-algolia-application-id>
DJANGO_ALGOLIA_WRITE_API_KEY=<your-algolia-write-api-key>
```

- Ensure that your API key has index write permissions. You can ignore any onboarding wizard instructions provided by Algolia.
- Note: The default write API key should have index write permissions (addObject permission). If you do not use the default write API key, ensure that your API key has this permission.
- If you encounter any issues, you can refer directly to Algolia's [documentation](https://www.algolia.com/doc/guides/getting-started/quick-start/)

1. **Run the Application**:
Expand Down
14 changes: 8 additions & 6 deletions backend/apps/api/rest/v0/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from apps.owasp.models.project import Project as ProjectModel
from apps.owasp.models.snapshot import Snapshot as SnapshotModel

ORDERING_FIELD_DESCRIPTION = "Ordering field"

Comment on lines +26 to +27
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Good DRY refactoring!

Extracting the repeated "Ordering field" description into a constant improves maintainability and ensures consistency across all endpoints.

🤖 Prompt for AI Agents
In backend/apps/api/rest/v0/snapshot.py around lines 26-27 you added
ORDERING_FIELD_DESCRIPTION = "Ordering field"; ensure this DRY refactor is
applied consistently by replacing any repeated literal "Ordering field"
occurrences in this file (and related modules if present) with the new constant,
and export or import the constant where other modules need it so all endpoints
reference ORDERING_FIELD_DESCRIPTION instead of hard-coded strings.

router = RouterPaginated(tags=["Community"])


Expand Down Expand Up @@ -114,7 +116,7 @@ def list_snapshots(
]
| None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[Snapshot]:
"""Get all snapshots."""
Expand Down Expand Up @@ -160,7 +162,7 @@ def list_snapshot_chapters(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "updated_at", "-updated_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[Chapter]:
"""Get new chapters in snapshot."""
Expand All @@ -185,7 +187,7 @@ def list_snapshot_issues(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "updated_at", "-updated_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[SnapshotIssue]:
"""Get new issues in snapshot."""
Expand All @@ -212,7 +214,7 @@ def list_snapshot_members(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "updated_at", "-updated_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[Member]:
"""Get new members in snapshot."""
Expand All @@ -237,7 +239,7 @@ def list_snapshot_projects(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "updated_at", "-updated_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[Project]:
"""Get new projects in snapshot."""
Expand All @@ -262,7 +264,7 @@ def list_snapshot_releases(
snapshot_id: str = Path(example="2025-02"),
ordering: Literal["created_at", "-created_at", "published_at", "-published_at"] | None = Query(
None,
description="Ordering field",
description=ORDERING_FIELD_DESCRIPTION,
),
) -> list[SnapshotRelease]:
"""Get new releases in snapshot."""
Expand Down
2 changes: 1 addition & 1 deletion backend/apps/owasp/models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def get_metadata(self):
"""Get entity metadata."""
try:
yaml_content = re.search(
r"^---\s*([\s\S]*?)\s*---",
r"^---\s*(.*?)\s*---",
get_repository_file_content(self.index_md_url),
re.DOTALL,
)
Expand Down
Loading
Loading