Skip to content

#158 - BE - Submit with git #323

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

Merged
merged 10 commits into from
Oct 7, 2021
Merged

#158 - BE - Submit with git #323

merged 10 commits into from
Oct 7, 2021

Conversation

gal432
Copy link
Member

@gal432 gal432 commented Oct 3, 2021

No description provided.

Co-authored-by: Sourcery AI <>
@codecov
Copy link

codecov bot commented Oct 3, 2021

Codecov Report

Merging #323 (d61b301) into master (f18eeca) will increase coverage by 0.64%.
The diff coverage is 96.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #323      +/-   ##
==========================================
+ Coverage   83.37%   84.02%   +0.64%     
==========================================
  Files          61       62       +1     
  Lines        2683     2823     +140     
==========================================
+ Hits         2237     2372     +135     
- Misses        446      451       +5     
Impacted Files Coverage Δ
lms/lmsweb/git_service.py 95.65% <95.65%> (ø)
lms/lmsweb/__init__.py 97.67% <100.00%> (+1.12%) ⬆️
lms/lmsweb/routes.py 100.00% <100.00%> (ø)
lms/lmsweb/views.py 92.94% <100.00%> (+0.14%) ⬆️
lms/models/upload.py 94.00% <100.00%> (+0.25%) ⬆️

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 f18eeca...d61b301. Read the comment docs.

@gal432 gal432 linked an issue Oct 3, 2021 that may be closed by this pull request
@gal432 gal432 changed the title #158 - Submit with git #158 - BE - Submit with git Oct 3, 2021
@gal432 gal432 marked this pull request as ready for review October 3, 2021 15:09
@gal432 gal432 requested a review from yammesicka October 3, 2021 15:09
@yammesicka
Copy link
Member

Awesome work! I've added few insights :)

@gal432 gal432 requested review from yammesicka and orronai October 4, 2021 09:30
@gal432 gal432 requested a review from yammesicka October 5, 2021 13:44
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 5, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.18%.

Quality metrics Before After Change
Complexity 2.63 ⭐ 2.58 ⭐ -0.05 👍
Method Length 38.23 ⭐ 38.30 ⭐ 0.07 👎
Working memory 6.86 🙂 6.87 🙂 0.01 👎
Quality 78.74% 78.92% 0.18% 👍
Other metrics Before After Change
Lines 1044 1093 49
Changed files Quality Before Quality After Quality Change
lms/lmsweb/init.py 54.82% 🙂 64.84% 🙂 10.02% 👍
lms/lmsweb/routes.py 99.50% ⭐ 99.00% ⭐ -0.50% 👎
lms/lmsweb/views.py 74.73% 🙂 74.72% 🙂 -0.01% 👎
lms/models/upload.py 70.62% 🙂 72.30% 🙂 1.68% 👍
tests/conftest.py 91.28% ⭐ 91.35% ⭐ 0.07% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
lms/lmsweb/views.py comment 13 🙂 202 😞 8 🙂 50.15% 🙂 Try splitting into smaller methods
lms/lmsweb/views.py view 8 ⭐ 140 😞 10 😞 56.16% 🙂 Try splitting into smaller methods. Extract out complex expressions
lms/lmsweb/views.py login 5 ⭐ 129 😞 12 😞 56.69% 🙂 Try splitting into smaller methods. Extract out complex expressions
lms/lmsweb/views.py note 6 ⭐ 144 😞 8 🙂 61.90% 🙂 Try splitting into smaller methods
lms/models/upload.py _upload_to_db 6 ⭐ 97 🙂 10 😞 63.48% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

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

Awesome job. 2 Non blocking comments

@@ -67,3 +67,5 @@ LIMITS_PER_HOUR = 50

# Change password settings
MAX_INVALID_PASSWORD_TRIES = 5

REPOSITORY_FOLDER = os.getenv("REPOSITORY_FOLDER", os.path.abspath(os.path.join(os.curdir, "repositories")))
Copy link
Member

Choose a reason for hiding this comment

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

Non-blocking: Our code doesn't have >79 chars lines, so if you can split it to 2 pathes it'll be great.

DEFAULT_REPOSITORY_FOLDER = (Path() / "repositories").resolve()
REPOSITORY_FOLDER = os.getenv("REPOSITORY_FOLDER", DEFAULT_REPOSITORY_FOLDER)

import subprocess # noqa: S404
import tempfile
import typing
import pathlib
Copy link
Member

Choose a reason for hiding this comment

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

p should appear after os and before shutil

@gal432 gal432 merged commit 0e38fb9 into master Oct 7, 2021
@gal432 gal432 deleted the feature/publish-with-git branch October 7, 2021 15:56
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.

Allow importing exercises from a git repository
3 participants