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

Add automatic check for server version when instantiating client #51

Merged
merged 8 commits into from
Jan 21, 2023

Conversation

bachya
Copy link
Owner

@bachya bachya commented Jan 20, 2023

Describe what the PR does:

linkding recently released a version that adds a /health API endpoint (sissbruecker/linkding#392). This allows us to ensure this library complies with a minimum required linkding version.

The breaking change is because the client instantiation process has changed—we now do the following:

from aiolinkding import async_get_client

client = await async_get_client(...)

...instead of:

from aiolinkding import Client

client = await Client(...)

A few notes:

  • We technically still support the old method of instantiating the object directly, so this isn't an actual breaking change. I'm merely marking it as such because I want people to see the release notes and use the new method.
  • We only check the server version when instantiating the client; I don't currently see the need for checking before every API request.

Does this fix a specific issue?

N/A

Checklist:

  • Confirm that one or more new tests are written for the new functionality.
  • Run tests and ensure everything passes (with 100% test coverage).
  • Update README.md with any new documentation.

@bachya bachya added the breaking-change A breaking change for existing users label Jan 20, 2023
@bachya bachya self-assigned this Jan 20, 2023
@codecov
Copy link

codecov bot commented Jan 20, 2023

Codecov Report

Merging #51 (b1aac8f) into dev (e720263) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##               dev       #51   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          103       123   +20     
=========================================
+ Hits           103       123   +20     
Impacted Files Coverage Δ
aiolinkding/__init__.py 100.00% <100.00%> (ø)
aiolinkding/client.py 100.00% <100.00%> (ø)
aiolinkding/errors.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bachya bachya marked this pull request as ready for review January 21, 2023 17:32
aiolinkding/client.py Outdated Show resolved Hide resolved
@codeclimate
Copy link

codeclimate bot commented Jan 21, 2023

Code Climate has analyzed commit b1aac8f and detected 0 issues on this pull request.

View more on Code Climate.

@bachya bachya merged commit b05626f into dev Jan 21, 2023
@bachya bachya deleted the version-check branch January 21, 2023 19:47
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change A breaking change for existing users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant