Refactoring scratch pad - AutolabJS/autolabcli GitHub Wiki

Desirable Features in Descending Order

  1. Update feature tests based on the logger module.

  2. Implement the following commands
    autolabjs show status
    autolabjs show score -l <lab_name>
    autolabjs show score -l <lab_name> -i <student_id>
    autolabjs show time
    autolabjs show labs #show active labs only
    autolabjs show labs -c <category> #categories are: scheduled, active, late, expired, all

  3. Refactoring of socket.io into a wrapper module with timeouts for all socket events and also a list of allowed events for each socket event. See the advice on use of FSM.

  4. Implement the following commands for admin of autolab servers (for now main server, but autolabcli need not concern itself with the name of the autolabjs component it is interacting with.
    autolabjs eval bulk --list <student_list>

    autolabjs lab create
    autolabjs lab update
    autolabjs lab delete

  5. isomorphic-git seems like an ES2017 compatible, well-written and documented git library. Another possibility is nodegit. nodegit is a node.js compatible wrapper for libgit2. We can use one of these two libraries to integrate git functionality into autolabjs.
    Another choice is to create a facade around node-gitlab or python-gitlab or hub. Interface compatibility with hub is likely a good design decision.

  6. Refactoring of views so that we can swap views based on configuration.

    • migration of validation from lib/controller to lib/model/validate
    • interface-level (object-level) compatibility between the views
    • dependency injection of view into view controller
      • Right number of view objects -- not one global view, or not too many small view objects
  7. Exception handling for all commands

    • validation of JSON files (prefs, labs, course etc) using validator. We can also use joi which only does JSON validation, but that's adding one more dependency along with the existing generic validator.
  8. Change from CommonJS modules to ES6 modules with the help of esm. For a project that utilizes ES6 modules well, see moment. Also see a tutorial.

  9. Extend eval command to show long evaluation logs.
    autolabjs eval [-l <lab_name> --lang <language>]
    The evaluation log can also be saved as username_labname_language_eval.log along side other log files. Since the evaluation logs are going to be long, we can ask the user before displaying the logs. Optionally, the logs can be displayed using exec("cat username_labname_language_eval.log | less").

  10. Application working both as a standalone cli and also as a library-level dependency

  11. Implement the following commands
    autolabjs eval team --list <student_team_csv>

  12. Piggyback on executionnodes to offer an unofficial, local execution of test cases. For this to work, we need a potentially encrypted instructor solutions that can be uploaded on course website and downloaded by the students.
    If we are able to do this, the load on the AutolabJS server system goes down significantly.

Completed Features

  1. Filter sensitive output from stdout and stderr of console.

  2. Generate proper error conditions. see issue #27.

  3. Sequence diagram for autolabcli application. Update on this page.

  4. autolabjs init must handle the password containing special characters. see issue #32.

  5. Debug messages sent to log manager by Winston logger.

  6. package (Module dependency) diagram for autolabcli application. Update on this page.

  7. Refactor long unit and integration tests.

  8. Add / move validation to controllers.

References

  1. mastering cli apps
  2. Mocking stdin and stdout in node
  3. Modular code structure in vorpal.js
⚠️ **GitHub.com Fallback** ⚠️