Move command options to IDL

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, the majority of the configurable options for commands (like maintenanceMode, supportsRetryableWrite, allowedWithSecurityToken, etc.) are implemented via non-constexpr virtual functions on the base `Command` class. If we moved these options to the IDL specs of the commands themselves, this would:

      1) make the options for each command less verbose and easier to grep for. Compare:

      virtual bool adminOnly() {
        return false;
      }
      

      to

      adminOnly: false
      

      2) heavily improve our ability to do static analysis on the set of all our commands, allowing us to easily compile a list of all commands and their options and documentation, which we can present to both developers and end-users
      3) allow us to document and enforce constraints on commands at build time, such as `(!command->requiresAuth() && command->allowedInTransactions()` being a contradiction.

            Assignee:
            Alex Li
            Reporter:
            Joseph Obaraye
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: