Add Affinities integration for automatic registration of datasets and services#64
Merged
Add Affinities integration for automatic registration of datasets and services#64
Conversation
added 6 commits
February 18, 2026 19:40
- Add api/config/affinities_settings.py with: - AFFINITIES_ENABLED (default: False) - AFFINITIES_URL - AFFINITIES_EP_UUID - AFFINITIES_TIMEOUT (default: 30) - Update example.env with new variables and documentation
- Create api/services/affinities_services/ package - Add AffinitiesClient class with async methods: - register_dataset() - registers dataset + creates relationship - register_service() - registers service + creates relationship - create_dataset_endpoint_relationship() - create_service_endpoint_relationship() - Error handling with logging (non-blocking) - Global client instance: affinities_client
- Update post_general_dataset.py: - Import AffinitiesClient and logging - Register dataset in Affinities after creation (non-blocking) - Update post_service.py: - Import AffinitiesClient and logging - Register service in Affinities after creation (non-blocking) Both hooks are non-blocking: if Affinities fails, a warning is logged but the main operation completes successfully.
- Create docs/affinities-integration.md with: - Overview of the integration - Configuration instructions - Setup steps (registering EP in Affinities) - How datasets and services are registered - Error handling behavior - Metadata format examples - Troubleshooting guide
- Create tests/test_affinities_client.py with tests for: - AffinitiesClient.is_enabled behavior - register_dataset success and error handling - register_service success and error handling - Settings configuration validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #63
Adds integration with NDP Affinities API to automatically register datasets, services, and their relationships when created in NDP-EP.
Changes
AFFINITIES_ENABLED,AFFINITIES_URL,AFFINITIES_EP_UUID,AFFINITIES_TIMEOUT)api/services/affinities_services/with async HTTP clientPOST /datasetandPOST /servicesdocs/affinities-integration.mdtests/test_affinities_client.pyNon-breaking
Integration is disabled by default (
AFFINITIES_ENABLED=False) and non-blocking (errors logged but don't affect main operations).Tested