#477 issues git repo allows pushes, but seems to ignore the changes
Closed: Fixed None Opened 4 years ago by mikem.

I'm not sure the design intent here, but if I clone the tickets/issues git repo for my project, pagure will allow me to push back to it.

If I do push changes (I tried pushing a simple title change). The system does not appear to notice the change. If I later update that same ticket the change I pushed earlier is reverted.

I suspect that you just want to block pushes for this repo since it seems to be a nonprimary data store. On the other hand, maybe this could be a useful interface for external tools.

Also, it seems to allow non-fastforward pushes, which is definitely wrong.

Regarding the fact that it does update the UI, there is a setting to turn on, otherwise the hook that updates the DB doesn't get installed.

Also, it seems to allow non-fastforward pushes, which is definitely wrong.

Agreed on this, tickets and requests should likely block non-fastforward

As far as i can understand:

  1. You can create, edit etc issues from the website as well as the cli.
  2. If you are createing/updating an issue from the website, the DB gets updated and then there is a corresponding commit, that is created in the issue's git repo. In other words, if only the website is involved, we don't have any problem.
  3. Let's assume for the moment that the local git repo for the issue and the git repo on pagure are at the same position. If we update an issue from the website, there is no problem - DB gets updated and the git moves one more commit forward. But, if we update the issue from the cli, the DB doesn't get updated, but, the git does move forward. Since, the website takes all its data from the DB (for UI), it doesn't show the changes that has occurred in the issue's git repo. If in case we want to update the issue from the website after the commit via cli, the previous commit is overwritten. It's because when we update the git, we actually rewrite the whole issue file - with the data from the DB and the update that we want to make.
  4. As @pingou has written above, i tried to use hooks but it didn't work in my case, maybe i am missing something. So, i couldn't make a flow from the git to the DB. Also, i feel, in case that flow does work, then we shouldn't have any issue at all.

To update the DB by pushing to the ticket or the requests repo, you need to activate the corresponding git hook which is in the settings page of the project.

AFAIK, these hooks work.

The issue at hand is clearly that these two git repos should not allow non-fastforward pushes. So it's something to fix at the git config level when creating the repos.

Denying non-fastforward pushes to the tickets and requests repos has been fixed in: https://pagure.io/pagure/pull-request/551

Login to comment on this ticket.