#1128 Fix unaccessible forks after deletion of main repo
Merged by pingou. Opened by farhaan.
farhaan/pagure delete-fork  into  master

Download 1128.patch

The following changes to ui/repo.py help to intact parent_id in
order to know that its a forked repo. The check repo.parent is to see
if the main repo is deleted. The corresoonding changes are done in the
UI.

@puiterwijk This is what I came up with .

I doubt this will work, how which DBMS did you test it?

rebased

1 new commit added

  • Remove property in other files

1 new commit added

  • Fix test cases to suite the new project schema

I doubt this will work, how which DBMS did you test it?

@pingou I tested that in sqlite , then I reverted and made a different change as we discussed :smile:

Should we also put a check if repo.parent exists here ?

And an extra space here

@vivekanand1101 there is a change I am doing let me do that first :P

but agreed on those too :)

5 new commits added

  • Fix the new changes to be used in 'lib' and other files
  • is_fork is available to use after deleting is_fork property
  • Fix alembic for the is_fork column
  • Fix to make test happy with introduction of is_fork column
  • Fix unaccessible fork after the main repo is deleted

5 new commits added

  • Fix the new changes to be used in 'lib' and other files
  • is_fork is available to use after deleting is_fork property
  • Fix alembic for the is_fork column
  • Fix to make test happy with introduction of is_fork column
  • Fix unaccessible fork after the main repo is deleted

I am really sorry about the chaos caused by 26 files I should have thought through things ! :disappointed:

Not up to date?

So what happens if the project is a fork w/o parent?

not pep8 valid

sorry ? How?

I was curious why not create directly with the column name: is_fork ?

1 new commit added

  • Fix avoid making Pr and Pep8 convention

@farhaan since here, its about getting the parentpath , can we adjust according to if/elif/else condition and give the parent's path the same path as the forked repo itself ?

@vivekanand1101 yes and when we did if repo.is_fork and repo.parent we were doing the same thing. Now when we came to that since the repo was initially fork the pull requests is disable[1] so you will see a New Pr button but you will not be able to make pull request. So the question arises do we need user to make a PR to this if yes then we can just enable pull request on deletion of main.

[1] https://pagure.io/pagure/blob/master/f/pagure/lib/init.py#_1383

@vivekanand1101 yes and when we did if repo.is_fork and repo.parent we were doing the same thing.

That would have landed in GIT_FOLDER but this should be in FORK_FOLDER, i guess.

About enabling pull requests, i remember the logic behind disabling on forks by default was: "since on pagure, forks are used just to develop the main projects: it would be nice that PRs and Issue trackers are disabled by default". And since we are dealing with the case when the main project is deleted i think, that logic doesn't apply. I would be :thumbsup: for enabling PRs when the main project is deleted.

Forks are generally found in GIT_FOLDER like forks/<user>/<project_name> so I think that will be fine.

Forks are generally found in GIT_FOLDER like forks// so I think that will be fine.
should be fine :/

1 new commit added

  • Add feature to make fork independent after deletion of main repo

So what if there are no parent? Is it still a fork or not? What's the point of is_fork if we always need to check for .parent?

Maybe we could add a comment as to what you are trying to do here, I'm not sure to follow your reasonning

1 new commit added

  • Fix changes for deleted fork in UI

rebased

Any discussions pending here ?

rebased

Proposal: Fork from a delete repo

I still have an issue with /fork/pingou/test/commits/master

Have you considered adding a new unit-tests file dedicated to just this?

I am working on the unit test and i fixed the error !

1 new commit added

  • Fix alembic, repo_master and commit endpoint for unaccesible fork

@vivekanand1011 added a new revision so we'll need to adjust this one once again :)

1 new commit added

  • Adding test for unaccessible fork

rebased

Can i get the diff for alembic revision ? :)

@farhaan you should have the file itself (you rebased). Just change the revision ids and you should be fine.

btw, it's vivekanand1101 :stuck_out_tongue:

rebased

I guess this one needs to be adjusted as well

12 new commits added

  • Update migration file
  • Fix test and add more endpoints to check
  • Adding test for unaccessible fork
  • Fix alembic, repo_master and commit endpoint for unaccesible fork
  • Fix changes for deleted fork in UI
  • Add feature to make fork independent after deletion of main repo
  • Fix avoid making Pr and Pep8 convention
  • Fix the new changes to be used in 'lib' and other files
  • is_fork is available to use after deleting is_fork property
  • Fix alembic for the is_fork column
  • Fix to make test happy with introduction of is_fork column
  • Fix unaccessible fork after the main repo is deleted

Ok, let's do a final rebase and merge this :)

rebased

Ok I rebased it, merging :)

Pull-Request has been merged by pingou

Thanks for rebasing :smile:

Metadata