Skip to content

Conversation

@slugb0t
Copy link
Member

@slugb0t slugb0t commented May 27, 2025

Summary by Sourcery

Update and expand documentation: refine bot compliance tutorial, add a validator microservice guide, include a Zenodo sandbox tip, and surface the new validator docs in the sidebar.

Enhancements:

  • Clarify bot tutorial to append results to an object for issue rendering and add clickable compliance badges
  • Add 'Validation Feature' link under developer sidebar in site configuration

Documentation:

  • Introduce a new developer guide for adding custom validator endpoints to the microservice
  • Mention that the staging site uses the Zenodo Sandbox API for testing before live archiving

@fairdataihub-bot
Copy link

Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again!

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 27, 2025

Reviewer's Guide

This PR enriches the Codefair docs by refining the bot tutorial, adding a staging-site Zenodo Sandbox API tip, updating the sidebar navigation, and introducing a comprehensive Validator microservice guide.

Sequence diagram for JSON file validation via the Validator Microservice

sequenceDiagram
    participant Client
    participant ValidatorMicroservice as /validate-json
    participant ValidateJSON_Resource as ValidateJSON Resource
    participant JsonValidator_Instance as JsonValidator

    Client->>ValidatorMicroservice: POST /validate-json (file_path)
    ValidatorMicroservice->>ValidateJSON_Resource: Handle request(payload)
    ValidateJSON_Resource->>ValidateJSON_Resource: args = api.payload or {}
    ValidateJSON_Resource->>ValidateJSON_Resource: file_path = args.get('file_path')
    alt file_path provided and valid
        ValidateJSON_Resource->>ValidateJSON_Resource: Input validation (e.g., path traversal)
        ValidateJSON_Resource->>JsonValidator_Instance: new JsonValidator()
        ValidateJSON_Resource->>JsonValidator_Instance: validate(file_path)
        JsonValidator_Instance-->>ValidateJSON_Resource: result (valid, message)
        alt result.get('valid') is true
            ValidateJSON_Resource-->>ValidatorMicroservice: Response(200, {'message': 'valid', 'details': result['message']})
        else result.get('valid') is false
            ValidateJSON_Resource-->>ValidatorMicroservice: Response(400, {'message': 'invalid', 'error': result['message']})
        end
    else file_path not provided or invalid
        ValidateJSON_Resource-->>ValidatorMicroservice: Response(400, {'message': 'Validation Error', 'error': 'file_path is required or invalid'})
    end
    ValidatorMicroservice-->>Client: HTTP Response
Loading

Class diagram for the new Validator endpoint example

classDiagram
    class Resource {
        <<Flask-RESTX>>
        # Base class for API resources
    }
    class ValidateJSON {
        +post(self) : Response
    }
    class JsonValidator {
        +validate(file_path: str) : dict
    }

    Resource <|-- ValidateJSON
    ValidateJSON ..> JsonValidator : creates and uses
Loading

File-Level Changes

Change Details Files
Refine bot tutorial steps and note formatting
  • Described appending compliance results to an object for issue rendering instead of a string
  • Extended clickable badge overview for compliance checks
  • Switched note style to bulb emoji syntax
docs/dev/bot.md
Add staging site tip for Zenodo Sandbox API
  • Inserted a tip block pointing to the staging site using Zenodo’s Sandbox API
  • Clarified testing workflow before live archiving
docs/docs/archive.md
Update sidebar to include validator guide
  • Added 'Validation Feature' link under dev navigation
docs/.vitepress/config.js
Introduce new Validator microservice documentation
  • Created a full guide for registering validation routes
  • Outlined input sanitization and security best practices
  • Specified dependency updates and importing modules
  • Provided local testing steps using curl/Postman
docs/dev/validator.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@vercel
Copy link

vercel bot commented May 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
codefair-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2025 9:17pm

@fairdataihub-bot
Copy link

Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions!

@slugb0t slugb0t requested a review from Copilot May 27, 2025 21:12
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @slugb0t - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines 3 to 8
title: Running Locally
description: Runnning the Codefair GitHub repository locally
head:
- - meta
- name: og:image
content: https://kalai.fairdataihub.org/api/generate?title=Codefair%20Documentation&description=Running%20the%20GitHub%20Repository&app=codefair&org=fairdataihub
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Frontmatter metadata mismatch with page content.

Update the frontmatter fields to match the actual page content about adding a validation endpoint.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances developer documentation by introducing a new validator guide, refining the bot tutorial, surfacing the validator docs in the sidebar, and mentioning the Zenodo sandbox on the staging site.

  • Add a tip about using the Zenodo Sandbox API on the staging site
  • Create a dedicated guide for adding validation endpoints to the microservice
  • Refine the bot tutorial to append results to an object and generate clickable badges
  • Update the sidebar to include the new Validation Feature link

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
docs/docs/archive.md Added a tip about the Zenodo Sandbox API usage on the staging site
docs/dev/validator.md Introduced a guide for adding validation endpoints to the microservice
docs/dev/bot.md Refined bot tutorial wording to append results to an object and badge usage
docs/.vitepress/config.js Surfaced the validator docs link under the developer sidebar
Comments suppressed due to low confidence (2)

docs/dev/validator.md:4

  • Frontmatter 'description' has a spelling error: 'Runnning' should be 'Running'.
description: Runnning the Codefair GitHub repository locally

docs/dev/validator.md:3

  • Frontmatter title and description don't match the guide content about adding a validation endpoint. Consider updating them to reflect endpoint integration.
title: Running Locally

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@slugb0t slugb0t merged commit 33a5084 into main May 27, 2025
2 of 3 checks passed
@fairdataihub-bot
Copy link

Thanks for closing this pull request! If you have any further questions, please feel free to open a new issue. We are always happy to help!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants