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

Issue warning if glances server version is 2 #105887

Merged
merged 7 commits into from Jan 4, 2024

Conversation

engrbm87
Copy link
Contributor

@engrbm87 engrbm87 commented Dec 17, 2023

Breaking change

Servers running Glances version 2 will be unsupported in 2024.8. We highly recommend that you upgrade to Glances version 3.

Proposed change

  • Issue warning if glances server version 2 is detected.
  • Fail setup if neither version 3 or 2 are detected.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant home-assistant bot added cla-signed deprecation Indicates a breaking change to happen in the future has-tests integration: glances small-pr PRs with less than 30 lines. by-code-owner Quality Scale: No score labels Dec 17, 2023
Copy link
Contributor

@fhoekstra fhoekstra left a comment

Choose a reason for hiding this comment

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

Looks good to me, apart from a small typo.

tests/components/glances/test_init.py Outdated Show resolved Hide resolved
Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

PR looks good imo, but I'm missing some rationale behind this change and a deadline. Why do we want to deprecate V2? Is it EoL (or planned to be soon)? Are there people that can't migrate to V3?

homeassistant/components/glances/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/glances/__init__.py Outdated Show resolved Hide resolved
tests/components/glances/test_init.py Outdated Show resolved Hide resolved
tests/components/glances/test_init.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft December 26, 2023 13:28
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@engrbm87
Copy link
Contributor Author

PR looks good imo, but I'm missing some rationale behind this change and a deadline. Why do we want to deprecate V2? Is it EoL (or planned to be soon)? Are there people that can't migrate to V3?

There are multiple changes in the data provided by glances api between v2 server and v3 server. From the library side it is hard to maintain compatibility for both versions more details here.
I am not sure how many users are still using Glances V2 but for the add-on available in HASS this has been updated to v3 long ago.

@fhoekstra
Copy link
Contributor

fhoekstra commented Dec 26, 2023

EDIT: I was wrong, the 0.5.0 version of the API wrapper library does not remove Glances v2 support yet.

Glances does not seem to have any form of extended support: bug fixes are pushed to the latest release only, it seems.

https://glances.readthedocs.io/en/latest/support.html

@joostlek I understand that we want the HA platform to be stable and want to handle deprecations with advance notice. Not breaking users' setups is very important.

Glances v3.0 was released in Sept 2018

The breaking changes in Glances v3 should not prohibit anyone from upgrading
Even Python 2.7 was still supported, only Python 3.3 support was dropped.

The number of Home Assistant users that is still on Glances v2 is probably very small, if not zero.

The Glances v2 deprecation is introduced in v0.5.0 of the glances API wrapper package, which is currently merged in dev. Delaying this change would also delay the features that are currently in progress that have been requested by a few HA users.

I am not able to judge if these reasons are good enough to break the rule of pre-announcing deprecations, but given that we should have deprecated v2 long ago, this might be worth an exception, maybe.

I don't have a strong opinion on this, and am not a maintainer but I hope this gives you some additional context.

@joostlek
Copy link
Member

Ah understood. Let me try to ask some others what they think about it

@engrbm87 engrbm87 marked this pull request as ready for review December 28, 2023 09:45
homeassistant/components/glances/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/glances/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/glances/__init__.py Show resolved Hide resolved
homeassistant/components/glances/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/glances/strings.json Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft December 28, 2023 12:58
@engrbm87 engrbm87 marked this pull request as ready for review December 29, 2023 07:00
@home-assistant home-assistant bot marked this pull request as draft December 30, 2023 00:55
@engrbm87 engrbm87 marked this pull request as ready for review December 30, 2023 09:28
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Thanks!

@MartinHjelmare
Copy link
Member

Please copy some of the explanations about the deprecation to the breaking change paragraph in the PR description.

@MartinHjelmare
Copy link
Member

We should update the docs about supported version too.

https://www.home-assistant.io/integrations/glances/

@engrbm87
Copy link
Contributor Author

engrbm87 commented Jan 3, 2024

@MartinHjelmare should we include this PR in this month's release?

@MartinHjelmare
Copy link
Member

I think it's ok to wait until the February release. Users may see the warning in the log and that's ok, I think.

@MartinHjelmare MartinHjelmare merged commit 2331f89 into home-assistant:dev Jan 4, 2024
23 checks passed
@engrbm87 engrbm87 deleted the glances-v2-issue branch January 4, 2024 07:21
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
by-code-owner cla-signed deprecation Indicates a breaking change to happen in the future has-tests integration: glances Quality Scale: No score small-pr PRs with less than 30 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants