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

chore(package): Fixed tests and did housekeeping #544

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

rajdip-b
Copy link
Member

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

User description

Description

  • Fixed broken tests in api-client
  • Organized imports and renamed files in schema
  • Updated import in package.json

PR Type

enhancement, tests


Description

  • Corrected API endpoint paths in UserController by removing leading dots.
  • Refactored tests in user.spec.ts and workspace-membership.spec.ts to improve accuracy and remove redundancy.
  • Added new schemas for handling OTP requests and responses in the auth module.
  • Simplified import and export paths across various schema files for better organization.
  • Updated package.json and pnpm-lock.yaml to reflect new dependencies and workspace links.

Changes walkthrough 📝

Relevant files
Bug fix
1 files
user.ts
Fix API endpoint paths in UserController                                 

packages/api-client/src/controllers/user.ts

  • Corrected API endpoint paths by removing leading dots.
+3/-3     
Tests
2 files
user.spec.ts
Refactor User Controller tests                                                     

packages/api-client/tests/user.spec.ts

  • Removed redundant test assertions.
  • Corrected test for updating current user.
  • +1/-16   
    workspace-membership.spec.ts
    Update Workspace Membership Controller tests                         

    packages/api-client/tests/workspace-membership.spec.ts

  • Updated test user email.
  • Corrected assertion for checking user membership.
  • +2/-2     
    Enhancement
    12 files
    index.ts
    Add Resend OTP schemas                                                                     

    packages/schema/src/auth/index.ts

    • Added schemas for ResendOTPRequest and ResendOTPResponse.
    +8/-1     
    index.types.ts
    Update auth schema import paths                                                   

    packages/schema/src/auth/index.types.ts

    • Updated import paths for auth schemas.
    +1/-1     
    index.ts
    Update pagination schema import paths                                       

    packages/schema/src/environment/index.ts

    • Updated import paths for pagination schemas.
    +1/-1     
    index.ts
    Simplify schema export paths                                                         

    packages/schema/src/index.ts

    • Simplified export paths for schemas.
    +3/-8     
    index.types.ts
    Simplify type export paths                                                             

    packages/schema/src/index.types.ts

    • Simplified export paths for types.
    +7/-16   
    index.ts
    Add pagination and response schemas                                           

    packages/schema/src/pagination/index.ts

    • Added pagination and response schemas.
    +47/-1   
    index.types.ts
    Update pagination schema import paths                                       

    packages/schema/src/pagination/index.types.ts

    • Updated import paths for pagination schemas.
    +1/-1     
    index.ts
    Update pagination schema import paths                                       

    packages/schema/src/project/index.ts

    • Updated import paths for pagination schemas.
    +1/-1     
    index.ts
    Update pagination schema import paths                                       

    packages/schema/src/secret/index.ts

    • Updated import paths for pagination schemas.
    +1/-1     
    index.ts
    Update workspace schema import paths                                         

    packages/schema/src/user/index.ts

    • Updated import paths for workspace schemas.
    +1/-1     
    index.ts
    Reorganize workspace schemas                                                         

    packages/schema/src/workspace/index.ts

    • Moved InviteMemberSchema to a more appropriate location.
    +6/-7     
    index.types.ts
    Update workspace schema import paths                                         

    packages/schema/src/workspace/index.types.ts

    • Updated import paths for workspace schemas.
    +1/-1     

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

    Copy link
    Contributor

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

    CI Failure Feedback 🧐

    (Checks updated until commit 33e8464)

    Action: Validate PR title

    Failed stage: Lint PR [❌]

    Failure summary:

    The action failed because the pull request title did not conform to the expected semantic format.

  • The title "package: Fixed tests and did housekeeping" contains an unknown release type "package".

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    35:  Download action repository 'amannn/action-semantic-pull-request@v5' (SHA:0723387faaf9b38adef4775cd42cfd5155ed6017)
    36:  Complete job name: Validate PR title
    37:  ##[group]Run amannn/action-semantic-pull-request@v5
    38:  with:
    39:  githubBaseUrl: https://api.github.com
    40:  env:
    41:  GITHUB_TOKEN: ***
    42:  ##[endgroup]
    43:  ##[error]Unknown release type "package" found in pull request title "package: Fixed tests and did housekeeping". 
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

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

    API Path Change
    Verify that removing leading dots from API paths doesn't break existing integrations and that all endpoints are properly configured

    Test Coverage
    Validate that removing test assertions for defaultWorkspace and email doesn't leave important functionality untested

    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @rajdip-b rajdip-b changed the title package: Fixed tests and did housekeeping chore(package): Fixed tests and did housekeeping Nov 18, 2024
    Copy link

    codecov bot commented Nov 18, 2024

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    Project coverage is 100.00%. Comparing base (ce50743) to head (33e8464).
    Report is 221 commits behind head on develop.

    Additional details and impacted files
    @@             Coverage Diff              @@
    ##           develop      #544      +/-   ##
    ============================================
    + Coverage    91.71%   100.00%   +8.28%     
    ============================================
      Files          111        12      -99     
      Lines         2510       120    -2390     
      Branches       469         3     -466     
    ============================================
    - Hits          2302       120    -2182     
    + Misses         208         0     -208     
    Flag Coverage Δ
    api-e2e-tests ?
    schema 100.00% <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.


    🚨 Try these New Features:

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