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

feat: extend craft_application.git module #576

Merged

Conversation

dariuszd21
Copy link
Contributor

@dariuszd21 dariuszd21 commented Dec 2, 2024

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run tox?

Add ability to manipulate repository and get additional data through GitRepo class:

  • set_remote_url / set_remote_push_url alongside get counterparts (also set_no_push for disabling push for specific remotes)
  • is_commit(), is_short_commit checkers
  • use craft.git for subprocess git operation if available
  • get_last_commit() to retrieve last commit on the current HEAD
  • fetch() API to retrieve remote references

Linter issues fixed in #580

(CRAFT-3708)

@dariuszd21 dariuszd21 changed the title feat: extend craft_application module feat: extend craft_application.git module Dec 2, 2024
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.89%. Comparing base (0705676) to head (3b453f1).
Report is 317 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (0705676) and HEAD (3b453f1). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (0705676) HEAD (3b453f1)
2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #576      +/-   ##
==========================================
- Coverage   99.28%   90.89%   -8.40%     
==========================================
  Files          29       64      +35     
  Lines        1265     3744    +2479     
  Branches      209      411     +202     
==========================================
+ Hits         1256     3403    +2147     
- Misses          6      273     +267     
- Partials        3       68      +65     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dariuszd21 dariuszd21 requested review from lengau and tigarmo December 3, 2024 21:09
@dariuszd21 dariuszd21 marked this pull request as ready for review December 3, 2024 21:10
@tigarmo
Copy link
Contributor

tigarmo commented Dec 4, 2024

@dariuszd21 can you point out the code that hasn't been reviewed yet?

@dariuszd21 dariuszd21 force-pushed the work/CRAFT-3708-upstream-git-changes branch from 43d1da6 to f3f5cd8 Compare December 4, 2024 18:57
@dariuszd21
Copy link
Contributor Author

@dariuszd21 can you point out the code that hasn't been reviewed yet?

Sure, it will be all, but the first commit so:
get_last_commit() and get_last_commit_on_branch_or_tag() , changelog, integration tests for set_url and set_push_url, unit tests for fetch and few error cases for already tested APIs.
I'll mark snippets in the diff section

Copy link
Contributor Author

@dariuszd21 dariuszd21 left a comment

Choose a reason for hiding this comment

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

I marked where is a code that wasn't already reviewed for clarity

docs/reference/changelog.rst Show resolved Hide resolved
tests/integration/git/test_git.py Show resolved Hide resolved
craft_application/git/_git_repo.py Show resolved Hide resolved
craft_application/git/_git_repo.py Outdated Show resolved Hide resolved
craft_application/git/_git_repo.py Show resolved Hide resolved
tests/unit/git/test_git.py Show resolved Hide resolved
tests/unit/git/test_git.py Outdated Show resolved Hide resolved
tests/unit/git/test_git.py Outdated Show resolved Hide resolved
tests/unit/git/test_git.py Outdated Show resolved Hide resolved
tests/unit/git/test_git.py Outdated Show resolved Hide resolved
Copy link
Contributor

@tigarmo tigarmo left a comment

Choose a reason for hiding this comment

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

thanks for pointing out the new changes!

docs/reference/changelog.rst Show resolved Hide resolved
docs/reference/changelog.rst Outdated Show resolved Hide resolved
docs/reference/changelog.rst Outdated Show resolved Hide resolved
docs/reference/changelog.rst Outdated Show resolved Hide resolved
docs/reference/changelog.rst Outdated Show resolved Hide resolved
@dariuszd21 dariuszd21 requested a review from medubelko December 5, 2024 18:55
Copy link
Contributor

@medubelko medubelko left a comment

Choose a reason for hiding this comment

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

Some minor suggestions.

docs/reference/changelog.rst Outdated Show resolved Hide resolved
docs/reference/changelog.rst Outdated Show resolved Hide resolved
@dariuszd21
Copy link
Contributor Author

Some minor suggestions.

Thank you, applied you suggestions !

Copy link
Contributor

@lengau lengau left a comment

Choose a reason for hiding this comment

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

Nice! Thank you!

@lengau lengau merged commit 3a3992b into canonical:main Dec 5, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants