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

Support downloading archive subpaths#2199

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

Merged
nejch merged 1 commit intopython-gitlab:mainfromorf:patch-1
Jul 29, 2022
Merged

Support downloading archive subpaths#2199

nejch merged 1 commit intopython-gitlab:mainfromorf:patch-1
Jul 29, 2022

Conversation

@orf
Copy link

@orforf commentedJul 28, 2022

https://docs.gitlab.com/ee/api/repositories.html#get-file-archive

The archive endpoint supports apath argument. This change adds support for it.

@JohnVillalovosJohnVillalovosenabled auto-merge (rebase)July 28, 2022 17:22
@JohnVillalovos
Copy link
Member

@orf Thanks for the contribution!

Copy link
Member

@JohnVillalovosJohnVillalovos left a comment

Choose a reason for hiding this comment

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

Looks like conflict with the pre-existingpath variable.

@nejch
Copy link
Member

@JohnVillalovos for later: we could potentially also prefix these internal python-gitlab variables in the mixins and custom methods to always avoid clashes with GitLab API attributes. So this would be_path here for example. Not sure how ugly that would get.

@orf sometimes our variables happen to overlap with upstream API attributes hence the suggestion.

diff --git a/gitlab/v4/objects/repositories.py b/gitlab/v4/objects/repositories.pyindex 8f99e5d..b8dbdd8 100644--- a/gitlab/v4/objects/repositories.py+++ b/gitlab/v4/objects/repositories.py@@ -229,16 +229,16 @@ class RepositoryMixin(_RestObjectBase):         Returns:             The binary data of the archive         """-        path = f"/projects/{self.encoded_id}/repository/archive"+        url_path = f"/projects/{self.encoded_id}/repository/archive"         if format:-            path += "." + format+            url_path += "." + format         query_data = {}         if sha:             query_data["sha"] = sha         if path is not None:             query_data["path"] = path         result = self.manager.gitlab.http_get(-            path, query_data=query_data, raw=True, streamed=streamed, **kwargs+            url_path, query_data=query_data, raw=True, streamed=streamed, **kwargs         )         if TYPE_CHECKING:             assert isinstance(result, requests.Response)

@orf
Copy link
Author

orf commentedJul 29, 2022

Thank you both! I've applied your suggestions 🙏

nejch reacted with hooray emoji

@nejch
Copy link
Member

I guess we can get this one in, I hope you don't mind@JohnVillalovos ;)

@orf thanks again! I think I recognized your username from the loguru saga, fun popcorn material. :)

@nejchnejch merged commit5e1df65 intopython-gitlab:mainJul 29, 2022
@orforf deleted the patch-1 branchJuly 29, 2022 12:50
@JohnVillalovos
Copy link
Member

I guess we can get this one in, I hope you don't mind@JohnVillalovos ;)

Thanks for reviewing it@nejch !

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

Reviewers

@JohnVillalovosJohnVillalovosJohnVillalovos requested changes

@nejchnejchnejch approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@orf@JohnVillalovos@nejch

[8]ページ先頭

©2009-2025 Movatter.jp