Page MenuHomePhabricator

Document how to convert projects into subprojects/milestones etc (sudo privileges for phab admins to run move_project script)
Closed, ResolvedPublic0 Story Points

Description

https://www.mediawiki.org/wiki/Phabricator/Project_management#Converting_projects_into_subprojects_/_milestones says to file a task under Project-Admins. However, nobody in Project-Admins can perform such conversions as CLI access is required. IIUC only @mmodell can perform such steps currently (like in T138952), so we might face a bottleneck / bad bus factor here.

Having documentation on wikitech how to perform such a conversion could allow others to help with the backlog in https://phabricator.wikimedia.org/maniphest/?ids=219610,219609,219608,169764,153327,147175,195855,182569,221540#R

Event Timeline

Aklapper created this task.Apr 16 2019, 5:03 PM
greg triaged this task as Normal priority.Apr 16 2019, 5:05 PM
MGChecker updated the task description. (Show Details)Apr 17 2019, 1:12 AM
MGChecker added a subscriber: MGChecker.

T123078 contains some information about how this works.

The script is roughly documented upstream at https://secure.phabricator.com/T10350

The version I've been using is essentially the same as upstream except I removed the restriction on moving projects that already have subprojects/milestones of their own. That might be harmful but I've moved whole trees before and it seems to work just fine.

mmodell added a subscriber: Dzahn.Apr 18 2019, 6:48 AM

A better documented version of the script is now available: rPHABf8b44b65514e: Added move_project script from upstream.

Note we probably need a new sudoers rule added to allow Andre to run this. I couldn't seem to deduce where those are defined in puppet. It looks like rOPUP has had a few things refactored since the last time I looked. Grepping didn't help much. Help? @Dzahn can you help me figure out how to allow @Aklapper to run /srv/phab/phabricator/bin/move_project on phab1001

NAME

move_project - Transform a project into either a subproject or milestone of another project.

SYNOPSIS

./bin/move_project --parent ParentHashtag --child ChildHashtag ( --subproject | --milestone ) --keep-members (parent|child|both)

OPTION REFERENCE

--parent project
    The project to make a parent of the --child project.

--child project
    The project to make a child of the --parent project.

--keep-members mode
    Choose which members to keep: both, child, parent.

--subproject
    Turn the project into a subproject. Or, use --milestone.

--milestone
    Turn the project into a milestone. Or, use --subproject.

Note we probably need a new sudoers rule added to allow Andre to run this. I couldn't seem to deduce where those are defined in puppet.

https://phabricator.wikimedia.org/source/operations-puppet/browse/production/modules/admin/data/data.yaml I guess?

Aklapper updated the task description. (Show Details)Apr 22 2019, 11:51 AM

A better documented version of the script is now available: rPHABf8b44b65514e: Added move_project script from upstream.

Thank you!

Note we probably need a new sudoers rule added to allow Andre to run this.

https://gerrit.wikimedia.org/r/#/c/operations/puppet/+/505667/ , I hope (see my comment over there).

Change 505667 had a related patch set uploaded (by 20after4; owner: Aklapper):
[operations/puppet@production] Phab: Allow greg and aklapper to convert projects to subprojects/milestones

https://gerrit.wikimedia.org/r/505667

Restricted Application added a project: Operations. · View Herald TranscriptApr 30 2019, 12:57 AM

@Dzahn can you help me figure out how to allow @Aklapper to run /srv/phab/phabricator/bin/move_project on phab1001

Sorry, i did not see this until today. Getting too many notifications after i subscribed to additional projects and was overlooked in clinic duty due to lack of access request tag. Added that now! Andre is right about the location in the admins module in data/data.yaml

Dzahn renamed this task from Document how to convert projects into subprojects/milestones etc to Document how to convert projects into subprojects/milestones etc (sudo privileges for phab admins to run move_project script).Apr 30 2019, 1:02 AM

Change 505667 merged by Dzahn:
[operations/puppet@production] Phab: Allow greg and aklapper to convert projects to subprojects/milestones

https://gerrit.wikimedia.org/r/505667

Dzahn added a comment.May 6 2019, 5:00 PM

@Aklapper @mmodell The request has been approved in today's SRE meeting. I merged the change. Just to make sure, does the move_project script really not need any parameters like the name of the project to be moved?

@Dzahn: it has a bunch of parameters :-/

Dzahn assigned this task to Aklapper.May 6 2019, 5:02 PM

Puppet ran on phab1001. If you could confirm things work now we can close this ticket i think. Thanks!

Dzahn added a comment.May 6 2019, 5:03 PM

@Dzahn: it has a bunch of parameters :-/

Ok, well then the current sudo privileges probably won't be enough, missing a * at the end. Will need follow-up but we don't have to bring it back to the meeting. The intention has been approved.

Dzahn added a comment.May 6 2019, 6:08 PM

@Dzahn: it has a bunch of parameters :-/

Ok, well then the current sudo privileges probably won't be enough, missing a * at the end. Will need follow-up but we don't have to bring it back to the meeting. The intention has been approved.

Actually.... "A simple file name allows the user to run the command with any arguments he/she wishes. However, you may also specify command line arguments (including wildcards). Alternately, you can specify "" to indicate that the command may only be run without command line arguments."

This should just work. But let's have Andre confirm that.

Aklapper updated the task description. (Show Details)May 10 2019, 8:45 PM
Aklapper closed this task as Resolved.May 10 2019, 9:46 PM
Aklapper removed Aklapper as the assignee of this task.

This should just work. But let's have Andre confirm that.

Confirming that I can use move_project and that it works. Tried in https://phabricator.wikimedia.org/T219609#5173422 . Thanks everybody.

Documented move_project in https://wikitech.wikimedia.org/w/index.php?title=Phabricator&type=revision&diff=1825823&oldid=1822024