-
Notifications
You must be signed in to change notification settings - Fork 5
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
Record difference in translation progress #60
Conversation
I think that checking out commits from a month ago in CPython and language repos and calculating the progress for back then in the main script loop would be more reliable. This way we don't rely on JSON, and always show exactly one month time window, without “jumps”. Also I'm thinking we could present it in the main table as a light-green ending of the progress bar. |
It could be implemented by checking out the month-ago commits after line 72: Line 72 in 6f54f9a
And then calling |
Has the json failed yet? We can store the current progress at the start of the month and then just calculate the difference, it would be a lot faster. As for html integration I’m looking for suggestions. (Current changes are temporary) Also we should consider slimming down some columns, it looks not great on mobile. ideas:
|
We would introduce a dependency on already generated data, which makes the script less portable. By the way, I plan to remove also such dependency in #58 in favor of using already cloned repositories. Moving window would not make the difference "reset" at every month beginning, it would express "the same" no matter the day of month. Also in case of changing methodology of calculating the progress in script, the difference wouldn't be confusing.
The repositories are already cloned (with a full depth), the checkouts will be much faster than cloning. Though merging will still happen, so there indeed will be some performance penalty. |
Ok I will convert it then! |
Weird...
it switches but yet still the completion is calculated the same. Any ideas @m-aciek |
From logs it looks like it gets the HEAD commit for each clone instead of from month ago for some reason. For example for PL it gets f55af47, which is the latest commit. |
I'll try a different method then. |
Everything works now. I'll merge this an then we can work out where to put this in the ui (we will have more room to work with after #61) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on it! I've left some comments.
Co-authored-by: Maciej Olko <maciej.olko@gmail.com>
All done :-) |
This comment was marked as outdated.
This comment was marked as outdated.
Index: completion.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/completion.py b/completion.py
--- a/completion.py (revision 37c6b38c2fafd4d8ffebeed66516cb561fb38001)
+++ b/completion.py (date 1739748865687)
@@ -26,7 +26,7 @@
clone_path = Path(clones_dir, repo)
for branch in branches_from_devguide(Path(clones_dir, 'devguide')) + ['master']:
try:
- git.Repo.clone_from(
+ clone_repo = git.Repo.clone_from(
f'https://github.com/{repo}.git', clone_path, branch=branch
)
except git.GitCommandError:
@@ -49,9 +49,8 @@
if completion:
# Fetch commit from before 30 days ago and checkout
- repo = git.Repo(clone_path)
- commit = next(repo.iter_commits('HEAD', max_count=1, before='30 days ago'))
- repo.git.checkout(commit.hexsha)
+ commit = next(clone_repo.iter_commits('HEAD', max_count=1, before='30 days ago'))
+ clone_repo.git.checkout(commit.hexsha)
with TemporaryDirectory() as tmpdir:
month_ago_completion = potodo.merge_and_scan_path(
clone_path, I also realized we have the repo object earlier in the scope, so we can assign the variable earlier. |
Check out repository from 30 days ago and compare translation progress between the two. This PR adds the data to the json but it's home in the table is up for discussion and to be done in another PR by someone more creative and better at design then me!
📚 Documentation preview 📚: https://pydocs-translation-dashboard--60.org.readthedocs.build/
📊 Dashboard preview 📊: https://python-docs-translations.github.io/dashboard/60/merge/