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

Adapt to pending entities with BBIDs / Introducing Kysely #323

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Commits on Aug 12, 2024

  1. refactor(imports): Adapt to the new schema where imports have BBIDs

    Mostly column, property and table names had to be updated to follow the
    schema. A few other identifiers have been renamed as well for
    consistency, although this was not strictly necessary.
    kellnerd committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    3f8a095 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. fix(imports): Remove unused property from function parameter type

    It is never used and never passed, but causes a TS error.
    kellnerd committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    2578a5e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    39f0c43 View commit details
    Browse the repository at this point in the history
  3. refactor(imports): Avoid re-throwing our own errors

    The error message is already specific enough, no need to make it longer.
    kellnerd committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    56df87e View commit details
    Browse the repository at this point in the history
  4. fix(imports): Adapt deletion process to the new schema

    In the end we of course want to reuse `bbid` and `data_id` of accepted
    entities instead of duplicating the data and deleting the original.
    kellnerd committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    f1b2cf3 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2024

  1. refactor(imports): Adapt approval to the new way imports are loaded

    Also make `ImportMetadataT` more versatile/useful.
    kellnerd committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    532da04 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. fix(imports): Remove raw SQL default value

    It is not needed and it is causing a type error since the last commit.
    kellnerd committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    b38e358 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2024

  1. chore(deps): Install kysely

    kellnerd committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    d1f5c48 View commit details
    Browse the repository at this point in the history
  2. chore(eslint): Drop comma-dangle rule

    The rule to disallow trailing commas often forces you to pointlessly
    touch neighboring lines when you add or remove items.
    
    If we want to enforce consistent dangling commas, we should rather force
    them to always be present. But since our whole codebase follows this
    rule, it would be better to have a grace period to gradually add commas.
    
    metabrainz/bookbrainz-site@2fc11a2
    kellnerd committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    2909201 View commit details
    Browse the repository at this point in the history
  3. feat: Generate types for DB schema and setup kysely

    Run the kysely-codegen task to regenerate the types.
    Don't forget to reformat the generated code to follow our linting rules.
    
    Since this is using DB introspection, you have to specify a DB
    connection string via the --url param or the DATABASE_URL env var:
    https://github.com/RobinBlomberg/kysely-codegen
    kellnerd committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    05446cd View commit details
    Browse the repository at this point in the history
  4. feat(imports): Preserve BBID and DB rows of entities during approval

    Rather than collecting all properties of the pending entity data and
    creating a new entity (with new BBID), we simply create an entity header
    and a revision which link to the existing data.
    This is a complete rewrite using Kysely instead of Bookshelf/Knex.
    
    The final loading of the entity model (for search indexing) is out of
    scope for this function and has been moved into bookbrainz-site.
    kellnerd committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    fb8fd5a View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2024

  1. fix(imports): Mark ParsedEdition.editionGroupBbid as optional

    From an older schema, there are still editions without edition group.
    kellnerd committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    1ee3d1a View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2024

  1. fix(imports): Update recent import queries for new approval behavior

    The `pending_entity_bbid` column is no longer set to NULL on approval,
    we have to additionally check for NULL in accepted_entity_bbid to find
    pending imports.
    kellnerd committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    fdc7cbb View commit details
    Browse the repository at this point in the history