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

Update Measurement Plug-In Generated Client to Resolve with the Corresponding Measurement Service Version #925

Merged
merged 12 commits into from
Sep 25, 2024

Conversation

Jotheeswaran-Nandagopal
Copy link
Contributor

@Jotheeswaran-Nandagopal Jotheeswaran-Nandagopal commented Sep 24, 2024

What does this Pull Request accomplish?

  • Add version as a parameter in the resolve_service API of the discovery client with respect to the latest change in ni-apis.
  • Update the unit tests for the resolve_service API with version parameter.
  • Update the Mako template of Measurement Plug-In Client generator to resolve the service with the version of the measurement.

Why should this Pull Request be merged?

  • The ResolveServiceRequest has been updated in the ni-apis, with version.

  • As, multiple versions of same measurement can be registered simultaneously, the resolve service will fetch the service with latest version, if the version is not specified while resolving. So, when a user creates a client with version 1.0.0.0 and later, run the measure() API in client with higher version 2.0.0.0 of registered measurement, the service location will be resolved without any error, as the version is not checked. With this, if the configurations are updated in new version of measurement, this will result in error during measure call.

  • With the implementation in this Pull Request (adding version), client will be generated for the latest version (as multiple versions are not supported at present). During the measurement process in the generated client, measurement service will be resolved with the version of the generated client. If the version mismatch is captured, throw error appropriately.

What testing has been done?

  • Done manual testing
  • Automated test cases passed

Copy link

github-actions bot commented Sep 24, 2024

Test Results

    40 files  ± 0      40 suites  ±0   53m 51s ⏱️ + 1m 13s
   695 tests + 1     695 ✅ + 1      0 💤 ±0  0 ❌ ±0 
16 890 runs  +30  15 820 ✅ +30  1 070 💤 ±0  0 ❌ ±0 

Results for commit 1386842. ± Comparison against base commit 113b166.

This pull request removes 1 and adds 2 tests. Note that renamed tests count towards both.
tests.unit.test_discovery_client ‑ test___service_registered___resolve_service___sends_request
tests.unit.test_discovery_client ‑ test___service_registered___resolve_service_with_version___sends_request
tests.unit.test_discovery_client ‑ test___service_registered___resolve_service_without_version___sends_request

♻️ This comment has been updated with latest results.

@Jotheeswaran-Nandagopal Jotheeswaran-Nandagopal changed the title Update resolve_service API in Discovery Client and modify Measurement Plug-In Client template accordingly Update Measurement Plug-In Generated Client to Resolve with the Corresponding Measurement Service Version Sep 24, 2024
Copy link
Contributor

@jayaseelan-james jayaseelan-james left a comment

Choose a reason for hiding this comment

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

Following #907, in a separate PR please consider moving the version of the test measurements from __init__.py to its corresponding .serviceconfig.

@bkeryan
Copy link
Collaborator

bkeryan commented Sep 24, 2024

@Jotheeswaran-Nandagopal @Avinash2Suresh I think part of what's going on with the build failures is that our virtualenv caching uses the poetry.lock as a key, and this doesn't change when you modify files in ../../packages/service.

https://github.com/ni/measurement-plugin-python/blob/main/.github/workflows/run_system_tests.yml

Copy link
Contributor

@jayaseelan-james jayaseelan-james left a comment

Choose a reason for hiding this comment

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

If you're updating the version of the service pkg, then please update the version of the generator and SDK packages as well.

packages/service/tests/unit/test_discovery_client.py Outdated Show resolved Hide resolved
packages/service/pyproject.toml Outdated Show resolved Hide resolved
@Jotheeswaran-Nandagopal
Copy link
Contributor Author

As per the updates in #911, I have moved the version from the constructor to .serviceconfig file, as the pipelines are failing due to the requirement to include the version in the generated client.

@Jotheeswaran-Nandagopal
Copy link
Contributor Author

@Jotheeswaran-Nandagopal @Avinash2Suresh I think part of what's going on with the build failures is that our virtualenv caching uses the poetry.lock as a key, and this doesn't change when you modify files in ../../packages/service.

https://github.com/ni/measurement-plugin-python/blob/main/.github/workflows/run_system_tests.yml

@bkeryan I have updated the package versions as service package is updated, in order to resolve the pipeline failure caused by our virtualenv caching.

@bkeryan bkeryan merged commit 90d3ab7 into main Sep 25, 2024
17 checks passed
@bkeryan bkeryan deleted the users/jothees/update-resolve-service branch September 25, 2024 14:28
Jotheeswaran-Nandagopal added a commit that referenced this pull request Sep 25, 2024
…sponding Measurement Service Version (#925)

* fix: update resolve service api and its dependencies

* fix: formatting

* fix: update resolve service

* fix: add deployment_target

* fix: update version of service

* fix: update version and revert the unwanted changes

* fix: revert unwanted change

* fix: update poetry

* fix: formatting

* fix: update version of test measurements in service config

(cherry picked from commit 90d3ab7)
Jotheeswaran-Nandagopal added a commit that referenced this pull request Sep 25, 2024
…nt to Resolve with the Corresponding Measurement Service Version (#938)

Update Measurement Plug-In Generated Client to Resolve with the Corresponding Measurement Service Version (#925)

* fix: update resolve service api and its dependencies

* fix: formatting

* fix: update resolve service

* fix: add deployment_target

* fix: update version of service

* fix: update version and revert the unwanted changes

* fix: revert unwanted change

* fix: update poetry

* fix: formatting

* fix: update version of test measurements in service config

(cherry picked from commit 90d3ab7)
@bkeryan
Copy link
Collaborator

bkeryan commented Sep 25, 2024

@Jotheeswaran-Nandagopal @Avinash2Suresh I think part of what's going on with the build failures is that our virtualenv caching uses the poetry.lock as a key, and this doesn't change when you modify files in ../../packages/service.
https://github.com/ni/measurement-plugin-python/blob/main/.github/workflows/run_system_tests.yml

@bkeryan I have updated the package versions as service package is updated, in order to resolve the pipeline failure caused by our virtualenv caching.

#941

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.

6 participants