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

[EASI-4457] Add closed requests for testing #2709

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

mynar7
Copy link
Contributor

@mynar7 mynar7 commented Jul 19, 2024

EASI-4457

Description

  • Prod has roughly 600 closed system intakes that are getting queried on the admin home page. To simulate that, this PR adds the ability to load up closed TRB and System Intake requests as seed data for local development.
  • This also refactors the seed data script to use context properly.

How to test this change

  • scripts/dev db:clean && scripts/dev db:seed

PR Author Checklist

  • I have provided a detailed description of the changes in this PR.
  • I have provided clear instructions on how to test the changes in this PR.
  • I have updated tests or written new tests as appropriate in this PR.

PR Reviewer Guidelines

  • It's best to pull the branch locally and test it, rather than just looking at the code online!
  • When approving a PR, provide a reason why you're approving it
    • e.g. "Approving because I tested it locally and all functionality works as expected"
    • e.g. "Approving because the change is simple and matches the Figma design"
  • Don't be afraid to leave comments or ask questions, especially if you don't understand why something was done! (This is often a great time to suggest code comments or documentation updates)
  • Check that all code is adequately covered by tests - if it isn't feel free to suggest the addition of tests.

@mynar7 mynar7 requested a review from a team as a code owner July 19, 2024 17:12
@mynar7 mynar7 requested review from ClayBenson94 and samoddball and removed request for a team July 19, 2024 17:12
@mynar7 mynar7 changed the base branch from main to feature/EASI-4457 July 19, 2024 17:13
)

// CreateSystemIntakeGRBReviewer creates a GRB Reviewer
func (s *Store) CreateSystemIntakeGRBReviewer(ctx context.Context, tx *sqlx.Tx, reviewer *models.SystemIntakeGRBReviewer) error {
func (s *Store) CreateSystemIntakeGRBReviewer(ctx context.Context, np sqlutils.NamedPreparer, reviewer *models.SystemIntakeGRBReviewer) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently multiple transactions will block error groups, so I changed this store method to accept the store or a tx via NamedPreparer.

Copy link
Contributor

Choose a reason for hiding this comment

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

i am curious about this. is there an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would either block the thread and the operations would never finish or throw a duplicate key Postgres error.

Copy link
Contributor

Choose a reason for hiding this comment

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

throw a duplicate key Postgres error -> as in inserting identical items into a unique column? or something else?

Copy link
Contributor

Choose a reason for hiding this comment

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

i guess i am more just curious if this would break something else, but i looked, and the only other place is using a tx, so it's probably fine

@mynar7 mynar7 requested a review from a team as a code owner July 22, 2024 15:51
@@ -348,7 +348,7 @@ describe('Governance Review Team', () => {

// Check form submit was successful
cy.get('div[data-testid="alert"]').contains(
'Life Cycle ID 000009 is now expired.'
/Life Cycle ID [0-9]{6} is now expired./
Copy link
Contributor

Choose a reason for hiding this comment

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

🤯 that's really cool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sometimes you just gotta Regflex

)

// CreateSystemIntakeGRBReviewer creates a GRB Reviewer
func (s *Store) CreateSystemIntakeGRBReviewer(ctx context.Context, tx *sqlx.Tx, reviewer *models.SystemIntakeGRBReviewer) error {
func (s *Store) CreateSystemIntakeGRBReviewer(ctx context.Context, np sqlutils.NamedPreparer, reviewer *models.SystemIntakeGRBReviewer) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

i am curious about this. is there an error?

@mynar7 mynar7 merged commit bb939f3 into feature/EASI-4457 Jul 22, 2024
12 checks passed
@mynar7 mynar7 deleted the EASI-4457/add-closed-requests-for-testing branch July 22, 2024 18:44
mynar7 added a commit that referenced this pull request Aug 1, 2024
* [EASI-4457] Funding sources dataloader and mapper refactor (#2692)

* add funding source dataloader and refactor helpers.OneToMany and Mapper interface

* fix store method, call dataloader version in resolver

* [EASI-4457] Add dataloader to TRB request form resolver (#2695)

add dataloader to trb request form resolver

* [EASI-4457] System intake notes dataloader (#2693)

update notes resolver to use dataloader, add tests for notes

* [EASI-4457] System Intake Actions dataloader (#2694)

add dataloader to system intake actions resolver

* [EASI 4457] - TRB Request Feedback dataloaders (#2700)

* add dataloaders to TRB Feedback

* convert slice to postgres array

* use dataloaders in status calls

* remove unnecessary no rows error check

* [EASI-4457] TRB Advice letter dataloader (#2702)

* add dataloaders to TRB Feedback

* convert slice to postgres array

* use dataloaders in status calls

* remove unnecessary no rows error check

* add dataloaders to advice letter and finish refactoring statuses

* sort mock users

* nil check statuses

* [EASI-4457] TRB attendees dataloaders (#2705)

* add dataloader to trb attendees

* add dataloader for attendees by EUA and TRB ID, update requester component resolver

* use ptr helper, add to resolver test

* [EASI-4457] Add closed requests for testing (#2709)

* refactor seed data to allow for closed request generation

* remove context value and just use a constant

* add regex to LCID test

* [EASI-4457] TRB documents dataloaders (#2706)

* add a dataloader for trb documents, use dataloaders in other resolvers

* semicolons and better error handling

* [EASI-4457] TRB Admin Notes dataloader (#2714)

add dataloaders for TRB admin notes

* [EASI-4457] TRB Request Funding Sources dataloader (#2715)

* add dataloader for trb funding sources

* fix test to allow for empty slice

* add TODO comment

* [EASI-4457] TRB Form System Intakes dataloader (#2722)

add dataloader for trb request form system intakes

* [EASI-4457] Add gov req feedback dataloader (#2731)

* add gov req feedback dataloader

* run gql gen

* [EASI-4457] intake documents dataloader (#2732)

* add dataloader for documents

* use resolver to create fake documents

* update seed script

* update seed script to not fetch users multiple times for closed requests

* add comments

* [EASI-4457] Business Case dataloaders (#2729)

* refactor business case legacy code to allow for biz case and cost line dataloaders with less friction

* cleanup comments

---------

Co-authored-by: samoddball <156127704+samoddball@users.noreply.github.com>

---------

Co-authored-by: samoddball <156127704+samoddball@users.noreply.github.com>
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.

2 participants