[SAC] [OSGeo] #2981: Weblate grass project not updating

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone: Sysadmin Contract 2023-II
Component: Systems Admin | Keywords:
---------------------------+---------------------------------------
It seems even though Grass project is set to use Github Pull Request, it
is not doing it.

On closer inspection, looking at https://weblate.osgeo.org/projects/grass-
gis/grasslibs/#repository

I see a notice:

{{{
On branch main
Your branch and 'origin/main' have diverged,
and have 11 and 4 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)

nothing to commit, working tree clean
}}}

and

{{{
  0 pending changes

This will commit any pending changes present in Weblate and not in the
repository.
11 outgoing commits

This will push changes and create a GitHub pull request.
4 missing commits

This will update the Weblate repository with the upstream changes.
}}}

So the issue is that the local weblate repo and grass repo have diverged
for some reason.
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981&gt;
OSGeo <Gter - OSGeo;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+----------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone: Sysadmin Contract 2023-II
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+----------------------------------------
Comment (by robe):

Okay I clicked the update button in weblate here -

Now I see this pull request. It might have gotten out of sync because the
pull request was done a while ago and hadn't been accepted yet.

https://github.com/OSGeo/grass/pull/3065

@neteler, if this looks okay to you, can you go ahead and accept, and that
might just fix it moving forward.

I think the way weblate works, it can have only one outstanding pull
request and just keeps adding to that one, and may freeze submission if it
feels it's original is getting too out of sync.
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:1&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+----------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone: Sysadmin Contract 2023-II
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+----------------------------------------
Comment (by robe):

I am bummed the author is still showing weblate. Might be I have a
mistake or because it had those already committed to it's local git repo,
it couldn't change the committer. I'm hoping the latter.
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:2&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+----------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone: Sysadmin Contract 2023-II
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+----------------------------------------
Comment (by robe):

the osgeoweblate fork looks updated now -
https://github.com/osgeoweblate/grass/tree/weblate-grass-gis-grasslibs
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:3&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+----------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone: Sysadmin Contract 2023-II
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+----------------------------------------
Comment (by neteler):

Replying to [comment:1 robe]:
> Now I see this pull request. It might have gotten out of sync because
the pull request was done a while ago and hadn't been accepted yet.
>
> https://github.com/OSGeo/grass/pull/3065
>
> @neteler, if this looks okay to you, can you go ahead and accept, and
that might just fix it moving forward.

Yeah - seems we didn't know that keeping it open for collecting more
translations generates troubles at this end.

> I think the way weblate works, it can have only one outstanding pull
request and just keeps adding to that one, and may freeze submission if it
feels it's original is getting too out of sync.

I see - good to know.
I have triggered the CI in the PR 3065 so that it passes for merging. I'll
keep an eye on it.
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:4&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: closed
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution: fixed
Keywords: |
---------------------------+---------------------------------------
Changes (by robe):

* status: new => closed
* resolution: => fixed
* milestone: Sysadmin Contract 2023-II => Sysadmin Contract 2023-I

Comment:

okay will close this out. Feel free to open if you find it's still an
issue.
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:5&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Changes (by neteler):

* status: closed => reopened
* resolution: fixed =>

Comment:

There seems to be a new issue:

Now, updating its repo fails with

{{{
Rebasing (1/11)
error: could not apply 96fa6b652... Translated using Weblate (Russian)
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase
--abort".
Could not apply 96fa6b652... Translated using Weblate (Russian)
Auto-merging locale/po/grasslibs_ru.po
CONFLICT (content): Merge conflict in locale/po/grasslibs_ru.po
  (1)
}}}

Reported in:
https://github.com/OSGeo/grass/pull/3065#issuecomment-1715057905
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:6&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by robe):

Okay will look at this later today.
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:7&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by robe):

Okay setting up the hook as discussed in pull request and you did is the
first step.
For the remaining issue I went here:

https://weblate.osgeo.org/projects/grass-gis/#repository

and chose "Update with merge without fast-forward". Was the only one I
could choose short of getting into the weblate git repo and trying to
guess how to merge.

So that created another pull request here -
https://github.com/OSGeo/grass/pull/3151
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:8&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by hcho):

@robe Thanks! I think that worked. You said "pushes happen on every commit
to your repo" in
https://github.com/OSGeo/grass/pull/3065#issuecomment-1716446226. Does it
mean pushes from GitHub to Weblate, not the other way around?
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:9&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by robe):

Replying to [comment:9 hcho]:
> @robe Thanks! I think that worked. You said "pushes happen on every
commit to your repo" in
https://github.com/OSGeo/grass/pull/3065#issuecomment-1716446226. Does it
mean pushes from GitHub to Weblate, not the other way around?

Yes when you make a commit on github, it calls the webhook on weblate
which triggers a refresh of weblate's git copy of your repo.

As far as pushing back, I think there is a setting in weblate for that and
defaults to something like 24 hrs, though you can tweak that setting. I
think that just prevents pushes happening constantly while someone is
editing on weblate. It's probably less of a concern when in pull request
mode.

I think something might still be wrong, cause I'm seeing missing commit in
weblate again, but not sure if that's just cause you haven't merged.
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:10&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Changes (by neteler):

* Attachment "weblate_syncing_github.png" added.

Weblate sync with GitHub
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by neteler):

Replying to [comment:8 robe]:
> Okay setting up the hook as discussed in pull request and you did is the
first step.
> For the remaining issue I went here:
>
> https://weblate.osgeo.org/projects/grass-gis/#repository
>
> and chose "Update with merge without fast-forward".

There is still an issue (maybe the third file?). What I see is this:

[[Image(weblate_syncing_github.png)]]

@robe I am not sure where to find the button or menu entry you mention...
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:11&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by robe):

Click on the Manage -> Repository Maintenance
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:12&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by robe):

I tried rebase push again and it generated another pull request

https://github.com/OSGeo/grass/pull/3154/

Not quite sure what's going on here. The changes do look different but
just puzzled why so many changes are stuck
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:13&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by neteler):

I now managed to find the "Update" stuff in Weblate.

This just generated a new PR but it is with 15 commits but empty:

https://github.com/OSGeo/grass/pull/3156/files

Confusing...
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:14&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by robe):

When I look at the individual files, it shows a diffs though

https://github.com/OSGeo/grass/pull/3156/commits/96fa6b65269767cd9110460f754bc03c68ffdfc0

. So not sure why it's showing 0 for files.

I propose that after this pull request, if this cycle continues, we hit it
with a hammer using
one of the red buttons

{{{
  Reset all changes in the Weblate repository

Resetting removes all changes in Weblate so that the repository matches
upstream. Use when you want to discard changes in Weblate and bring it in
sync with upstream repository.
}}}
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:15&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by cvvergara):

Again, all the components of GRASS GIS are blocked.

This repository is not up to date:
https://github.com/osgeoweblate/grass/tree/weblate-grass-gis-grasslibs

7 commits behind of
https://github.com/OSGeo/grass/

The main problem is conflicts within the Russian translation.
Will follow this instructions:

Typical workflow for fixing merge conflicts

Commit all pending changes in Weblate and lock the translation component.
(already locked)
     wlc commit; wlc lock

Add Weblate exported repository as a remote.
     git remote add weblate https://weblate.osgeo.org/git/grass-
gis/grasslibs/
     git remote update weblate

Merge Weblate changes and resolve any conflicts.
     git merge weblate/

Rebase Weblate changes on top of upstream and resolve any conflicts.
     git rebase origin/
Push changes into upstream repository.
     git push origin

Weblate should now be able to see updated repository and you can unlock
it. (can be unlocked in the weblate site)
     wlc pull ; wlc unlock
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:16&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by cvvergara):

mayority of conflicts happen on the header of the po file
{{{
<<<<<<< HEAD
"PO-Revision-Date: 2023-08-23 07:08+0000\n"

"PO-Revision-Date: 2023-06-28 19:08+0000\n"
>>>>>>> eeff31d386 (Translated using Weblate (German))
}}}
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:17&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2981: Weblate grass project not updating
---------------------------+---------------------------------------
Reporter: robe | Owner: sac@…
     Type: task | Status: reopened
Priority: normal | Milestone: Sysadmin Contract 2023-I
Component: Systems Admin | Resolution:
Keywords: |
---------------------------+---------------------------------------
Comment (by cvvergara):

While doing the rebase:
{{{
git rebase --continue
dropping 988f5950a66be361cf941d0e1e51a84125542f4a Translated using Weblate
(Russian) -- patch contents already upstream
dropping 73a260d053c068002acabaee212dcb71f30bccc8 Translated using Weblate
(German) -- patch contents already upstream
dropping c679724f004d10b86ab3883f492e633b0adfb884 Translated using Weblate
(German) -- patch contents already upstream
dropping 9c70f73ac03fb1957b56d96255de6ee851f69be2 Translated using Weblate
(German) -- patch contents already upstream
}}}
--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2981#comment:18&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.