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

feat: Add error handling for data migration #9582

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

miya
Copy link
Member

@miya miya commented Jan 24, 2025

Task

  • #160696 MongoDB 内に意図しない page や revision のデータが存在する時に、途中で data migration の実行が止まってしまい、処理が継続できない

@miya miya requested a review from yuki-takei January 24, 2025 06:15
@miya miya self-assigned this Jan 24, 2025
Copy link

changeset-bot bot commented Jan 24, 2025

⚠️ No Changeset found

Latest commit: 726a7dc

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
Member Author

Choose a reason for hiding this comment

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

  • TryCatch の追加
  • revision 及び revision.body が null の時は処理をスキップするようにした

@yuki-takei
Copy link
Member

yuki-takei commented Jan 24, 2025

一旦これでいいことにはするが、以下を後続タスクで

N+1 の解消

type safe にして可読性を上げる

  • bin/data-migrations/tsconfig.json を作成し、strict 設定

    {
      "$schema": "http://json.schemastore.org/tsconfig",
      "extends": "../../tsconfig.base.json",
      "compilerOptions": {
        "checkJs": true,
        "strict": true,
      }
    }
  • index.js だけでいいので、type annotation を追加し暗黙的 any をなくす

@yuki-takei yuki-takei merged commit e92c3e3 into master Jan 24, 2025
4 checks passed
@yuki-takei yuki-takei deleted the feat/160696-error-handling-for-data-migration branch January 24, 2025 06:39
@github-actions github-actions bot mentioned this pull request Jan 24, 2025
@github-actions github-actions bot mentioned this pull request Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants