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

gather git history for translations #3183

Merged
merged 4 commits into from
Mar 11, 2021

Conversation

fiji-flo
Copy link
Contributor

No description provided.

@fiji-flo fiji-flo requested a review from peterbe March 10, 2021 17:04
@peterbe
Copy link
Contributor

peterbe commented Mar 10, 2021

Now that there are so many files written, the loudness of printing each one and the green makes it quite "useless".
Screen Shot 2021-03-10 at 3 27 17 PM

Would you mind doing something similar to what we did for node tool/cli.js spas
So perhaps it can simply just print out:

Wrote 29 _githistory.json files

Copy link
Contributor

@peterbe peterbe left a comment

Choose a reason for hiding this comment

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

Not sure if it's a nit or not but would you mind tuning the CLI output as mentioned in the comment above?

I knew this landed about 8h ago. So I would expect it to say "2021/03/10" in some French i18n formatting.
But instead I get:
Screen Shot 2021-03-10 at 3 37 57 PM

But then it hit me! Julien merged it 8h ago, but the author authored it about 10 days ago.
So it really makes me wonder if we're doing the right thing.
From a reader's point of view, they see "Feb 28" on there but that's not relevant or interesting because the content is different today compared to yesterday.
I think we should look into use the merge date instead of the commit date. Separate issue for sure but it's relevant. I'll file something.

I noticed that the _githistory.json file, for fr, is full of entries for every single old name. E.g.

  "fr/accessibilité/aperçu_d_applications_web_et_de_composants_dynamiques_accessibles/index.html": {
    "modified": "2020-12-08T19:40:17.000Z",
    "hash": "33058f2b292b3a581333bdfb21b8f671898c5060"
  },
  "fr/accessibilité/aria/comment_deposer_un_bug_lie_a_aria/index.html": {
    "modified": "2020-12-08T19:40:17.000Z",
    "hash": "33058f2b292b3a581333bdfb21b8f671898c5060"
  },

These names will never be useful. I don't know if it's worth optimizing for but we could kill/bail the git log loop for anything older than 2021/02/11 because anything before the first en-slug sync is never going to match.

Also, don't forget to add _githistory.json to the .gitigore in mdn/translated-content.

@peterbe
Copy link
Contributor

peterbe commented Mar 10, 2021

I filed #3189 as a followup.

@fiji-flo fiji-flo requested a review from peterbe March 11, 2021 06:16
tool/cli.js Outdated Show resolved Hide resolved
Copy link
Contributor

@peterbe peterbe left a comment

Choose a reason for hiding this comment

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

With nit.

fiji-flo and others added 2 commits March 11, 2021 18:07
Co-authored-by: Peter Bengtsson <[email protected]>
@fiji-flo fiji-flo merged commit 8d35451 into mdn:main Mar 11, 2021
peterbe pushed a commit to peterbe/yari that referenced this pull request Jun 1, 2021
* gather git history for translations

* less noise

* Update tool/cli.js

Co-authored-by: Peter Bengtsson <[email protected]>

* prettier

Co-authored-by: Peter Bengtsson <[email protected]>
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.

2 participants