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

22956 - Verify update legal filings job to use new db versioning #3105

Conversation

eason-pan-bc
Copy link
Collaborator

@eason-pan-bc eason-pan-bc commented Nov 30, 2024

Issue #: /bcgov/entity#22956

Description of changes:
update-legal-filings-job doesn't directly operate in lear db, instead, it's calling legal-api and colin-api endpoints. And there isn't any existing code initialize a db instance in this job. As per discussion I have removed FF for update-legal-filings in multiple flags.json files.

Verification 1 - Running local legal-api and check behaviours

Keep the local lear-db's colin_last_update table remain the same for 3 runs in different scenarios.
In summary, there is no behaviour differences between these 3 scenarios:

  1. Not using new db versioning
    Not using new db versioning
  2. Using new db versioning and FF on
    FF-on
  3. Using new db versioning and FF off
    FF-off

Verification 2 - Running local legal-api and verify the endpoints the job used

  1. get max colin event_id from lear-db {{url}}/api/v2/businesses/internal/filings/colin_id
    Pasted image 20241203095542
  2. Pick an event_ids greater than the max id returned -- 105911836
  3. Get business info in lear-db: {{url}}/api/v2/businesses/:identifier
    Pasted image 20241203101654
  4. Check whether that event has been updated to lear-db or not: {{url}}/api/v2/businesses/internal/filings/colin_id/:event_id
    As this event/filing is not yet updated, it's not found in lear-db
    Pasted image 20241203103005
  5. Update it in lear: {{url}}/api/v2/businesses/:identifier/filings
    After fixing the data-type for goodStanding and adminFreeze
    Pasted image 20241203104455
  6. Update the new max_event_id: {{url}}/api/v2/businesses/internal/filings/colin_id/:new_max_event_id
    Pasted image 20241203104635
    Pasted image 20241203104656
  7. Check again (prev check in step-4): {{url}}/api/v2/businesses/internal/filings/colin_id/:event_id
    And since it's updated to lear-db now, we can find it
    image

Other findings

Found this job is already not really working properly, and might be like this for a while. I left some details here: bcgov/entity#22956 (comment)
May need to cut another ticket to address this issue.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).

@eason-pan-bc eason-pan-bc self-assigned this Nov 30, 2024
git+https://github.com/bcgov/lear.git#egg=sql-versioning&subdirectory=python/common/sql-versioning
git+https://github.com/bcgov/business-schemas.git@2.5.12#egg=registry_schemas
git+https://github.com/bcgov/business-schemas.git@2.18.27#egg=registry_schemas
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

update the schema version to the latest (same as legal-api)

@eason-pan-bc
Copy link
Collaborator Author

eason-pan-bc commented Nov 30, 2024

As there is no unit test for update-legal-filings-job, it shows as failed.
image

@eason-pan-bc eason-pan-bc marked this pull request as ready for review November 30, 2024 00:35
Copy link
Collaborator

@AimeeGao AimeeGao left a comment

Choose a reason for hiding this comment

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

LGTM(^-^)

Copy link

sonarcloud bot commented Dec 3, 2024

@eason-pan-bc eason-pan-bc marked this pull request as draft December 3, 2024 17:33
@eason-pan-bc eason-pan-bc marked this pull request as ready for review December 3, 2024 19:03
@eason-pan-bc eason-pan-bc merged commit 8e68ecd into bcgov:feature-db-versioning Dec 3, 2024
19 of 20 checks passed
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.

3 participants