[SERVER-46769] Migrate from optparse to argparse Created: 10/Mar/20  Updated: 29/Oct/23  Resolved: 30/Apr/20

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.2.7, 4.4.0-rc4, 4.7.0

Type: Improvement Priority: Major - P3
Reporter: Vlad Rachev (Inactive) Assignee: Vlad Rachev (Inactive)
Resolution: Fixed Votes: 0
Labels: tig-resmoke
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-46684 Repackage the hang-analyzer as a resm... Closed
Problem/Incident
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4, v4.2
Sprint: STM 2020-04-20, STM 2020-05-04
Participants:
Linked BF Score: 49
Story Points: 3

 Description   

Python's optparse does not support subcommands, but argparse/click does. To enable doing that, we need to migrate.

  • Look into click and whether that would be a better option.
  • Define new resmoke syntax with argparse. There are differences between how optparse/argparse work, so the syntax will have to change.
  • Add infrastructure for resmoke to run subcommands, with emphasis on extensibility for the future
  • Attempt to keep old resmoke syntax (and eventually deprecate). This might not be possible. If not, look into having a legacy flag, or at least print nice error messages to make it easy to figure out the new syntax.
  • Update usages of resmoke in the system.
  • Update documentation and do engineer outreach to ensure users are aware of the change


 Comments   
Comment by Githook User [ 01/May/20 ]

Author:

{'name': 'vrachev', 'email': 'vlad.rachev@mongodb.com', 'username': 'vrachev'}

Message: SERVER-46769 Migrate from optparse to argparse
Branch: v4.2
https://github.com/mongodb/mongo/commit/6bb97ee97405a710dd616fc572e0fa33cb29fe48

Comment by Githook User [ 30/Apr/20 ]

Author:

{'name': 'vrachev', 'email': 'vlad.rachev@mongodb.com', 'username': 'vrachev'}

Message: SERVER-46769 Migrate from optparse to argparse
Branch: master
https://github.com/mongodb/mongo/commit/9227199e1c480ff3a052954575eaa7b317e352e5

Comment by Githook User [ 30/Apr/20 ]

Author:

{'name': 'vrachev', 'email': 'vlad.rachev@mongodb.com', 'username': 'vrachev'}

Message: SERVER-46769 Migrate from optparse to argparse
Branch: v4.4
https://github.com/mongodb/mongo/commit/0db3c7f4fca9109e5ea4d1c3d5ae7f31c3b8d9a9

Generated at Thu Feb 08 05:12:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.