readthedocs / readthedocs.org

The source code that powers readthedocs.org
https://readthedocs.org/
MIT License
8.05k stars 3.59k forks source link

Cannot edit/remove subproject when duplicate subprojects are defined. #6369

Closed Aricg closed 5 years ago

Aricg commented 5 years ago

Details

sub-project relationship created with v3 api. Cannot remove subproject when duplicate subprojects are defined. https://readthedocs.org/dashboard/o-ran-sc-doc/subprojects/o-ran-sc-ric-app-mc/edit/

returns:

          .
         ":"
       ___:____     |"\/"|
     ,'        `.    \  /
     |  O        \___/  |
   ~^~^~^~^~^~^~^~^~^~^~^~^~

Fail. Check back in a bit!

Expected Result

If a subproject listing already exists, refuse to create it a second time. If duplicates do exist, allow user to remove them.

Actual Result

Subproject listing is duplicated many times https://imgur.com/a/BgYClJa

Note

The docs are now setup with a domain, docs.o-ran-sc.org and that may effect this. unsure.

My code actually checks if the subproject relationship exists, and tries to do the right thing. So not sure how this happend.

Here is the code with the subproject check before subproject creation. https://gist.github.com/Aricg/95812e76e8611a16ffde5c3f490813e2

Aricg commented 5 years ago

Found a failure on our side that I believe led to the multiple sub-project relationship creations

https://jenkins.o-ran-sc.org/view/rtdv3-global/job/rtdv3-global-merge-master/230/console Afaik this worked before, investigating our api implementation.

Aricg commented 5 years ago
18:14:59   File "/home/jenkins/.local/lib/python3.6/site-packages/lftools/api/endpoints/readthedocs.py", line 244, in subproject_list
18:14:59     subproject_list.append(subproject['child']['slug'])
18:14:59 TypeError: list indices must be integers or slices, not str

Looking into our implementation now.

ghost commented 5 years ago

Reviewed this and confirmed Aricg's findings

stsewd commented 5 years ago

This was already fixed in https://github.com/readthedocs/readthedocs.org/pull/6275, but the fix isn't deployed yet

stsewd commented 5 years ago

@Aricg I'll need to delete the duplicate subproject relatioship manually for you. Which one is it?

humitos commented 5 years ago

I just tested this and I think the fix just deployed worked. Please, let us know if it's still there. Thanks!

Aricg commented 5 years ago

@stsewd There are several listed here https://readthedocs.org/projects/o-ran-sc-doc/

Aricg commented 5 years ago

$ cat /tmp/foo | sort | uniq -c 1 o-ran-sc-ci-management 2 o-ran-sc-it-dev 3 o-ran-sc-it-otf 1 o-ran-sc-it-test 2 o-ran-sc-nonrtric 1 o-ran-sc-portal-ric-dashboard 1 o-ran-sc-pti-rtp 1 o-ran-sc-ric-app-admin 6 o-ran-sc-ric-app-mc 1 o-ran-sc-ric-app-ml 1 o-ran-sc-ric-plt-a1 1 o-ran-sc-ric-plt-lib-rmr 2 o-ran-sc-scp-ocu-openlte

stsewd commented 5 years ago

@Aricg ok, I think I have deleted all duplicated subprojects. Let me know if I missed one