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

Fix sync - updating source string from VCS not working #3506

Merged
merged 5 commits into from
Jan 14, 2025

Conversation

haodave
Copy link
Contributor

@haodave haodave commented Jan 3, 2025

After source string changed in the git repo, a project sync won't update the source string in the Pontoon project. Tested with a json formatted source file.

@flodolo
Copy link
Collaborator

flodolo commented Jan 3, 2025

Can you add more details on the issue/behavior you're trying to fix, so that it can be reproduced?

Copy link
Member

@eemeli eemeli left a comment

Choose a reason for hiding this comment

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

This needs to include a test case that fails with the current code, but passes with the changes. It's not at all clear what entity change is not getting picked up by the current code.

There are also two parts to this change: How differences are identified, and whether the previous or next entity is used in Entity.objects.bulk_update(). Are both changes required?

pontoon/sync/core/entities.py Show resolved Hide resolved
pontoon/sync/core/entities.py Show resolved Hide resolved
@flodolo
Copy link
Collaborator

flodolo commented Jan 10, 2025

As mentioned, can you clarify the behavior you're trying to fix?

Do you have a specific example (ideally a minimal case) of what is not working and with what content?

@haodave
Copy link
Contributor Author

haodave commented Jan 10, 2025

As mentioned, can you clarify the behavior you're trying to fix?

Do you have a specific example (ideally a minimal case) of what is not working and with what content?

Yes. I updated the PR description earlier. Here are more details of the behavior:

  1. In the source file en.json, update "key": "value" to "key": "value2" with a PR.
  2. Sync the Pontoon project.
  3. The source string in the Pontoon project translation page should have been changed from value to value2 but it's not.

@mathjazz
Copy link
Collaborator

I was able to reproduce the problem in mozilla-l10n/pontoon-test@bcad647.

@eemeli
Copy link
Member

eemeli commented Jan 13, 2025

@haodave Could you allow edits from maintainers for this branch, or pick up the additional changes from here? I added a test case for this, and applied a couple of other minor fixes. Once that's done, this should be good to merge.

@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.18%. Comparing base (158597c) to head (f938280).
Report is 1 commits behind head on main.

Additional details and impacted files

@haodave haodave force-pushed the fix/update-source-string-from-repo branch from cea209a to f938280 Compare January 14, 2025 08:33
@mathjazz mathjazz merged commit a880d3d into mozilla:main Jan 14, 2025
2 checks passed
@haodave haodave deleted the fix/update-source-string-from-repo branch January 16, 2025 07:02
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.

Source string changes are not being picked up by sync
5 participants