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

Helper party status events #47

Merged
merged 25 commits into from
Jun 20, 2024
Merged

Helper party status events #47

merged 25 commits into from
Jun 20, 2024

Conversation

eriktaubeneck
Copy link
Member

@eriktaubeneck eriktaubeneck commented Jun 17, 2024

This adds an API route for helper parties to post their status to, as it changes, and a test to validate that it works. It also includes an API key, so that the management layer can validate the status update from the helper party is valid.

Next steps for queuing:

  1. Have the helper parties POST to the endpoint when their status changes.
  2. Have the management layer start queries server side, and start the next in the queue when the current one finishes.

Note: In the long run, we've undecided where this state should live, and which direction information should flow. Regardless, this will likely require self deploying the management layer. We'll need to do this in the next few months, but until we agree on a more robust design doc, this way will work.

Summary by CodeRabbit

  • New Features

    • Introduced API endpoint to update the status of a query for helper parties.
    • Added integration tests for POST updateStatus API route.
    • Implemented API key validation for helper parties.
    • Added database table and security policies for helper_party_query_status_updates.
  • Bug Fixes

    • Updated supabase/seed.sql to correctly hash API keys.
  • Chores

    • Updated package dependencies and configurations for testing and Babel.
    • Configured pre-commit hooks and GitHub workflows for Supabase integration.

@eriktaubeneck eriktaubeneck requested a review from akoshelev June 17, 2024 21:38
Copy link

vercel bot commented Jun 17, 2024

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

Name Status Preview Comments Updated (UTC)
draft ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2024 10:24pm

Copy link
Contributor

coderabbitai bot commented Jun 17, 2024

Important

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (1)
  • server/package-lock.json is excluded by !**/package-lock.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces a variety of enhancements and new functionalities to the server project, particularly focusing on implementing Jest tests, improving Supabase integration, and managing new API endpoints and database utilities. Key developments include Jest configuration, API key validation, status updates via new endpoints, and related SQL migrations and seed updates. The updates facilitate better testing and maintainability for the server codebase.

Changes

File(s) Change Summary
.pre-commit-config.yaml Added Jest tests configuration block for files in the server/ directory.
server/.prettierignore Added coverage/* and babel.config.js to the ignored files list for Prettier formatting.
server/__tests__/api_update_query_status_route.test.tsx Added integration tests for the POST updateStatus API route, including status updates in the database.
server/app/api/update_query_status/route.ts Introduced the update_query_status API route for handling POST requests to update query statuses.
server/babel.config.js Configured Babel for server-side, specifying presets for @babel/preset-env and @babel/preset-typescript.
server/data/helper_party_api_key.ts Added a function to validate API keys for the helper party, comparing them with stored hashed keys.
server/data/helper_party_query_status.ts Added a function to update query status using the Supabase service client.
server/data/query.ts Updated functions to use buildSupabaseServerClient() for creating Supabase client instead of creating supabase directly.
server/data/supabaseTypes.ts Added a new helper_party_query_status_updates entity to the Database type with specific structures and relationships.
server/data/supabase_server_client.ts Introduced a function buildSupabaseServerClient for server-side rendering using Next.js headers and cookies for authentication.
server/data/supabase_server_service_client.ts Introduced the createSupabaseServiceClient function to create a Supabase client with provided URL and service role key.
server/jest.config.ts Added Jest configuration settings for testing.
server/next.config.js Added forceSwcTransforms: true under the experimental property of nextConfig object for improved transformations.
server/package.json Updated dependencies and test scripts, including packages for testing (jest, @testing-library, etc.), environment management (dotenv), and other utilities (bcrypt, ts-node).
server/supabase/migrations/20240609000051_helper_party_status_updates.sql Created table helper_party_query_status_updates with columns and constraints, added row level security, and defined policies for operations on this table.
server/supabase/seed.sql Updated hashed_api_key values in public.helper_party_api_keys and added a new entry to public.queries.
.github/workflows/pre-commit.yaml Introduced environment variables, set up Supabase CLI, and added steps to initialize, start, and check the status of the Supabase database.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Server
  participant Database
  participant Supabase

  Client->>Server: POST /api/update_query_status
  Server->>Server: Validate API Key
  Server->>Supabase: Create Supabase Service Client
  Server->>Database: Update Status
  Database-->>Server: Status Update Confirmation
  Server-->>Client: Status Updated Response
Loading

Poem

In code and keys where data thrives,
A rabbit hops, the server arrives.
With Jest in hand, it tests with zeal,
The database hums — responses real.
Through Supabase, the status shifts,
A dev's delight, as features lift. 🌟🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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
Contributor

@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: 4

Outside diff range and nitpick comments (2)
server/data/query.ts (1)

Line range hint 51-53: Consider removing the else clause as it is redundant after the previous branches that break early.

- else {
-   return { isValid: false, error: Error("API key invalid.") };
- }
server/__tests__/api_update_query_status_route.test.tsx (1)

22-64: The test case for updating the status in the database is well-structured. However, consider adding more assertions to verify the complete state of the database after the update.

Consider verifying additional fields related to the status update to ensure comprehensive testing.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 46142c8 and 269820e.

Files ignored due to path filters (1)
  • server/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (16)
  • .pre-commit-config.yaml (1 hunks)
  • server/.prettierignore (1 hunks)
  • server/tests/api_update_query_status_route.test.tsx (1 hunks)
  • server/app/api/update_query_status/route.ts (1 hunks)
  • server/babel.config.js (1 hunks)
  • server/data/helper_party_api_key.ts (1 hunks)
  • server/data/helper_party_query_status.ts (1 hunks)
  • server/data/query.ts (3 hunks)
  • server/data/supabaseTypes.ts (1 hunks)
  • server/data/supabase_server_client.ts (1 hunks)
  • server/data/supabase_server_service_client.ts (1 hunks)
  • server/jest.config.ts (1 hunks)
  • server/next.config.js (1 hunks)
  • server/package.json (2 hunks)
  • server/supabase/migrations/20240609000051_helper_party_status_updates.sql (1 hunks)
  • server/supabase/seed.sql (2 hunks)
Files skipped from review due to trivial changes (4)
  • .pre-commit-config.yaml
  • server/.prettierignore
  • server/babel.config.js
  • server/next.config.js
Additional context used
Biome
server/data/query.ts

[error] 51-53: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)

Unsafe fix: Omit the else clause.

Additional comments not posted (14)
server/data/supabase_server_client.ts (1)

8-25: Ensure secure handling of cookies, especially in production environments.

server/package.json (3)

9-11: Ensure that running Jest tests in band (--runInBand) does not cause performance issues during CI/CD processes.


Line range hint 19-30: The addition of bcrypt and ts-node aligns with the security and development requirements of the project. Ensure that all newly added dependencies are used appropriately and do not introduce any security vulnerabilities.


33-47: The updates to Babel and Jest configurations are crucial for supporting TypeScript and improving test environments. Double-check that these configurations do not conflict with existing setups.

Verification successful

The provided babel.config.js and jest.config.ts files do not show any immediate conflicts with the updated Babel and Jest dependencies specified in package.json. The Babel configuration correctly uses @babel/preset-env and @babel/preset-typescript, which align with the updated versions. Similarly, the Jest configuration appears to be well-structured and does not indicate any conflicts with the new Jest dependencies.

  • babel.config.js:

    • Uses @babel/preset-env and @babel/preset-typescript, which are updated in package.json.
  • jest.config.ts:

    • Contains a comprehensive Jest configuration that does not conflict with the updated Jest dependencies.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the new Babel and Jest configurations for conflicts.

# Test: Check for conflicts in `.babelrc` and `jest.config.js`.
cat .babelrc
cat jest.config.js

Length of output: 123



Script:

#!/bin/bash
# Search for Babel configuration files or settings
fd -e js -e json -e ts -e cjs -e mjs -e json5 -e yml -e yaml -e toml -e babelrc babel
# Search for Jest configuration files or settings
fd -e js -e json -e ts -e cjs -e mjs -e json5 -e yml -e yaml -e toml jest
# Search for Babel and Jest configurations within package.json
jq '.babel, .jest' package.json

Length of output: 313



Script:

#!/bin/bash
# Display the contents of babel.config.js
cat server/babel.config.js
# Display the contents of jest.config.ts
cat server/jest.config.ts

Length of output: 6950

server/app/api/update_query_status/route.ts (1)

8-50: The POST function properly handles request validation, API key validation, and status updates. Ensure that error messages and HTTP status codes are aligned with the API's design principles. Consider adding more specific logging for debugging purposes.

Verification successful

The implementations of validateApiKey and updateStatusFunction have been successfully retrieved. Both functions handle errors and return appropriate messages:

  • validateApiKey logs an error and returns an object with isValid: false and the error message.
  • updateStatusFunction returns the PostgrestError directly if an error occurs.

The POST function in route.ts correctly handles these responses by returning appropriate HTTP status codes and error messages. The error handling is consistent with the API's design principles.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the alignment of error messages and HTTP status codes.

# Test: Check for consistency in error messages and HTTP status codes in the API documentation.
cat docs/api.md | grep -E 'error|status'

Length of output: 86



Script:

#!/bin/bash
# Search for the definition of the `validateApiKey` function
ast-grep --lang typescript --pattern 'function validateApiKey($_$) { $$$ }'

# Search for the definition of the `updateStatusFunction`
ast-grep --lang typescript --pattern 'function updateStatusFunction($_$) { $$$ }'

# Search for all usages of `NextResponse.json` to inspect how error messages and status codes are handled
rg 'NextResponse.json'

Length of output: 690



Script:

#!/bin/bash
# Search for import statements of `validateApiKey` and `updateStatusFunction` in `route.ts`
rg 'validateApiKey' server/app/api/update_query_status/route.ts
rg 'updateStatusFunction' server/app/api/update_query_status/route.ts

Length of output: 400



Script:

#!/bin/bash
# Locate and review the implementation of `validateApiKey` in `@/data/helper_party_api_key`
rg 'validateApiKey' $(fd helper_party_api_key)

# Locate and review the implementation of `updateStatusFunction` in `@/data/helper_party_query_status`
rg 'updateStatusFunction' $(fd helper_party_query_status)

Length of output: 367



Script:

#!/bin/bash
# Extract the implementation of `validateApiKey` from `server/data/helper_party_api_key.ts`
ast-grep --lang typescript --pattern 'export async function validateApiKey($_$) { $$$ }' server/data/helper_party_api_key.ts

# Extract the implementation of `updateStatusFunction` from `server/data/helper_party_query_status.ts`
ast-grep --lang typescript --pattern 'export async function updateStatusFunction($_$) { $$$ }' server/data/helper_party_query_status.ts

Length of output: 264



Script:

#!/bin/bash
# Extract the implementation of `validateApiKey` from `server/data/helper_party_api_key.ts`
ast-grep --lang typescript --pattern 'export async function validateApiKey($_$)' server/data/helper_party_api_key.ts

# Extract the implementation of `updateStatusFunction` from `server/data/helper_party_query_status.ts`
ast-grep --lang typescript --pattern 'export async function updateStatusFunction($_$)' server/data/helper_party_query_status.ts

Length of output: 248



Script:

#!/bin/bash
# Extract the full implementation of `validateApiKey` from `server/data/helper_party_api_key.ts`
rg -A 20 'export async function validateApiKey' server/data/helper_party_api_key.ts

# Extract the full implementation of `updateStatusFunction` from `server/data/helper_party_query_status.ts`
rg -A 20 'export async function updateStatusFunction' server/data/helper_party_query_status.ts

Length of output: 1244

server/data/query.ts (1)

Line range hint 37-63: The updates to getQuery and createNewQuery functions are crucial for integrating with the Supabase client. Ensure that the error handling is robust and that performance implications of these changes are considered.

server/__tests__/api_update_query_status_route.test.tsx (2)

7-7: Ensure testQueryUUID is correctly utilized across all relevant test scenarios.

Verification successful

The testQueryUUID is correctly utilized in the api_update_query_status_route.test.tsx file. It is used in multiple places within the test scenarios, ensuring consistency.

  • Line 7: Declaration of testQueryUUID.
  • Line 17: Used in the afterAll cleanup function to delete entries with query_uuid equal to testQueryUUID.
  • Line 27: Used in the POST request body to set query_uuid.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify `testQueryUUID` usage consistency.
rg --type typescript --context 5 $'testQueryUUID'

Length of output: 83



Script:

#!/bin/bash
# Description: Verify `testQueryUUID` usage consistency.
rg --type ts --type tsx --context 5 'testQueryUUID'

Length of output: 79



Script:

#!/bin/bash
# Description: Verify `testQueryUUID` usage consistency.
rg --type ts --context 5 'testQueryUUID'

Length of output: 2809


4-4: Ensure the createSupabaseServiceClient function is robustly implemented as it is crucial for database interactions in these tests.

Verification successful

The function createSupabaseServiceClient is properly implemented in server/data/supabase_server_service_client.ts. It uses createClient from the @supabase/supabase-js package to initialize a Supabase client with environment variables for the Supabase URL and service role key. This implementation appears robust for database interactions in the tests.

  • server/data/supabase_server_service_client.ts:
    export async function createSupabaseServiceClient(): Promise<SupabaseClient<Database>> {
      const supabase = createClient(
        process.env.NEXT_PUBLIC_SUPABASE_URL!,
        process.env.SUPABASE_SERVICE_ROLE_KEY!,
      );
      return supabase;
    }
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the implementation of `createSupabaseServiceClient`.
ast-grep --lang typescript --pattern $'export async function createSupabaseServiceClient() { $$$ }'

Length of output: 100



Script:

#!/bin/bash
# Search for the definition of `createSupabaseServiceClient` function in the codebase.
rg "function createSupabaseServiceClient" --type ts

Length of output: 161



Script:

#!/bin/bash
# Extract the implementation of `createSupabaseServiceClient` function from the identified file.
ast-grep --lang typescript --pattern $'export async function createSupabaseServiceClient() { $$$ }' server/data/supabase_server_service_client.ts

Length of output: 146



Script:

#!/bin/bash
# Display the content of `server/data/supabase_server_service_client.ts` to understand the function definition.
cat server/data/supabase_server_service_client.ts

Length of output: 426

server/supabase/seed.sql (2)

35-35: Ensure the test query is correctly utilized in the testing framework and does not affect production data.


27-29: Ensure the hashed API keys are securely generated and stored. Consider verifying the security of the hashing mechanism used.

Verification successful

The review comment raises a valid concern regarding the security of the hashed API keys. After analyzing the code, it is evident that bcrypt is used for hashing and comparing API keys, which is a secure and widely accepted method for handling sensitive data.

  • bcrypt is imported and used in server/data/helper_party_api_key.ts.
  • The validateApiKey function uses bcrypt.compare to validate the API keys against the stored hashed keys.

The usage of bcrypt ensures that the API keys are securely hashed and stored.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the security of the hashing mechanism for API keys.
ast-grep --lang sql --pattern $'INSERT INTO public.helper_party_api_keys($$$)'

Length of output: 186



Script:

#!/bin/bash
# Description: Search for the hashing function or method used to generate the hashed API keys in the SQL file.
rg --no-heading 'hash' server/supabase/seed.sql

Length of output: 755



Script:

#!/bin/bash
# Description: Search for the function or method that generates the hashed API keys in the entire codebase.
rg --no-heading '\$2b\$10\$' .

Length of output: 821



Script:

#!/bin/bash
# Description: Search for the usage of `bcrypt` or similar hashing libraries in the codebase.
rg --no-heading 'bcrypt' .

Length of output: 738



Script:

#!/bin/bash
# Description: Extract the relevant code from `server/data/helper_party_api_key.ts` to review the usage of `bcrypt`.
rg --no-heading -A 10 'import bcrypt from "bcrypt";' server/data/helper_party_api_key.ts

Length of output: 531



Script:

#!/bin/bash
# Description: Extract additional lines from `server/data/helper_party_api_key.ts` to review the complete usage of `bcrypt`.
rg --no-heading -A 30 'import bcrypt from "bcrypt";' server/data/helper_party_api_key.ts

Length of output: 1103



Script:

#!/bin/bash
# Description: Extract additional lines from `server/data/helper_party_api_key.ts` to review the complete usage of `bcrypt`.
rg --no-heading -A 50 'import bcrypt from "bcrypt";' server/data/helper_party_api_key.ts

Length of output: 1825

server/jest.config.ts (3)

19-37: The Jest configuration for coverage collection is well-set. Ensure the V8 coverage provider meets the project's performance and accuracy needs.

Consider periodically reviewing coverage tools to ensure they align with the latest project requirements.


154-158: The inclusion of environment variables in the test configuration is a good practice. Ensure sensitive data is not exposed in test logs.


94-95: The module name mapper setup is crucial for maintaining clean import paths. Ensure all paths are correctly resolved.

Verification successful

The module name mapper setup in jest.config.ts appears to be correctly resolving the import paths using the @/ alias. The search results show multiple instances of this alias being used in import statements across various TypeScript files.

  • server/data/supabase_server_client.ts
  • server/data/supabase_server_service_client.ts
  • server/data/helper_party_query_status.ts
  • server/data/helper_party_api_key.ts
  • server/data/query.ts
  • server/app/api/update_query_status/route.ts

These files import modules using the @/ alias, indicating that the module name mapper setup is functioning as intended.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify module path resolutions.
rg --type typescript --files-with-matches $'@\/'

Length of output: 120



Script:

#!/bin/bash
# Description: Verify module path resolutions.
rg --type typescript --pattern '@/'

Length of output: 447



Script:

#!/bin/bash
# Description: Verify module path resolutions.
rg --type typescript '@/'

Length of output: 60



Script:

#!/bin/bash
# Description: Verify module path resolutions.
rg '@/.*' --glob '**/*.ts'

Length of output: 1218

server/data/supabaseTypes.ts (1)

150-187: The new type definitions for helper_party_query_status_updates are comprehensive. Ensure they align with the database schema and are correctly used in the application code.

Verification successful

The type helper_party_query_status_updates is used in the following files:

  • server/data/supabaseTypes.ts
  • server/data/helper_party_query_status.ts
  • server/__tests__/api_update_query_status_route.test.tsx

The usage in server/data/helper_party_query_status.ts and the test file server/__tests__/api_update_query_status_route.test.tsx indicates that the type definitions are integrated into the application code and tests.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `helper_party_query_status_updates` type definitions in application code.
rg --type typescript $'helper_party_query_status_updates'

Length of output: 91



Script:

#!/bin/bash
# Description: Verify the usage of `helper_party_query_status_updates` type definitions in application code.
rg --type ts 'helper_party_query_status_updates'

Length of output: 647

server/data/supabase_server_service_client.ts Show resolved Hide resolved
server/data/helper_party_query_status.ts Show resolved Hide resolved
server/__tests__/api_update_query_status_route.test.tsx Outdated Show resolved Hide resolved
server/data/helper_party_api_key.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@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

Commits

Files that changed from the base of the PR and between 269820e and b504098.

Files selected for processing (1)
  • .github/workflows/pre-commit.yaml (1 hunks)
Additional context used
Gitleaks
.github/workflows/pre-commit.yaml

13-13: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data. (jwt)

.github/workflows/pre-commit.yaml Outdated Show resolved Hide resolved
.github/workflows/pre-commit.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b504098 and e8263b9.

Files selected for processing (1)
  • .github/workflows/pre-commit.yaml (1 hunks)
Additional context used
Gitleaks
.github/workflows/pre-commit.yaml

13-13: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data. (jwt)

Additional comments not posted (1)
.github/workflows/pre-commit.yaml (1)

18-20: Ensure that the Supabase CLI is correctly initialized and started.

.github/workflows/pre-commit.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e8263b9 and 1b96233.

Files selected for processing (1)
  • .github/workflows/pre-commit.yaml (1 hunks)
Additional context used
Gitleaks
.github/workflows/pre-commit.yaml

13-13: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data. (jwt)

Additional comments not posted (1)
.github/workflows/pre-commit.yaml (1)

18-21: Ensure correct use of Supabase CLI commands in GitHub Actions.

The steps to initialize and start Supabase using the Supabase CLI look correct. Make sure the supabase init and supabase start commands are executed in the right environment and the server is properly configured to use them.

.github/workflows/pre-commit.yaml Show resolved Hide resolved
@eriktaubeneck
Copy link
Member Author

it only took 14 commits debugging github actions, but the test now passes in CI

Copy link
Contributor

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1b96233 and 2e42ed1.

Files selected for processing (2)
  • .github/workflows/pre-commit.yaml (1 hunks)
  • server/tests/api_update_query_status_route.test.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • server/tests/api_update_query_status_route.test.tsx
Additional context used
Learnings (1)
.github/workflows/pre-commit.yaml (1)
User: eriktaubeneck
PR: private-attribution/draft#47
File: .github/workflows/pre-commit.yaml:11-13
Timestamp: 2024-06-18T03:23:21.180Z
Learning: The `SUPABASE_SERVICE_ROLE_KEY` in the `.github/workflows/pre-commit.yaml` is a publicly known static key used for development, which is safe to commit according to the project's practices.
Gitleaks
.github/workflows/pre-commit.yaml

13-13: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data. (jwt)

Additional comments not posted (3)
.github/workflows/pre-commit.yaml (3)

11-15: The environment variables include a static JWT for the Supabase service role key, which is safe to commit according to the project's practices.

Tools
Gitleaks

13-13: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data. (jwt)


13-13: The JWT for the Supabase service role key is a static key used for development, which aligns with the project's practices.

Tools
Gitleaks

13-13: Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data. (jwt)


21-23: The steps for setting up and managing the Supabase environment are correctly configured.

Copy link
Collaborator

@akoshelev akoshelev left a comment

Choose a reason for hiding this comment

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

good stuff and thank you for adding e2e tests - this will help with maintaining this project in the long term

server/data/helper_party_api_key.ts Show resolved Hide resolved
server/data/helper_party_api_key.ts Outdated Show resolved Hide resolved
server/data/supabase_server_client.ts Show resolved Hide resolved
server/data/supabase_server_client.ts Show resolved Hide resolved
Copy link
Contributor

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2e42ed1 and eeb4530.

Files selected for processing (2)
  • server/app/api/update_query_status/route.ts (1 hunks)
  • server/data/helper_party_api_key.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • server/app/api/update_query_status/route.ts
  • server/data/helper_party_api_key.ts

@eriktaubeneck eriktaubeneck merged commit 69c26be into main Jun 20, 2024
3 checks passed
@eriktaubeneck eriktaubeneck deleted the helper-party-status-events branch June 20, 2024 22:34
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