Skip to content

refactor: rename github_doc_file_paths table to doc_file_paths #1462

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

Merged
merged 8 commits into from
Apr 25, 2025

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Apr 23, 2025

Rename github_doc_file_paths table to doc_file_paths

TL;DR;

  • Renamed the github_doc_file_paths table to doc_file_paths
  • Renamed the github_doc_file_path_id column in the knowledge_suggestion_doc_mappings table to doc_file_path_id
  • Updated related code references accordingly

Reason

We want to organize tables prefixed with github_ as ones that manage GitHub resource IDs.
Although doc_file_paths is related to GitHub, it's more about file paths on Git, so we decided to drop the github_ prefix.

Link to Devin run

https://app.devin.ai/sessions/58fc43ee886c4316aec11caf5ede6534

Related PRs

Notes

  • Type generation (pnpm supabase:gen) failed due to environment issues. CI may fail due to TypeScript errors.

Co-Authored-By: noritaka.ikeda@route06.co.jp <noritaka.ikeda@route06.co.jp>
Copy link

changeset-bot bot commented Apr 23, 2025

⚠️ No Changeset found

Latest commit: 3bb7ee5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor Author

devin-ai-integration bot commented Apr 23, 2025

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

vercel bot commented Apr 23, 2025

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

Name Status Preview Comments Updated (UTC)
liam-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2025 6:56am
liam-erd-sample ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2025 6:56am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
liam-docs ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2025 6:56am

Copy link

supabase bot commented Apr 23, 2025

Updates to Preview Branch (devin/1745412436-rename-github-doc-file-paths) ↗︎

Deployments Status Updated
Database Fri, 25 Apr 2025 06:54:31 UTC
Services Fri, 25 Apr 2025 06:54:31 UTC
APIs Fri, 25 Apr 2025 06:54:31 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Fri, 25 Apr 2025 06:54:31 UTC
Migrations Fri, 25 Apr 2025 06:54:31 UTC
Seeding Fri, 25 Apr 2025 06:54:31 UTC
Edge Functions Fri, 25 Apr 2025 06:54:31 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

Copy link
Contributor

github-actions bot commented Apr 23, 2025

Copy link
Contributor

qodo-merge-pro-for-open-source bot commented Apr 23, 2025

CI Feedback 🧐

(Feedback updated until commit 64abffc)

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: frontend-ci

Failed stage: Run pnpm test:turbo [❌]

Failure summary:

The action failed during the build process of the @liam-hq/db package. The TypeScript compiler
encountered errors in the src/index.ts file:

  • Lines 6, 9, and 10 in src/index.ts are trying to import from
    /home/runner/work/liam/liam/frontend/packages/db/supabase/database.types.ts, but TypeScript reports
    that this file "is not a module" (error TS2306).
  • This caused the build command to exit with code 2, which made the entire workflow fail.
  • The issue appears to be that the database.types.ts file either doesn't exist, is empty, or doesn't
    export anything that can be imported.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    158:  ##[group]Run pnpm install --frozen-lockfile --prefer-offline
    159:  �[36;1mpnpm install --frozen-lockfile --prefer-offline�[0m
    160:  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
    161:  env:
    162:  PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
    163:  ##[endgroup]
    164:  Scope: all 17 workspace projects
    165:  Lockfile is up to date, resolution step is skipped
    166:  Progress: resolved 1, reused 0, downloaded 0, added 0
    167:  Packages: +1555
    168:  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    169:  Progress: resolved 1555, reused 1033, downloaded 0, added 0
    170:  Progress: resolved 1555, reused 1542, downloaded 0, added 447
    171:  Progress: resolved 1555, reused 1542, downloaded 0, added 957
    172:  Progress: resolved 1555, reused 1542, downloaded 0, added 1555, done
    173:  WARN  Failed to create bin at /home/runner/work/liam/liam/frontend/apps/erd-sample/node_modules/.bin/liam. ENOENT: no such file or directory, open '/home/runner/work/liam/liam/frontend/packages/cli/dist-cli/bin/cli.js'
    174:  devDependencies:
    ...
    
    184:  │                                                                              │
    185:  │   Ignored build scripts: @biomejs/biome, @bundled-es-modules/glob,           │
    186:  │   @depot/cli, @prisma/client, @prisma/engines, @sentry/cli, core-js-pure,    │
    187:  │   esbuild, protobufjs, sharp, style-dictionary.                              │
    188:  │   Run "pnpm approve-builds" to pick which dependencies should be allowed     │
    189:  │   to run scripts.                                                            │
    190:  │                                                                              │
    191:  ╰──────────────────────────────────────────────────────────────────────────────╯
    192:  frontend/apps/docs postinstall$ fumadocs-mdx
    193:  frontend/packages/jobs postinstall$ cp ../db-structure/node_modules/@ruby/prism/src/prism.wasm prism.wasm
    194:  frontend/packages/jobs postinstall: Done
    195:  frontend/apps/docs postinstall: [MDX] types generated
    196:  frontend/apps/docs postinstall: Done
    197:  frontend/apps/app postinstall$ cp ../../packages/db-structure/node_modules/@ruby/prism/src/prism.wasm prism.wasm
    198:  frontend/apps/app postinstall: Done
    199:  WARN  Failed to create bin at /home/runner/work/liam/liam/frontend/apps/erd-sample/node_modules/.bin/liam. ENOENT: no such file or directory, open '/home/runner/work/liam/liam/frontend/apps/erd-sample/node_modules/@liam-hq/cli/dist-cli/bin/cli.js'
    200:  Done in 6.4s using pnpm v10.8.0
    ...
    
    927:  [css] Wrote /home/runner/work/liam/liam/frontend/packages/ui/src/components/IconButton/IconButton.module.css.d.ts
    928:  [css] Wrote /home/runner/work/liam/liam/frontend/packages/ui/src/components/GridTable/GridTable.module.css.d.ts
    929:  [css] Wrote /home/runner/work/liam/liam/frontend/packages/ui/src/components/DropdownMenu/DropdownMenu.module.css.d.ts
    930:  [css] Wrote /home/runner/work/liam/liam/frontend/packages/ui/src/components/Drawer/Drawer.module.css.d.ts
    931:  [css] Wrote /home/runner/work/liam/liam/frontend/packages/ui/src/components/CookieConsent/CookieConsent.module.css.d.ts
    932:  [css] Wrote /home/runner/work/liam/liam/frontend/packages/ui/src/components/Callout/Callout.module.css.d.ts
    933:  [css] Wrote /home/runner/work/liam/liam/frontend/packages/ui/src/components/Avatar/Avatar.module.css.d.ts
    934:  [css] Wrote /home/runner/work/liam/liam/frontend/packages/ui/src/components/Button/Button.module.css.d.ts
    935:  [css] Wrote /home/runner/work/liam/liam/frontend/packages/ui/src/styles/globals.css.d.ts
    936:  [css] pnpm run gen:css exited with code 0
    937:  ##[endgroup]
    938:  �[;31m@liam-hq/db:build�[;0m
    939:  cache miss, executing fb726951c211a4bd
    940:  > @liam-hq/db@0.0.0 build /home/runner/work/liam/liam/frontend/packages/db
    941:  > tsc
    942:  ##[error]src/index.ts(6,31): error TS2306: File '/home/runner/work/liam/liam/frontend/packages/db/supabase/database.types.ts' is not a module.
    943:  ##[error]src/index.ts(9,31): error TS2306: File '/home/runner/work/liam/liam/frontend/packages/db/supabase/database.types.ts' is not a module.
    944:  ##[error]src/index.ts(10,29): error TS2306: File '/home/runner/work/liam/liam/frontend/packages/db/supabase/database.types.ts' is not a module.
    945:  ELIFECYCLE  Command failed with exit code 2.
    946:  [ERROR] command finished with error: command (/home/runner/work/liam/liam/frontend/packages/db) /home/runner/setup-pnpm/node_modules/.bin/pnpm run build exited (2)
    947:  ##[group]@liam-hq/db-structure:test
    ...
    
    953:  cache miss, executing 92c7f58f373541a8
    954:  > @liam-hq/db-structure@0.0.19 build /home/runner/work/liam/liam/frontend/packages/db-structure
    955:  > tsc && pnpm run cp:prism
    956:  ##[endgroup]
    957:  ##[group]@liam-hq/erd-core:gen
    958:  cache miss, executing d15951c00f0cc740
    959:  > @liam-hq/erd-core@0.1.7 gen /home/runner/work/liam/liam/frontend/packages/erd-core
    960:  > concurrently "pnpm:gen:*"
    961:  [css] pnpm run gen:css exited with code SIGINT
    962:  ##[endgroup]
    963:  ##[group]@liam-hq/github:build
    964:  cache miss, executing 0cb459bd3e08f3b2
    965:  > @liam-hq/github@0.1.0 build /home/runner/work/liam/liam/frontend/packages/github
    966:  > tsc
    967:  ##[endgroup]
    968:  ##[error]@liam-hq/db#build: command (/home/runner/work/liam/liam/frontend/packages/db) /home/runner/setup-pnpm/node_modules/.bin/pnpm run build exited (2)
    969:  Tasks:    3 successful, 8 total
    970:  Cached:    0 cached, 8 total
    971:  Time:    4.626s 
    972:  Failed:    @liam-hq/db#build
    973:  ERROR  run failed: command  exited (2)
    974:  ELIFECYCLE  Command failed with exit code 2.
    975:  ##[error]Process completed with exit code 2.
    976:  Post job cleanup.
    

    @NoritakaIkeda NoritakaIkeda self-assigned this Apr 23, 2025
    @FunamaYukina
    Copy link
    Member

    (aside)
    I will check.

    Copy link
    Contributor

    liam-migration bot commented Apr 25, 2025

    This migration renames the github_doc_file_paths table to doc_file_paths and updates related column names and code references, wrapped in a transaction to ensure atomicity. The most significant concern is verifying that all foreign key constraints, indexing, and RLS policies remain consistent after the renaming, as well as ensuring performance and data integrity during index rebuilds. Overall, the changes are positive in clarifying naming conventions and aligning with project rules, though clarifications on backup procedures and post-migration integrity checks are advised.

    Migration URL: https://liam-erd-web.vercel.app/app/projects/284f1bca-2633-4a93-9567-7bc98ab298f7/ref/devin%2F1745412436-rename-github-doc-file-paths/migrations/e4510d38-4947-4b99-a0fb-8f8230812dd6

    ER Diagram:

    Copy link

    liam-migration-preview bot commented Apr 25, 2025

    This migration renames the github_doc_file_paths table to doc_file_paths and updates associated column names, indexes, and foreign key constraints. A critical risk is ensuring data integrity and mitigating potential performance impacts during index and FK updates in production. Positive naming and security updates enhance overall maintainability and clarity across the application.

    Migration URL: https://liam-app-git-staging-route-06-core.vercel.app/app/projects/9d777f64-400a-42f3-a60e-98a59fc97279/ref/devin%2F1745412436-rename-github-doc-file-paths/migrations/0c4c1f91-fdee-4650-bf36-91a31777c611

    ER Diagram:

    @FunamaYukina
    Copy link
    Member

    FunamaYukina commented Apr 25, 2025

    ✅ I checked

    • supabase:reset works.
    • supabase:gen
    • The application's knowledge suggestion page should display correctly.

    @FunamaYukina FunamaYukina marked this pull request as ready for review April 25, 2025 07:25
    @FunamaYukina FunamaYukina requested a review from a team as a code owner April 25, 2025 07:25
    @FunamaYukina FunamaYukina requested review from hoshinotsuyoshi, FunamaYukina, junkisai, MH4GF and NoritakaIkeda and removed request for a team April 25, 2025 07:25
    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

    Test Improvement

    The test is skipped with it.skip(). Consider enabling the test to ensure the renamed functionality works correctly.

    it.skip('should return doc file paths with correct structure', async () => {
      const supabase = await createClient()
    Variable Naming

    The function parameter and variable names still use 'gitHubDocFilePathId' and 'docFilePathId' despite the table rename, which could cause confusion.

    const createDocMapping = async (
      knowledgeSuggestionId: string,
      docFilePathId: string,
      timestamp: string,
    ) => {

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Learned
    best practice
    Update outdated comment reference

    The comment still refers to "GitHubDocFilePath" even though the table has been
    renamed to "doc_file_paths". Update the comment to reflect the new table name
    for consistency.

    frontend/apps/app/features/projects/actions/approveKnowledgeSuggestion.ts [59-60]

     const { data: docFilePath } = await supabase
       .from('doc_file_paths')
       .select('id')
       .eq('project_id', suggestion.project_id)
       .eq('path', suggestion.path)
       .maybeSingle()
     
     if (!docFilePath) {
    -  // Create a new GitHubDocFilePath entry
    +  // Create a new DocFilePath entry
       const now = new Date().toISOString()

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 6
    Low
    • More

    Copy link
    Member

    @NoritakaIkeda NoritakaIkeda left a comment

    Choose a reason for hiding this comment

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

    Thank you for the update! This looks great!

    Copy link
    Member

    @MH4GF MH4GF left a comment

    Choose a reason for hiding this comment

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

    LGTM 👍🏻

    - Updated foreign key constraints and indexes to reference the new table name
    - Updated all code references to use the new table name
    - This change provides a more consistent naming approach across the application

    Copy link
    Member

    Choose a reason for hiding this comment

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

    👍🏻

    Copy link
    Member

    @hoshinotsuyoshi hoshinotsuyoshi left a comment

    Choose a reason for hiding this comment

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

    LGTM!

    @NoritakaIkeda NoritakaIkeda added this pull request to the merge queue Apr 25, 2025
    Merged via the queue into main with commit eaa6b47 Apr 25, 2025
    19 checks passed
    @NoritakaIkeda NoritakaIkeda deleted the devin/1745412436-rename-github-doc-file-paths branch April 25, 2025 08:13
    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.

    4 participants