Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: makeGitlab.http_request() a private method#1842

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
JohnVillalovos wants to merge1 commit intomainfromjlvillal/http_request

Conversation

JohnVillalovos
Copy link
Member

ConvertGitlab.http_request() toGitlab._http_request() to signify
it is a private/protected method so that users of the library know
they should not use the method and we make no API stability promises
for using it.

Add aGitlab.http_request() method which will issue a Deprecation
warning when called. It will pass the call onto
Gitlab._http_request()

Also, in the interest of improving code read-ability, require keyword
arg usage when callingGitlab._http_request()

Convert `Gitlab.http_request()` to `Gitlab._http_request()` to signifyit is a private/protected method so that users of the library knowthey should not use the method and we make no API stability promisesfor using it.Add a `Gitlab.http_request()` method which will issue a Deprecationwarning when called. It will pass the call onto`Gitlab._http_request()`Also, in the interest of improving code read-ability, require keywordarg usage when calling `Gitlab._http_request()`
@JohnVillalovosJohnVillalovos marked this pull request as draftJanuary 15, 2022 02:59
@codecov-commenter
Copy link

Codecov Report

Merging#1842 (baaba22) intomain (a1dbe86) willincrease coverage by0.00%.
The diff coverage is100.00%.

@@           Coverage Diff           @@##             main    #1842   +/-   ##=======================================  Coverage   92.26%   92.27%           =======================================  Files          77       77             Lines        4849     4853    +4     =======================================+ Hits         4474     4478    +4  Misses        375      375
FlagCoverage Δ
cli_func_v481.26% <77.77%> (-0.03%)⬇️
py_func_v480.23% <77.77%> (-0.03%)⬇️
unit83.30% <100.00%> (+0.01%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

Impacted FilesCoverage Δ
gitlab/client.py90.64% <100.00%> (+0.09%)⬆️
gitlab/mixins.py91.50% <0.00%> (ø)
gitlab/v4/objects/files.py100.00% <0.00%> (ø)

Comment on lines +622 to +625
warnings.warn(
"The Gitlab.http_request() method is deprecated and will be removed in a "
"future version. This is a private method and should not be used.",
DeprecationWarning,
Copy link
Member

@nejchnejchJan 16, 2022
edited
Loading

Choose a reason for hiding this comment

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

One thing about this method is that it provides a way for users to do stuff we haven't implemented (or perhaps even won't, if it's super specific). So I would maybe not be so strict about "should not be used". I would maybe say that API stability can't be guaranteed or something similar.

Edit: I've now checked a bit, because I was thinking the same that we should hide a bit more of the interface. But when looking at the original author's initial implementation, I think this might have been a deliberate choice and the distinction was more of a higher vs. lower-level API. At least what I can see from the commit message and how it was done with other private methods that were not meant to be consumed, see:c5ad540.

Multiple goals:

  • Support making direct queries to the Gitlab server, without objects
    and managers.

So I've started working on some docs to cover use cases here:#1846
It's a rough draft just for discussion on this, the wording and terminology is probably off and obviously "high/mid/low" can be changed to include "internal" or so.. but I think at least we should not take something away completely, unless we can cover those use cases in other ways. :)

Some use cases I vaguely remember from issues include using HEAD to check file existence/size, getting headers from the server's response, and so on. I documented some of that.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with@nejch here. It's also useful for new functionality in the GitLab API.

So let's tone the message down a bit.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@max-wittigmax-wittigmax-wittig left review comments

@nejchnejchnejch left review comments

Copilot code reviewCopilotAwaiting requested review from CopilotCopilot will automatically review once the pull request is marked ready for review

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@JohnVillalovos@codecov-commenter@max-wittig@nejch

[8]ページ先頭

©2009-2025 Movatter.jp