Skip to content

Legal API - Upgrade to python 3.13 and use common lear packages (model, etc.) #33184

@kialj876

Description

@kialj876

Background

  • During the GCP migration the other lear backend services were upgraded to python 3.13, but the legal-api is still on 3.9
  • Several pieces of code were extrapolated out of the legal-api into common packages which are used in the other lear backend services, but the legal-api is not using them. Currently when we need to update these we have to update it in both the legal-api and the common packages, and there is some drift accumulating. The major concern here is the db model

Plan for tickets

  • Remove minio references in the legal-api (everything should be using DRS now) - can't remove - still relying on it for a few flows
  • Remove db-versioning FF in the legal-api (it is on in all environments and the common model does not support dual versioning) - confirmed with argus we can do this
  • Use common code packages instead of local copy - need to discuss upgrading python before or after this - currently not all common packages support python 3.9
    • maybe new release branch with legal-api on python 3.13 with upgraded deps
    • use business-registry-common
      • will replace local legal-api copies of: BaseEnum, BaseMeta, datetime, LegislationDatetime
      • update business-registry-common for any missing functionality
        • common LegislationDatetime needs format_as_report_string_with_custom_time, format_as_report_expiry_string_1159, format_as_legislation_date, is_future
      • update legal-api imports and verify
      • small update / low risk
    • use business-registry-account
      • will replace AccountService used in legal_api/services/bootstrap.py
      • update business-registry-common to include 'get_contacts' first
      • small update / low risk
    • use business-registry-model
      • replaces the legal-api's models
      • will need to take a close look at any drift across the two and apply updates to the common model as needed (i.e. recently a minor update to share_class in legal-api was not applied to business-registry-model)
      • alembic migration versions should be in sync - need to verify how the CD is upgrading the db and update it if needed
      • major update / high risk
    • use business-registry-dissolution
      • replaces InvoluntaryDissolutionService inside legal_api/services/involuntary_dissolution.py
      • note: has model dependency and flags dependency should be reviewed
    • use business-registry-digital-credentials
  • Release plan (Testing plan etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Entities TeamA label to filter on the tickets for the Entities based team that takes care of front end features

    Type

    No fields configured for Epic.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions