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

PEGA reporting API - prod connection setup #94284

Closed
baltes opened this issue Oct 3, 2024 · 7 comments
Closed

PEGA reporting API - prod connection setup #94284

baltes opened this issue Oct 3, 2024 · 7 comments
Assignees
Labels
backend ivc-forms zero-silent-failures Work related to eliminating silent failures ZSF:CodeReliability Changes to your code that handle silent errors in a way that they are no long silent.

Comments

@baltes
Copy link
Contributor

baltes commented Oct 3, 2024

As a member of the IVC forms team, I need the ability to pull PEGA status updates for an occasional audit against our records.

For the staging environment, there is a postman workspace that can be used to pull a report. Reach out to a member of the IVC forms team for a copy of the workspace. We need a comparable process so that we can pull similar reports in production with appropriate security.

Acceptance criteria

  • We can make a connection to the PEGA reporting API programmatically and all security prereqs are satisfied
  • A member of the IVC Forms team can manually pull a batch of records from the prod version of vaGovReport-Stage
@baltes baltes added ivc-forms zero-silent-failures Work related to eliminating silent failures labels Oct 3, 2024
@pshahVA pshahVA added the ZSF:CodeReliability Changes to your code that handle silent errors in a way that they are no long silent. label Oct 3, 2024
@andrea-merrill
Copy link

Notes from Cindy:

  • Keys are in Postman, put in our param store (they are access keys for us)
  • Must be in VA network

@baltes baltes added the sprint 3 planning ivc forms sprint 3 label Oct 23, 2024
@baltes baltes added needs-refinement Identifies tickets that need to be refined and removed sprint 3 planning ivc forms sprint 3 labels Oct 29, 2024
@baltes baltes changed the title PEGA reporting API - prod connection PEGA reporting API - prod connection setup Nov 21, 2024
@andrea-merrill andrea-merrill removed the needs-refinement Identifies tickets that need to be refined label Dec 4, 2024
@andrea-merrill
Copy link

Blocking this story: #95912 - Check most recent status prior to sending most recent ZSF email

@stevelong00
Copy link
Contributor

It looks like the postman collection that Cindy provided is already configured with everything we need to query Prod.

Since Postman is not installed on GAC and will regularly get removed, here's how to set this up:

  1. Download the postman collection that was provided via email
  2. Download the postman app from postman.com/downloads
  3. Install the app
  4. Launch the app and sign in with your postman account
  5. Drag and drop the collection onto the app to import it
  6. Select the vaGovReport-Prod endpoint and modify the start and end date headers before using it to run your query
  7. When you're done, delete the modified endpoint and the imported collection so that our keys are no longer stored within postman's cloud environment

@stevelong00
Copy link
Contributor

I just pushed my code for 94284 into a draft PR so that it's easier to share.

To run it locally:

  • Save the Pega API key into an environment variable like so export PEGA_API_KEY=insert1the2api3key4here. The API key can be found in the postman collection that Pega sent us. If it's easier, I'd be happy to hop on a call and dictate it.
  • Uncomment line 119 in modules/ivc_champva/spec/lib/pega_api_client_spec.rb to be able to see a non-error response.
  • Run the new test suite like so bundle exec rspec modules/ivc_champva/spec/lib

Right now it's not working. As best I can tell, it's configured to hit the prod API with the same headers that are used in the postman collection that we were provided. Yet for some reason the API is responding with { "statusCode":500, "body", "'date_start'" } when I hit it locally. In CAG, I am able to get the same response via postman by omitting the date_start header. I quadruple-checked that my code is sending this header, so I'm very puzzled as to what the problem is. Maybe it's something obvious and I just don't see it. If you can spot it, I've got a shiny quarter for you!

I asked Cindy if anything other than a missing date_start header could cause the API to give this response. She replied that the API was modified last month for a daily report, which she will correct and let me know when ready. So, it sounds like there may be a problem on the API side and not with this client code. That was yesterday (12/17) and I have not heard back yet.

@michaelclement
Copy link
Contributor

As of today this is working. There was a capitalization issue with the post request headers that was causing the request to fail. After a small change on the Pega side, we're able to hit the API programmatically as described in the AC.

@michaelclement
Copy link
Contributor

PR

@stevelong00
Copy link
Contributor

Merged. @baltes Nothing is using this client code yet, so there's nothing to review. Moving this to closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend ivc-forms zero-silent-failures Work related to eliminating silent failures ZSF:CodeReliability Changes to your code that handle silent errors in a way that they are no long silent.
Projects
None yet
Development

No branches or pull requests

6 participants