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

docs: Migrate to Bruno #525

Merged
merged 2 commits into from
Nov 10, 2024
Merged

docs: Migrate to Bruno #525

merged 2 commits into from
Nov 10, 2024

Conversation

rajdip-b
Copy link
Member

@rajdip-b rajdip-b commented Nov 10, 2024

User description

Driving force behind the change

Since we are an open-source project, we believe that we should be using the help of open-source tools wherever we can. Postman (tool that we were using till date) is of course a very good tool, but Bruno matches our requirements better.

Changes made

  • Collections now added to VCS
  • Docs updated to reflect the changes

PR Type

documentation, enhancement


Description

  • Migrated API testing documentation from Postman to Bruno, updating instructions and references.
  • Added multiple new endpoints in the Bruno API collection for various controllers, including API Key, Auth, Environment, and more.
  • Removed unused imports and variables in TypeScript files to improve code quality and maintainability.
  • Reformatted JSX in the Hero component for better readability and consistency.
  • Updated package-lock.json to include the zod dependency.

Changes walkthrough 📝

Relevant files
Enhancement
3 files
app.module.ts
Remove unused imports in app module                                           

apps/api/src/app/app.module.ts

  • Removed unused import ThrottlerGuard and ThrottlerModule.
  • Cleaned up imports for better organization.
  • +1/-2     
    minio.provider.ts
    Add ESLint directive for unused variables                               

    apps/api/src/provider/minio.provider.ts

  • Added ESLint directive to ignore unused variables.
  • Improved code quality by addressing linting issues.
  • +3/-0     
    index.tsx
    Reformat JSX for better readability                                           

    apps/web/src/components/hero/index.tsx

  • Reformatted JSX for better readability.
  • Improved code formatting for consistency.
  • +7/-7     
    Tests
    1 files
    workspace.e2e.spec.ts
    Remove unused test variables                                                         

    apps/api/src/workspace/workspace.e2e.spec.ts

  • Removed unused variable user3.
  • Cleaned up test setup by removing unnecessary user creation.
  • +1/-2     
    Documentation
    3 files
    Can access live updates.bru
    Add endpoint for live update access check                               

    api-collection/Api Key Controller/Can access live updates.bru

  • Added new endpoint for checking live update access.
  • Documented required authorities for access.
  • +36/-0   
    Create API key.bru
    Add endpoint for API key creation                                               

    api-collection/Api Key Controller/Create API key.bru

  • Added endpoint for creating API keys.
  • Documented request body and parameters.
  • +43/-0   
    api-testing.md
    Update API testing documentation to use Bruno                       

    docs/contributing-to-keyshade/running-things-locally/api-testing.md

  • Updated documentation to reflect migration from Postman to Bruno.
  • Provided instructions for using Bruno for API testing.
  • +11/-5   
    Configuration changes
    1 files
    package.json
    Remove Postman configuration from package.json                     

    package.json

  • Removed Postman-related configuration.
  • Cleaned up package configuration.
  • +0/-4     
    Dependencies
    1 files
    package-lock.json
    Add zod dependency to package-lock                                             

    packages/schema/package-lock.json

  • Added zod dependency to package-lock.
  • Updated package-lock to reflect new dependencies.
  • +12/-1   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Unused Parameters
    The functions uploadFile, getFileUrl, and deleteFile have parameters marked as unused with eslint-disable comments. Consider removing unused parameters or documenting why they are needed.

    Code Duplication
    Similar toast notification div structure is duplicated. Consider extracting the common toast notification UI into a reusable component.

    Copy link

    codecov bot commented Nov 10, 2024

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    Project coverage is 87.92%. Comparing base (ce50743) to head (90c11c7).
    Report is 214 commits behind head on develop.

    Additional details and impacted files
    @@             Coverage Diff             @@
    ##           develop     #525      +/-   ##
    ===========================================
    - Coverage    91.71%   87.92%   -3.80%     
    ===========================================
      Files          111      115       +4     
      Lines         2510     2807     +297     
      Branches       469      417      -52     
    ===========================================
    + Hits          2302     2468     +166     
    - Misses         208      339     +131     
    Flag Coverage Δ
    api-e2e-tests 87.64% <100.00%> (-4.08%) ⬇️
    schema 100.00% <ø> (?)

    Flags with carried forward coverage won't be shown. Click here to find out more.

    ☔ View full report in Codecov by Sentry.
    📢 Have feedback on the report? Share it here.

    Copy link
    Contributor

    codiumai-pr-agent-free bot commented Nov 10, 2024

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible bug
    Add error handling for JSON parsing to prevent potential runtime errors

    Add error type checking and handling for the JSON.parse() call to prevent runtime
    errors if localStorage contains invalid JSON data.

    apps/web/src/components/hero/index.tsx [31-33]

     const emailsInWaitlist: string[] = dataInStorage
    -  ? (JSON.parse(dataInStorage) as string[])
    +  ? (try { JSON.parse(dataInStorage) as string[] } catch { [] })
       : []
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion addresses a potential runtime error by adding try-catch error handling for JSON.parse(), which could prevent application crashes if localStorage contains invalid data.

    7
    Typo
    ✅ Fix typo in collection name to improve clarity and maintain consistency
    Suggestion Impact:The typo in the collection name was corrected from "Api Kei Controller" to "Api Key Controller" as suggested.

    code diff:

    -  "name": "Api Kei Controller",
    +  "name": "Api Key Controller",

    Fix the typo in the collection name from "Api Kei Controller" to "Api Key
    Controller" to maintain consistency with the folder name and improve clarity.

    api-collection/Api Key Controller/bruno.json [3]

     {
    -  "version": "1",
    -  "name": "Api Kei Controller",
    +  "version": "1", 
    +  "name": "Api Key Controller",
       "type": "collection",
       "ignore": [
         "node_modules",
         ".git"
       ]
     }
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Fixing the typo from "Api Kei Controller" to "Api Key Controller" improves clarity and maintains consistency with the folder name and overall API documentation structure.

    7
    Enhancement
    Include example values for required path parameters to improve API documentation

    Add a default or example value for the empty project_slug parameter to improve API
    documentation and testing.

    api-collection/Environment Controller/Get all environments of project.bru [14]

     params:path {
    -  project_slug: 
    +  project_slug: example-project-123
     }
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Adding example values for path parameters improves API documentation clarity and makes testing easier by providing a reference format.

    6
    Maintainability
    Extract duplicate CSS classes into a reusable class to improve maintainability and reduce code duplication

    Move the duplicate toast notification div styling into a reusable CSS class to avoid
    code duplication and maintain consistent styling.

    apps/web/src/components/hero/index.tsx [23]

    -<div className="text-brandBlue border-brandBlue/20 bg-errorRed w-[90vw] rounded-lg border p-2 shadow-2xl backdrop-blur-3xl md:w-[20vw]">
    +<div className="toast-notification">
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: The suggestion correctly identifies duplicate CSS classes used in multiple toast notifications and proposes a valid solution to improve code maintainability through CSS class extraction.

    5
    Best practice
    Standardize documentation format to maintain consistency across API endpoints

    Add proper markdown formatting for the description section to maintain consistency
    with other API documentation.

    api-collection/Variable Controller/Delete variable.bru [21-23]

     docs {
    +  ## Description
    +  
       Delete a variable by its ID
     }
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: Adding proper markdown formatting to the documentation section helps maintain consistency with other API endpoints and improves readability.

    5

    💡 Need additional feedback ? start a PR chat

    @rajdip-b rajdip-b merged commit 1793d92 into develop Nov 10, 2024
    5 of 6 checks passed
    @rajdip-b rajdip-b deleted the chore/api-docs branch November 10, 2024 16:35
    rajdip-b pushed a commit that referenced this pull request Dec 3, 2024
    ## [2.8.0](v2.7.0...v2.8.0) (2024-12-03)
    
    ### 🚀 Features
    
    * **api:** Add workspace removal notification email template ([#476](#476)) ([40b754f](40b754f))
    * **cli:** Store `metrics_enabled` key in profile config ([#536](#536)) ([9283b22](9283b22))
    * **package, api, cli:** Add api-key schemas and types; Fix schema inconsistencies; Minor fix for CLI build errors  ([#557](#557)) ([126d024](126d024))
    * **platform:** Added screen for CREATE NEW PROJECT ([#540](#540)) ([b644633](b644633))
    * **platform:** Updated the empty state of dashboard ([#522](#522)) ([28739d9](28739d9))
    * **schema, api-client:** Migrate auth types to @keyshade/schema ([#532](#532)) ([d880098](d880098))
    * **schema, api-client:** Migrate event schemas and types to @keyshade/schema ([#546](#546)) ([a3267de](a3267de))
    * **schema, api-client:** Migrate integration schemas and types to @keyshade/schema ([#547](#547)) ([08868c3](08868c3))
    * **schema, api-client:** Migrate project schemas and environment schemas along with their types to @keyshade/schema ([#538](#538)) ([c468af0](c468af0))
    * **schema, api-client:** Migrate [secure] types and schemas to @keyshade/schema ([#539](#539)) ([bc3100b](bc3100b))
    * **schema, api-client:** Migrate user types and schemas to @keyshade/schema ([#535](#535)) ([c24695e](c24695e))
    * **schema, api-client:** Migrate variable schemas and types to @keyshade/schema ([#545](#545)) ([0ee8f9a](0ee8f9a))
    * **schema, api-client:** Migrate workspace-membership schemas and types to @keyshade/schema ([#569](#569)) ([4398969](4398969))
    * **schema, api-client:** Migrate workspace-role schemas and types to @keyshade/schema ([#568](#568)) ([9efbf2d](9efbf2d))
    * **schema:** Add User type inference from UserSchema ([#574](#574)) ([84c1db5](84c1db5))
    
    ### 🐛 Bug Fixes
    
    * **api:** Incorrect oauth redirect url ([58d96e5](58d96e5))
    * **platform:** Resolve loading SVG blocking input field interaction ([#571](#571)) ([30f4f65](30f4f65))
    
    ### 📚 Documentation
    
    * Add pictures to Bruno setup ([#541](#541)) ([210c0fd](210c0fd))
    * Migrate to Bruno ([#525](#525)) ([1793d92](1793d92))
    
    ### 🔧 Miscellaneous Chores
    
    * **ci:** Add script to validate schema package ([59e4280](59e4280))
    * Fixed codecov client version ([a998ae4](a998ae4))
    * **package:** Fixed tests and did housekeeping ([#544](#544)) ([40008e3](40008e3))
    * Update test coverage settings ([5b27e32](5b27e32))
    * Update Turbo to 2.3.1 ([#564](#564)) ([3a63823](3a63823))
    * **web:** Update dockerfile ([10d9cc5](10d9cc5))
    
    ### 🔨 Code Refactoring
    
    * **api-client, schema:** Add workspace's schemas and types in @keyshade/schema ([#520](#520)) ([7c8ee5d](7c8ee5d))
    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.

    1 participant