X Tutup
Skip to content

chore(api): move repository endpoints into separate module#1347

Merged
max-wittig merged 1 commit intomasterfrom
chore/split-repository-methods
Feb 28, 2021
Merged

chore(api): move repository endpoints into separate module#1347
max-wittig merged 1 commit intomasterfrom
chore/split-repository-methods

Conversation

@nejch
Copy link
Member

@nejch nejch commented Feb 28, 2021

Prep work for #1306 because projects.py is getting bloated again already (I'm splitting this into two PRs just for clarity).

I noticed all the /repository/ endpoints were just kind of slapped into the project manager as custom methods. For now this just splits the methods into a separate Mixin, but perhaps later namespacing them with a separate manager would make it cleaner:

project.repository.tree()
project.repository.blob()
project.repository.compare()
project.repository.contributors()
# ...

The old methods could then just call the manager, and maybe raise a deprecation warning.
WDYT @max-wittig would that make sense? I'd open a follow-up later for the repository manager.

@codecov-io
Copy link

Codecov Report

Merging #1347 (1ed154c) into master (5bc158d) will increase coverage by 0.02%.
The diff coverage is 58.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1347      +/-   ##
==========================================
+ Coverage   80.19%   80.21%   +0.02%     
==========================================
  Files          72       73       +1     
  Lines        3786     3790       +4     
==========================================
+ Hits         3036     3040       +4     
  Misses        750      750              
Flag Coverage Δ
unit 80.21% <58.33%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
gitlab/v4/objects/repositories.py 56.89% <56.89%> (ø)
gitlab/v4/objects/projects.py 73.09% <100.00%> (+3.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bc158d...1ed154c. Read the comment docs.

@max-wittig
Copy link
Member

I guess we don't need the depreciation warning. The next release is gonna be called 3.0.0 anyway. We already did a couple of breaking changes and that would make more sense, instead of maintaining the old behaviour. We're just a small library. People who don't want to switch can stay on the 2.X version.

@max-wittig
Copy link
Member

Looks very good!

@max-wittig max-wittig merged commit d8b8a0a into master Feb 28, 2021
@max-wittig max-wittig deleted the chore/split-repository-methods branch February 28, 2021 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup