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: update for assets and asset endpoint profiles to support new api version #371

Merged
merged 29 commits into from
Sep 27, 2024

Conversation

vilit1
Copy link
Contributor

@vilit1 vilit1 commented Sep 20, 2024

Lots of things:

  • new api version
  • assets changes
  • asset datapoint/event changes
  • asset endpoint changes

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Thank you for contributing to Azure IoT Operations tooling!

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

Intent for Production

  • It is expected that pull requests made to default or core branches such as dev or main are of production grade. Corollary to this, any merged contributions to these branches may be deployed in a public release at any given time. By checking this box, you agree and commit to the expected production quality of code.

Basic expectations

  • If introducing new functionality or modified behavior, are they backed by unit and/or integration tests?
  • In the same context as above are command names and their parameter definitions accurate? Do help docs have sufficient content?
  • Have all the relevant unit and integration tests pass? i.e. pytest <project root> -vv. Please provide evidence in the form of a screenshot showing a succesful run of tests locally OR a link to a test pipeline that has been run against the change-set.
  • Have linter checks passed using the .pylintrc and .flake8 rules? Look at the CI scripts for example usage.
  • Have extraneous print or debug statements, commented out code-blocks or code-statements (if any) been removed from the surface area of changes?
  • Have you made an entry in HISTORY.rst which concisely explains your user-facing feature or change?

Azure IoT Operations CLI maintainers reserve the right to enforce any of the outlined expectations.

A PR is considered ready for review when all basic expectations have been met (or do not apply).

@vilit1 vilit1 requested a review from digimaun as a code owner September 20, 2024 18:04


def generate_base_endpoint(
resource_group_name: Optional[str] = None,
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh no you found it - yes.

will prob move it out after your review

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will fix this in the next pr

asset = self.ops.get(
resource_group_name=resource_group_name, asset_name=asset_name
)
self.update_ops = self.ops
Copy link
Member

Choose a reason for hiding this comment

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

Can you expand on this? It's odd that assets show will set the self.update_ops attribute?

Copy link
Member

@digimaun digimaun Sep 26, 2024

Choose a reason for hiding this comment

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

Reviewing further, looks like non show/list operations assume self.update_ops to be set with the expected operation instance, and the show function is responsible for setting the attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a set up for discovered assets so the same update/list/etc methods can be reused since they share almost all properties.

Flow will be (given a name):

  1. try to get the asset - set the update ops as the asset ops
  2. if 1 fails, try to get the discovered asset - set the update ops as the discovered asset ops
  3. do the update/etc with the update ops

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will update this as I implement/do things with discovered

@vilit1 vilit1 merged commit 018424e into feature/0.7.0 Sep 27, 2024
36 checks passed
@vilit1 vilit1 deleted the feature/adr_cloud_updates branch October 7, 2024 17:40
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