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

add models and unit test #16320

Closed
wants to merge 10 commits into from
Closed

add models and unit test #16320

wants to merge 10 commits into from

Conversation

cloudmagic80
Copy link
Contributor

@cloudmagic80 cloudmagic80 commented Apr 12, 2024

Summary

This repository contains the implementation of the PegaTable model in Ruby on Rails. The PegaTable model is designed to represent data related to a Pega table in a Rails application. It includes validations to ensure the presence of essential fields such as UUID, veteran first name, veteran last name, and response. Additionally, it validates the format of the response field to ensure it contains a valid HTTP status code (200, 403, 500) and is in JSON format.

Key Features:

Validates presence of essential fields.
Validates format of the response field to ensure it contains a valid HTTP status code and is in JSON format.
Utilizes exceptions handling to gracefully handle JSON parsing errors.

Related issue(s)

#16311

Testing done

  • New code is covered by unit tests
  • Describe what the old behavior was prior to the change
  • Describe the steps required to verify your changes are working as expected. Exclusively stating 'Specs run' is NOT acceptable as appropriate testing
  • If this work is behind a flipper:
    • Tests need to be written for both the flipper on and flipper off scenarios. Docs.
    • What is the testing plan for rolling out the feature?

What areas of the site does it impact?

Non so far. It is only in staging. not in production

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

@va-vfs-bot va-vfs-bot temporarily deployed to ivc_database_models2/main/main April 12, 2024 18:22 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to ivc_database_models2/main/main April 12, 2024 18:35 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to ivc_database_models2/main/main April 12, 2024 18:41 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to ivc_database_models2/main/main April 12, 2024 18:52 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to ivc_database_models2/main/main April 12, 2024 19:07 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to ivc_database_models2/main/main April 12, 2024 19:13 Inactive
@cloudmagic80 cloudmagic80 marked this pull request as ready for review April 12, 2024 19:49
@cloudmagic80 cloudmagic80 enabled auto-merge (squash) April 12, 2024 19:49
@rmtolmach
Copy link
Contributor

Hi @cloudmagic80, you'll need to update the CODEOWNERS file since you're adding new files. We have an automated CI check for that but i just learned (thanks to your PR! 😄) that it passes (falsely) if you add more than one new file. I have a pr to fix this, but you don't need to wait on that–the CI check would just tell you to add those files to CODEOWNERS.

@va-vsp-bot
Copy link
Collaborator

Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: app/models/pega_table.rb

@va-vfs-bot va-vfs-bot temporarily deployed to ivc_database_models2/main/main April 15, 2024 13:28 Inactive
@cloudmagic80 cloudmagic80 marked this pull request as draft April 15, 2024 13:28
auto-merge was automatically disabled April 15, 2024 13:28

Pull request was converted to draft

michaelclement
michaelclement previously approved these changes Apr 15, 2024
Copy link
Contributor

@michaelclement michaelclement left a comment

Choose a reason for hiding this comment

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

lgtm

@cloudmagic80
Copy link
Contributor Author

@rmtolmach Are the @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group the code reviewers?

@rmtolmach
Copy link
Contributor

rmtolmach commented Apr 15, 2024

@cloudmagic80 You'll want to add @department-of-veterans-affairs/backend-review-group AND your team as the code reviewers for all three of those files.

@va-vfs-bot va-vfs-bot temporarily deployed to ivc_database_models2/main/main April 15, 2024 14:23 Inactive
@cloudmagic80 cloudmagic80 marked this pull request as ready for review April 15, 2024 14:28
@cloudmagic80 cloudmagic80 requested a review from a team as a code owner April 15, 2024 14:28
@cloudmagic80 cloudmagic80 enabled auto-merge (squash) April 15, 2024 14:28
balexandr
balexandr previously approved these changes Apr 15, 2024
@@ -1441,6 +1443,7 @@ spec/models/message_spec.rb @department-of-veterans-affairs/vfs-mhv-secure-messa
spec/models/mhv_opt_in_flag_spec.rb @department-of-veterans-affairs/vfs-mhv-secure-messaging @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/models/mpi_data_spec.rb @department-of-veterans-affairs/octo-identity
spec/models/onsite_notification_spec.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/models/pega_table_spec.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Copy link
Contributor

Choose a reason for hiding this comment

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

You also need to add your github team as reviewers. Which team will be responsible for these files? If you don't have a team, pleas create one. https://github.com/orgs/department-of-veterans-affairs/teams

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rmtolmach I see @department-of-veterans-affairs/champva-engineering in our github teams but in CODEOWNERS, its not recognized

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rmtolmach Can you help out?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes! I've added champva-engineering to the vets-api repo as collaborators with write access so the warnings are gone 👍

@@ -0,0 +1,24 @@
# frozen_string_literal: true

class PegaTable < ApplicationRecord
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change the file name and model to just be "Pega" to match the format of other models? @cloudmagic80

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe PegaData for a bit more clarity since we are storing the response in there right?

@balexandr
Copy link
Contributor

I thought we discussed changes for this yesterday that made more sense to do @cloudmagic80

Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 16, 2024
Copy link

This PR has been closed because it has had no activity for 37 days

@github-actions github-actions bot closed this May 23, 2024
auto-merge was automatically disabled May 23, 2024 15:32

Pull request was closed

@github-actions github-actions bot deleted the ivc_database_models2 branch May 23, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants