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 service to get version from .serviceconfig #827

Merged
merged 7 commits into from
Aug 5, 2024

Conversation

nick-beer
Copy link
Collaborator

What does this Pull Request accomplish?

Add support for reading a measurement's version from its .serviceconfig file, as well as passing that version through discovery service's RegisterService API.

To do this:

  • Make version and ui_file_paths parameters to the MeasurementService constructor optional
  • If version is specified in the constructor, use it unless it is also specified in the .serviceconfig file AND the two values are different. If the values are different, raise an error
  • Add a version property to ServiceInfo
  • Pass ServiceInfo.version through the RegisterServiceRequest inside the DiscoveryClient.

Why should this Pull Request be merged?

We're working to add version support to our plugins. The intention is for the version of a plugin to be stored in its .serviceconfig file and passed to discovery service when it registers itself.

What testing has been done?

A couple new tests have been written, and a couple existing tests have been updated to account for the presence of a version in the service config.

Copy link

github-actions bot commented Aug 2, 2024

Test Results

    30 files  ±  0      30 suites  ±0   42m 57s ⏱️ - 6m 6s
   643 tests + 11     643 ✅ + 15      0 💤 ±0  0 ❌  - 4 
15 910 runs  +330  14 840 ✅ +334  1 070 💤 ±0  0 ❌  - 4 

Results for commit 3bb7a41. ± Comparison against base commit 7d1a5fe.

This pull request removes 7 and adds 18 tests. Note that renamed tests count towards both.
tests.unit.test_service ‑ test___service_config___create_measurement_service___service_info_matches_service_config[example.AllAnnotations.serviceconfig-provided_interfaces5-provided_annotations5]
tests.unit.test_service ‑ test___service_config___create_measurement_service___service_info_matches_service_config[example.CustomAnnotations.serviceconfig-provided_interfaces6-provided_annotations6]
tests.unit.test_service ‑ test___service_config___create_measurement_service___service_info_matches_service_config[example.OnlyCollection.serviceconfig-provided_interfaces3-provided_annotations3]
tests.unit.test_service ‑ test___service_config___create_measurement_service___service_info_matches_service_config[example.OnlyTags.serviceconfig-provided_interfaces4-provided_annotations4]
tests.unit.test_service ‑ test___service_config___create_measurement_service___service_info_matches_service_config[example.serviceconfig-provided_interfaces0-provided_annotations0]
tests.unit.test_service ‑ test___service_config___create_measurement_service___service_info_matches_service_config[example.v1.serviceconfig-provided_interfaces1-provided_annotations1]
tests.unit.test_service ‑ test___service_config___create_measurement_service___service_info_matches_service_config[example.v2.serviceconfig-provided_interfaces2-provided_annotations2]
tests.unit.test_metadata ‑ test___display_name_invalid_characters___validate___raises_value_exception[ test_string]
tests.unit.test_metadata ‑ test___display_name_invalid_characters___validate___raises_value_exception[]
tests.unit.test_metadata ‑ test___display_name_invalid_characters___validate___raises_value_exception[_____()!]
tests.unit.test_metadata ‑ test___display_name_invalid_characters___validate___raises_value_exception[test@string]
tests.unit.test_metadata ‑ test___display_name_valid_characters___validate___raises_no_exception[Test String: -10]
tests.unit.test_metadata ‑ test___display_name_valid_characters___validate___raises_no_exception[tEsT StRIng?]
tests.unit.test_metadata ‑ test___display_name_valid_characters___validate___raises_no_exception[test_string!]
tests.unit.test_metadata ‑ test___display_name_valid_characters___validate___raises_no_exception[teststring()]
tests.unit.test_service ‑ test___service_config___create_measurement_service___service_info_matches_service_config[example.AllAnnotations.serviceconfig-1.0.6-provided_interfaces5-provided_annotations5]
tests.unit.test_service ‑ test___service_config___create_measurement_service___service_info_matches_service_config[example.CustomAnnotations.serviceconfig-1.0.7-provided_interfaces6-provided_annotations6]
…

♻️ This comment has been updated with latest results.

@nick-beer nick-beer requested a review from bkeryan August 2, 2024 22:42
@jayaseelan-james
Copy link
Contributor

@nick-beer
[Question] I'm just curious to know that with this change, will we update the template in our measurement-plugin-generator to have a version field in the .serviceconfig going forward?

@nick-beer
Copy link
Collaborator Author

nick-beer commented Aug 5, 2024

@nick-beer [Question] I'm just curious to know that with this change, will we update the template in our measurement-plugin-generator to have a version field in the .serviceconfig going forward?

@jayaseelan-james - Good catch! Yes, this PR has been updated to include the necessary changes to the generator.

Copy link
Collaborator

@dixonjoel dixonjoel left a comment

Choose a reason for hiding this comment

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

I'd like to see the changes with multiple versions.

@nick-beer
Copy link
Collaborator Author

I'd like to see the changes with multiple versions.

@dixonjoel - can you explain what you mean by this? I don't follow.

@dixonjoel
Copy link
Collaborator

@nick-beer "Sorry - I reset you without seeing this message. Thanks for pointing this out - I think it makes sense for ServiceInfo to have versions rather than version. I'll make the update." Maybe I misunderstood this. You resolved this conversation. What changed?

@dixonjoel
Copy link
Collaborator

@nick-beer Oh, this update? Sorry I missed this.
f438446

@dixonjoel dixonjoel self-requested a review August 5, 2024 13:58
@nick-beer
Copy link
Collaborator Author

@nick-beer Oh, this update? Sorry I missed this. f438446

@dixonjoel - yeah, that's the one that updated ServiceInfo to have the possibility of multiple versions.

Copy link
Collaborator

@bkeryan bkeryan left a comment

Choose a reason for hiding this comment

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

Approved with suggestion

@nick-beer nick-beer merged commit afa08a6 into main Aug 5, 2024
17 checks passed
@nick-beer nick-beer deleted the users/nbeer/version-support branch August 5, 2024 20:19
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.

4 participants