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

BCDA-8351: Exclude MD TCoC requests from suppression #993

Merged
merged 10 commits into from
Oct 4, 2024

Conversation

laurenkrugen-navapbc
Copy link
Contributor

🎫 Ticket

https://jira.cms.gov/browse/BCDA-8351

🛠 Changes

  • When preparing beneficiaries for a request, if the source of the request was from TCoC, then the query to get suppressed beneficiaries will be skipped.
  • github.com/go-testfixtures is being used in combination with github.com/golang-migrate/migrate/v4 so that tests that utilize the application database are idempotent. There is existing code that will create a test database that can have migrations and fixtures applied to it. The long term goal (besides idemtpotence) is to eventually remove all dependency on init() calls, since those prohibit our ability to run singular tests in packages that import another package that uses init().
  • Service_test.go has had test name updates, so that we can eventually separate our unit and integration tests in our make unit-test command.
  • protobuf version was bumped from v1.5.3 -> v1.5.4 due to failing build
  • test fixtures was bumped from v3.5.0 -> v3.7.0 to utilize additional library features that weren't available the previous library
  • the service folder contains a directory for data fixtures that was renamed from testdata to fixtures. Old files that were not in use were removed and new files have been added

ℹ️ Context

To onboard TCOC, we must exclude beneficiary suppression with their requests.

🧪 Validation

Added integration test will seeded database for suppression data.

bcda/service/service.go Outdated Show resolved Hide resolved
bcda/service/service_test.go Outdated Show resolved Hide resolved
bcda/service/service_test.go Outdated Show resolved Hide resolved
bcda/service/service_test.go Show resolved Hide resolved
go.mod Show resolved Hide resolved
@laurenkrugen-navapbc laurenkrugen-navapbc marked this pull request as ready for review September 19, 2024 17:12
kyeah and others added 5 commits October 3, 2024 11:03
## 🎫 Ticket

https://jira.cms.gov/browse/BCDA-8350

## 🛠 Changes

- Adds database documentation in the repo using
https://github.com/k1LoW/tbls
- Adds github workflow to automatically update PRs that touch the
migrations folders

## ℹ️ Context

As part of BCDA-8350, I was interested in an easier way to keep the
documentation up to date. Although ERDs can be generated manually by
tooling like pgAdmin, it would be preferable for devs to have the
diagrams generated automatically in a central location.

We can still pull the main ERDs into confluence, but instead of making
them ourselves we can download them directly from the PR after merging.

## 🧪 Validation

See dbdocs in this PR.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sean Fern <[email protected]>
bcda/api/alr.go Outdated Show resolved Hide resolved
bcda/api/alr_test.go Outdated Show resolved Hide resolved
bcda/service/service.go Show resolved Hide resolved
bcda/service/service.go Show resolved Hide resolved
bcda/service/service_test.go Outdated Show resolved Hide resolved
bcda/api/requests.go Outdated Show resolved Hide resolved
@@ -30,11 +30,11 @@ type requestkey int

const rk requestkey = 0

func NewRequestParametersContext(ctx context.Context, rp RequestParameters) context.Context {
func NewCtxRequestParams(ctx context.Context, rp RequestParameters) context.Context {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function doesnt look like its doing a whole lot for us, do you think its useful? As far as I can tell the two are equivalent:
ctx := NewCtxRequestParams(r.Context(), rp)
ctx := context.WithValue(ctx, 0, rp)
The difference is the requestkey? I didnt understand the comment on it.

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 just checks the context for that particular key; it's not really doing anything for us at this point. It looks like it's used in about 11 places; shall I update those or do we want to keep this PR the current size?

conf/configs/dev.yml Show resolved Hide resolved
Copy link
Contributor

@carlpartridge carlpartridge left a comment

Choose a reason for hiding this comment

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

Added two minor nitpicks but overall this is looking great!

bcda/service/service.go Outdated Show resolved Hide resolved
bcda/web/middleware/validation.go Show resolved Hide resolved
@laurenkrugen-navapbc laurenkrugen-navapbc merged commit c53b38f into main Oct 4, 2024
5 checks passed
@laurenkrugen-navapbc laurenkrugen-navapbc deleted the lauren/BCDA-8351 branch October 4, 2024 17:26
laurenkrugen-navapbc added a commit that referenced this pull request Oct 31, 2024
## 🎫 Ticket

https://jira.cms.gov/browse/BCDA-8351

## 🛠 Changes

- When preparing beneficiaries for a request, if the source of the
request was from TCoC, then the query to get suppressed beneficiaries
will be skipped.
- github.com/go-testfixtures is being used in combination with
github.com/golang-migrate/migrate/v4 so that tests that utilize the
application database are idempotent. There is [existing
code](https://github.com/CMSgov/bcda-app/blob/main/bcda/database/databasetest/databasetest.go#L22)
that will create a test database that can have migrations and fixtures
applied to it. The long term goal (besides idemtpotence) is to
eventually remove all dependency on init() calls, since those prohibit
our ability to run singular tests in packages that import another
package that uses init().
- Service_test.go has had test name updates, so that we can eventually
separate our unit and integration tests in our `make unit-test` command.
- protobuf version was bumped from v1.5.3 -> v1.5.4 due to failing build
- test fixtures was bumped from v3.5.0 -> v3.7.0 to utilize additional
library features that weren't available the previous library
- the service folder contains a directory for data fixtures that was
renamed from `testdata` to `fixtures`. Old files that were not in use
were removed and new files have been added

	

## ℹ️ Context

To onboard TCOC, we must exclude beneficiary suppression with their
requests.


<!-- If any of the following security implications apply, this PR must
not be merged without Stephen Walter's approval. Explain in this section
and add @SJWalter11 as a reviewer.
  - Adds a new software dependency or dependencies.
  - Modifies or invalidates one or more of our security controls.
  - Stores or transmits data that was not stored or transmitted before.
- Requires additional review of security implications for other reasons.
-->

## 🧪 Validation

Added integration test will seeded database for suppression data.

---------

Co-authored-by: Kevin Yeh <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sean Fern <[email protected]>
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