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

Feature/pdct 1440 implement multi geographies in the navigator backend #386

Conversation

katybaulch
Copy link
Contributor

@katybaulch katybaulch commented Oct 16, 2024

Description

Implement multiple navigators in the backend.

Clean up to come after validation on staging and the final update to the frontend to remove old references.

Proposed version

Please select the option below that is most relevant from the list below. This
will be used to generate the next tag version name during auto-tagging.

  • Skip auto-tagging
  • Patch
  • Minor version
  • Major version

Visit the Semver website to understand the
difference between MAJOR, MINOR, and PATCH versions.

Notes:

  • If none of these options are selected, auto-tagging will fail
  • Where multiple options are selected, the most senior option ticked will be
    used -- e.g. Major > Minor > Patch
  • If you are selecting the version in the list above using the textbox, make
    sure your selected option is marked [x] with no spaces in between the
    brackets and the x

Type of change

Please select the option(s) below that are most relevant:

  • Bug fix
  • New feature
  • Breaking change
  • GitHub workflow update
  • Documentation update
  • Refactor legacy code
  • Dependency update

How Has This Been Tested?

Please describe the tests that you added to verify your changes.

Reviewer Checklist

  • DB_CLIENT DEPENDENCY IS ON THE LATEST VERSION
  • The PR represents a single feature (small driveby fixes are also ok)
  • The PR includes tests that are sufficient for the level of risk
  • The code is sufficiently commented, particularly in hard-to-understand areas
  • Any required documentation updates have been made
  • Any TODOs added are captured in future tickets
  • No FIXMEs remain

Copy link

linear bot commented Oct 16, 2024

@katybaulch katybaulch marked this pull request as ready for review October 16, 2024 10:10
@katybaulch katybaulch requested review from a team as code owners October 16, 2024 10:10
odrakes-cpr
odrakes-cpr previously approved these changes Oct 16, 2024
Copy link
Contributor

@odrakes-cpr odrakes-cpr left a comment

Choose a reason for hiding this comment

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

I've not been deep in the backend as you so can't comment too much on functionality, but it all looks very sound otherwise :)

@THOR300
Copy link
Contributor

THOR300 commented Oct 16, 2024

@katybaulch great to be getting this in!

Some questions as this is quite a big change:

  • To confirm where this sits against the following PR, my understanding is that this is us now passing in actual geographies not just a conversion of geography to an array of the geo like “fr’ -> [“fr”].
  • Re testing of this, have we spun up the local stack to test this before pushing to staging?
  • The main part I'm concerned about is the query changes for the creation of the pipeline input. As a minimum I would suggest we do the following to convince ourselves that the changes work as just looking at the code I don't feel like I can confirm fully that there will be no change in functionality other than the geographies field - I would suggest we spun up the stack locally with a staging dump, create the pipeline input (by invoking the endpoint) from the main built backend and compare this against the feature/pdct-14400... built backend.

@THOR300 THOR300 dismissed odrakes-cpr’s stale review October 16, 2024 11:02

Dismissing review until we've tested this locally post lunch.

@katybaulch
Copy link
Contributor Author

@katybaulch great to be getting this in!

Some questions as this is quite a big change:

  • To confirm where this sits against the following PR, my understanding is that this is us now passing in actual geographies not just a conversion of geography to an array of the geo like “fr’ -> [“fr”].
  • Re testing of this, have we spun up the local stack to test this before pushing to staging?
  • The main part I'm concerned about is the query changes for the creation of the pipeline input. As a minimum I would suggest we do the following to convince ourselves that the changes work as just looking at the code I don't feel like I can confirm fully that there will be no change in functionality other than the geographies field - I would suggest we spun up the stack locally with a staging dump, create the pipeline input (by invoking the endpoint) from the main built backend and compare this against the feature/pdct-14400... built backend.

Just to clarify, we're now passing an array of geographies. Where there is only one geography, this will have the effect “fr" -> [“fr”]. Where there are multiple e.g., France and UK, it would pass ["fr", "uk"].

Sounds good. Let's catch up after lunch as I could really use a hand validating this!

@THOR300
Copy link
Contributor

THOR300 commented Oct 16, 2024

@katybaulch great to be getting this in!
Some questions as this is quite a big change:

  • To confirm where this sits against the following PR, my understanding is that this is us now passing in actual geographies not just a conversion of geography to an array of the geo like “fr’ -> [“fr”].
  • Re testing of this, have we spun up the local stack to test this before pushing to staging?
  • The main part I'm concerned about is the query changes for the creation of the pipeline input. As a minimum I would suggest we do the following to convince ourselves that the changes work as just looking at the code I don't feel like I can confirm fully that there will be no change in functionality other than the geographies field - I would suggest we spun up the stack locally with a staging dump, create the pipeline input (by invoking the endpoint) from the main built backend and compare this against the feature/pdct-14400... built backend.

Just to clarify, we're now passing an array of geographies. Where there is only one geography, this will have the effect “fr" -> [“fr”]. Where there are multiple e.g., France and UK, it would pass ["fr", "uk"].

Sounds good. Let's catch up after lunch as I could really use a hand validating this!

Confirmed locally that there are some differences so iterating to fix before merge.

@katybaulch
Copy link
Contributor Author

@katybaulch great to be getting this in!
Some questions as this is quite a big change:

  • To confirm where this sits against the following PR, my understanding is that this is us now passing in actual geographies not just a conversion of geography to an array of the geo like “fr’ -> [“fr”].
  • Re testing of this, have we spun up the local stack to test this before pushing to staging?
  • The main part I'm concerned about is the query changes for the creation of the pipeline input. As a minimum I would suggest we do the following to convince ourselves that the changes work as just looking at the code I don't feel like I can confirm fully that there will be no change in functionality other than the geographies field - I would suggest we spun up the stack locally with a staging dump, create the pipeline input (by invoking the endpoint) from the main built backend and compare this against the feature/pdct-14400... built backend.

Just to clarify, we're now passing an array of geographies. Where there is only one geography, this will have the effect “fr" -> [“fr”]. Where there are multiple e.g., France and UK, it would pass ["fr", "uk"].
Sounds good. Let's catch up after lunch as I could really use a hand validating this!

Confirmed locally that there are some differences so iterating to fix before merge.

I have removed the pipeline query updates from this PR so we can test in isolation on staging.

katybaulch and others added 2 commits October 17, 2024 17:31
* Make pipeline query support multi geos

* Make ordering of db objects the same

* Update comment

* Make sure query is more equivalent to incumbent

* Create db_state_validator.py

* Create way of validating two db state files

* Revert "Create db_state_validator.py"

This reverts commit a03f693.

* Get most recent slug comments

* Break formatting of db_state contents into separate function

* Refactor generating db_state content into new function

* Updating the script to use sdk models. (#389)

Co-authored-by: Mark <[email protected]>

* Add test cases for checking db_state content

* Refactor write_documents_to_s3 for test isolation

---------

Co-authored-by: NextGenEng <[email protected]>
Co-authored-by: Mark <[email protected]>
@katybaulch
Copy link
Contributor Author

@katybaulch great to be getting this in!
Some questions as this is quite a big change:

  • To confirm where this sits against the following PR, my understanding is that this is us now passing in actual geographies not just a conversion of geography to an array of the geo like “fr’ -> [“fr”].
  • Re testing of this, have we spun up the local stack to test this before pushing to staging?
  • The main part I'm concerned about is the query changes for the creation of the pipeline input. As a minimum I would suggest we do the following to convince ourselves that the changes work as just looking at the code I don't feel like I can confirm fully that there will be no change in functionality other than the geographies field - I would suggest we spun up the stack locally with a staging dump, create the pipeline input (by invoking the endpoint) from the main built backend and compare this against the feature/pdct-14400... built backend.

Just to clarify, we're now passing an array of geographies. Where there is only one geography, this will have the effect “fr" -> [“fr”]. Where there are multiple e.g., France and UK, it would pass ["fr", "uk"].
Sounds good. Let's catch up after lunch as I could really use a hand validating this!

Confirmed locally that there are some differences so iterating to fix before merge.

I have removed the pipeline query updates from this PR so we can test in isolation on staging.

This is the PR specifically for the pipeline changes with more comments from Mark on :) #388

@katybaulch katybaulch requested a review from olaughter October 21, 2024 12:31
Copy link
Contributor

@olaughter olaughter left a comment

Choose a reason for hiding this comment

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

Mostly very minor comments from me below. Looking really good otherwise!

app/core/validation/util.py Outdated Show resolved Hide resolved
app/repository/pipeline.py Outdated Show resolved Hide resolved
app/repository/pipeline.py Outdated Show resolved Hide resolved
app/repository/pipeline.py Outdated Show resolved Hide resolved
app/repository/pipeline.py Outdated Show resolved Hide resolved
app/repository/sql/pipeline.sql Show resolved Hide resolved
app/repository/sql/pipeline.sql Outdated Show resolved Hide resolved
app/repository/sql/pipeline.sql Outdated Show resolved Hide resolved
app/repository/sql/pipeline.sql Outdated Show resolved Hide resolved
tests/unit/app/core/test_pipeline.py Outdated Show resolved Hide resolved
Copy link
Contributor

@olaughter olaughter left a comment

Choose a reason for hiding this comment

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

lgtm!

@katybaulch katybaulch merged commit 038163e into main Oct 22, 2024
12 checks passed
@katybaulch katybaulch deleted the feature/pdct-1440-implement-mulit-geographies-in-the-navigator-backend branch October 22, 2024 08:53
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.

4 participants