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

feat: ims-service accepts new profiles #5

Merged
merged 25 commits into from
Dec 30, 2024

Conversation

mackenzie-grimes-noaa
Copy link
Contributor

@mackenzie-grimes-noaa mackenzie-grimes-noaa commented Dec 18, 2024

Linear Issue

IDSSE-1038

Changes

This PR renames the "ims-service" to "NWS Connect Dummy Service", or "NCD" when a shorter name is needed.

Reorganization of files:

  • Reorganize Python source files using NWSC Gateway file structure
  • Moves the Python service outside of the idsse.testing directory, since it doesn't need to be packaged and shipped with the unit testing module.

Added functionality:

  • Create ProfileStore that reads and persists Support Profiles as JSON files on the filesystem
    • On startup, reads any existing JSONs from the filesystem
    • Lets you do web-server-like operations on them (get all, create, delete)
    • Organizes JSONs into two directories to categorize them as "new" or "existing" profiles
  • Add support to Flask server to submit (POST) a new Support Profile or DELETE existing ones
    • GET /all-events?dataSource=ANY&status=existing will return existing Support Profiles
    • GET /all-events?dataSource=ANY&status=new will return only newly added Support Profiles.

A Support Profile will only ever appear in the "new" list one time; after that, it will be marked as "existing" (not new) and only be returned in the "existing" list.

Explanation

N/A

@mackenzie-grimes-noaa mackenzie-grimes-noaa marked this pull request as ready for review December 19, 2024 00:36
@mackenzie-grimes-noaa
Copy link
Contributor Author

mackenzie-grimes-noaa commented Dec 19, 2024

Code coverage report, since I don't think the GitHub Action is posting changes to the README at this point (and maybe doesn't need to):

Name                                                                                   Stmts   Miss  Cover
----------------------------------------------------------------------------------------------------------
/home/runner/work/idsse-testing/idsse-testing/python/nwsc_proxy/ncp_web_service.py        58      1    98%
/home/runner/work/idsse-testing/idsse-testing/python/nwsc_proxy/src/profile_store.py      85      5    94%
----------------------------------------------------------------------------------------------------------
TOTAL                                                                                    143      6    96%

============================== 19 passed in 0.56s ==============================

Copy link
Contributor

@Geary-Layne Geary-Layne left a comment

Choose a reason for hiding this comment

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

LGTM.
I was wondering why you called it NDS vs NPS with proxy for the middle name, you even call it the NWS Connect proxy service in the README.

GSL_KEY = '8209c979-e3de-402e-a1f5-556d650ab889'


def to_iso(date_time: datetime) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

Does any part of idsse-testing us commons?

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 doesn't at the moment. I was afraid to add an import of idss-engine-commons just for to_iso() and potentially cause a circular dependency in GitHub, because the idsse/testing directory has an idsse_common folder with test files, which I thought meant commons imports this repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

idsse/testing is a package install and other than a small amount of code that imports resources for tests there is no dependency.

@mackenzie-grimes-noaa
Copy link
Contributor Author

I was wondering why you called it NDS vs NPS with proxy for the middle name, you even call it the NWS Connect proxy service in the README.

I changed my mind on the name mid-development. I'll update everything to call it "NWSC Proxy".

Copy link
Contributor

@paulhamer-noaa paulhamer-noaa left a comment

Choose a reason for hiding this comment

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

Certainly a lot more useful than what was there before...

@mackenzie-grimes-noaa mackenzie-grimes-noaa merged commit 022c6fd into main Dec 30, 2024
2 checks passed
@mackenzie-grimes-noaa mackenzie-grimes-noaa deleted the proxy-accepts-new-profiles branch December 30, 2024 16:23
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