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

feat: add support for merge_base API#2236

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
JohnVillalovos merged 1 commit intomainfromfeat/merge-base
Aug 19, 2022
Merged

Conversation

nejch
Copy link
Member

Closes#1495
Replaces#1577
Depended on#1699

@codecov-commenter
Copy link

Codecov Report

Merging#2236 (39cca82) intomain (3f91d24) willincrease coverage by0.00%.
The diff coverage is100.00%.

@@           Coverage Diff           @@##             main    #2236   +/-   ##=======================================  Coverage   95.43%   95.44%           =======================================  Files          81       81             Lines        5369     5375    +6     =======================================+ Hits         5124     5130    +6  Misses        245      245
FlagCoverage Δ
api_func_v481.39% <100.00%> (+0.03%)⬆️
cli_func_v483.05% <57.14%> (-0.04%)⬇️
unit87.23% <57.14%> (-0.05%)⬇️

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

Impacted FilesCoverage Δ
gitlab/v4/objects/repositories.py83.56% <100.00%> (+1.47%)⬆️

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.

@nejch Looks good to me. Left a comment, but for sure could be something we don't do or do later.

This is approved, feel free to merge with my blessing!

@exc.on_http_error(exc.GitlabGetError)
def repository_merge_base(
self, refs: List[str], **kwargs: Any
) -> Union[Dict[str, Any], requests.Response]:

Choose a reason for hiding this comment

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

This made me think if we should start forcing these to just be aDict?

Copy link
MemberAuthor

@nejchnejchAug 16, 2022
edited
Loading

Choose a reason for hiding this comment

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

Thanks@JohnVillalovos! Makes sense to me! I was looking at doing this via overloadinghttp_get/http_request to narrow the types there already, depending on the streamed/raw arguments but it got a bit out of hand. Then I think we wouldn't need to do it in "downstream" methods, IIUC. I will look into it again :)

But it requires quite a few overloads for all the possible signatures. This is what I was looking athttps://medium.com/analytics-vidhya/making-sense-of-typing-overload-437e6deecade.

custom_types={"refs": types.ArrayAttribute},
transform_data=True,
)
return self.manager.gitlab.http_get(path, query_data=query_data, **kwargs)

Choose a reason for hiding this comment

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

To force it to be aDict I think could do this:

Suggested change
returnself.manager.gitlab.http_get(path,query_data=query_data,**kwargs)
result=self.manager.gitlab.http_get(path,query_data=query_data,raw=False,streamed=False,**kwargs)
ifTYPE_CHECKING:
assertisinstance(result,dict)
returnresult

@JohnVillalovosJohnVillalovos merged commitdd4fbd5 intomainAug 19, 2022
@JohnVillalovosJohnVillalovos deleted the feat/merge-base branchAugust 19, 2022 23:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JohnVillalovosJohnVillalovosJohnVillalovos 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.

No merge_base API support while GitLab v4 API has.
3 participants
@nejch@codecov-commenter@JohnVillalovos

[8]ページ先頭

©2009-2025 Movatter.jp