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

[Issue #2371] Rename agency to agency_code in API + DB #2566

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

chouinar
Copy link
Collaborator

@chouinar chouinar commented Oct 24, 2024

Summary

Fixes #2371

Time to review: 10 mins

Changes proposed

High-level - renamed agency in the opportunity models to agency_code - both at the API and DB layer

Remove agency name and agency code from the opportunity summary response object (should not be used - the opportunity values are more accurate)

A lot of fixes for tests that were checking for the old name

Deleted an import-csv script that wasn't needed anymore (and would've needed fixes)

Context for reviewers

agency is way too generic of a name, and agency_code makes more sense.

Agency info is also split across an opportunity and summary. Some of this was duplicated (code and name) and we want to avoid confusion by having these values duplicated.

Additional information

Did a quick pass on the existing search UI, don't see anything having broken yet. Query box, sorting, and filters all work, as well as the agency itself being displayed in search. I also switched the frontend to use v1 and didn't see any issues

Screenshot 2024-10-25 at 3 33 08 PM Screenshot 2024-10-25 at 3 33 27 PM

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 24, 2024
@doug-s-nava
Copy link
Collaborator

Made a couple of notes on the ticket but I agree that everything seems to check out here. We'll have some minor updates to make on the frontend before deprecating the existing opportunity.agency but we can coordinate that later.

Copy link
Contributor

@emilycnava emilycnava left a comment

Choose a reason for hiding this comment

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

lgtm! (checked locally and didn't see any noticeable errors on FE)

@emilycnava
Copy link
Contributor

@doug-s-nava I wonder I know you mentioned visual diff checkers in a PR the other day, I assume something like that would have helped here as well? How complex are those tools to implement?

@doug-s-nava
Copy link
Collaborator

Getting an error on make migrate-db-down: psycopg.errors.UndefinedColumn) column "agency_code" does not exist

@doug-s-nava
Copy link
Collaborator

@emilycnava 🤔 I feel like a visual differ could help in situations like this to uncover bugs, but I think e2e tests would be even more effective with that since they take user interaction into account. The way we're using e2e tests at the moment, we wouldn't have caught something like a text change here, though. In any case, for a testing scenario to catch an issue in a change like this we'd have to carefully choose the examples we're using. For example, to catch a bug with how agency data is displayed we'd have to make sure to be running our tests against an opportunity that is affected by the change - an opportunity with no agency data or, perhaps, agency data that matches between the opportunity and the summary, may not show us that anything is wrong. Interesting to think about for the future.

Visual differs are not super hard to set up. However:

  • they cost money
  • they can be finicky similar to how e2e test are in terms of false negatives, and as a result there is some overhead in terms of maintenance

@chouinar chouinar marked this pull request as ready for review November 1, 2024 17:05
Copy link
Collaborator

@mdragon mdragon left a comment

Choose a reason for hiding this comment

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

Looks good as long as FE likes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api database documentation Improvements or additions to documentation python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Look into adjusting the naming / data structure of the agency data in the opportunity response
5 participants