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

Add mailing list to chapter schema #842 #967

Closed
wants to merge 11 commits into from

Conversation

Bishoywadea
Copy link

@Bishoywadea Bishoywadea commented Mar 1, 2025

Resolves #842

Summary by CodeRabbit

  • New Features

    • Introduced an optional mailing list field to enhance chapter details with URI-formatted entries.
  • Tests

    • Expanded validation coverage with additional test cases to verify proper handling of empty, invalid, and null mailing list values.

@Bishoywadea Bishoywadea requested a review from arkid15r as a code owner March 1, 2025 08:39
Copy link

coderabbitai bot commented Mar 1, 2025

Walkthrough

A new optional property, "mailing_list", has been added to the schema/chapter.json file. This property is defined as a string that must follow the URI format. New test cases have been introduced in schema/tests/chapter_test.py along with accompanying YAML files to explicitly validate scenarios when the mailing list value is empty, invalid, or null. The update enhances the schema's capabilities and testing coverage without modifying any existing property behavior.

Changes

File(s) Change Summary
schema/chapter.json Added optional "mailing_list" property with URI format and descriptive text to the chapter JSON schema.
schema/tests/chapter_test.py Introduced three new test cases for validating the "mailing_list" property for empty, invalid, and null values.
schema/tests/data/chapter/negative/mailing-list-empty.yaml, .../mailing-list-invalid.yaml, .../mailing-list-null.yaml Created new YAML test files defining negative cases for the "mailing_list" property with various invalid inputs.

Sequence Diagram(s)

sequenceDiagram
    participant T as Test Runner
    participant V as Schema Validator
    participant D as Test Data Loader

    T->>D: Load YAML test case (empty/invalid/null)
    D-->>T: Provide test data
    T->>V: Validate chapter schema with mailing_list value
    V-->>T: Return validation result (error message if not a valid URI)
Loading

Poem

I'm just a little rabbit, hopping through the code,
With schema updates and tests in a merry, playful mode.
Mailing lists checked, and URIs in a row,
Negative cases proving every bug must go!
Hip-hip, hooray for changes—off we go!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee16cd1 and e4ac8c6.

📒 Files selected for processing (3)
  • schema/tests/data/chapter/negative/mailing-list-empty.yaml (1 hunks)
  • schema/tests/data/chapter/negative/mailing-list-invalid.yaml (1 hunks)
  • schema/tests/data/chapter/negative/mailing-list-null.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • schema/tests/data/chapter/negative/mailing-list-null.yaml
  • schema/tests/data/chapter/negative/mailing-list-invalid.yaml
  • schema/tests/data/chapter/negative/mailing-list-empty.yaml

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 126b0b1 and d0c627a.

📒 Files selected for processing (5)
  • schema/chapter.json (1 hunks)
  • schema/tests/chapter_test.py (1 hunks)
  • schema/tests/data/chapter/negative/mailing-list-empty.yaml (1 hunks)
  • schema/tests/data/chapter/negative/mailing-list-invalid.yaml (1 hunks)
  • schema/tests/data/chapter/negative/mailing-list-null.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • schema/tests/data/chapter/negative/mailing-list-empty.yaml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
schema/tests/data/chapter/negative/mailing-list-invalid.yaml

[error] 15-15: no new line character at the end of file

(new-line-at-end-of-file)

schema/tests/data/chapter/negative/mailing-list-null.yaml

[error] 15-15: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (2)
schema/chapter.json (1)

60-64: Property addition looks good!

The mailing-list property has been added with appropriate format and description. The implementation follows the same pattern as other URI-formatted properties in the schema.

schema/tests/chapter_test.py (1)

55-57: Test cases look good!

The added test cases properly validate the mailing-list property for different invalid scenarios (empty string, invalid URI, and null value). These tests align well with the existing test patterns.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
schema/tests/data/chapter/negative/mailing-list-null.yaml (1)

15-15: Add a newline at the end of the file.
YAMLlint flagged the absence of a newline at the end. Please append a newline to ensure compliance with formatting standards.

-type: code
+type: code
+
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 15-15: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0c627a and a13916e.

📒 Files selected for processing (1)
  • schema/tests/data/chapter/negative/mailing-list-null.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
schema/tests/data/chapter/negative/mailing-list-null.yaml

[error] 15-15: no new line character at the end of file

(new-line-at-end-of-file)

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.

Please follow https://github.com/OWASP/Nest/blob/main/CONTRIBUTING.md and test your code before requesting the review.

Copy link

sonarqubecloud bot commented Mar 2, 2025

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.

I'm kindly asking again to run your tests locally first -- https://github.com/OWASP/Nest/actions/runs/13610987050/job/38048118221?pr=967

@Bishoywadea Bishoywadea closed this Mar 2, 2025
@Bishoywadea
Copy link
Author

I have closed it for now because it runs the ci automatic after each update in your main i haven't pushed an update on my branch

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 mailing list to chapter schema
2 participants