gh-cli-for-education / gh-edu

A pluggable extension of gh-cli to assist educators and students using GitHub Education
https://github.com/gh-cli-for-education/TFG-2122-Cristo-Garcia-Gonzalez
3 stars 0 forks source link

design thoughts #1

Open crguezl opened 2 years ago

crguezl commented 2 years ago

State at 22/04/2022

gh org clone

Some Commands to add

gh org cd ULL-ESIT-PL-2122

cd subcommand is needed.

May be fuzzy search with fzf and cache can improve efficiency

gh org cd PL-2122

wu¡ill find org ULL-ESIT-PL-2122

gh org pwd

gives the default org

Cache

May be we cache the orgs inside the config file and other things, but if we cache we need a gh org update command

Strategy Pattern

gh org install

Example: gh org install clone will install plugin in https://github.com/gh-cli-for-education/gh-org-clone

a variant of the command will be:

gh org install ggcristo/gh-org-clone

Configuration file

Stored in:

$HOME/.local/share/gh/extensions/gh-org/config.js

__dirname

module.exports = {
  defaultOrg: "ULL-ESIT-PL-2122",
  commands: {
     "clone" : { ... },
     "cd": { ...},
     "pwd": {... },
    ...
 },
  cache: {
        orgs: [. ... user orgs ... ]
   }
}
GGCristo commented 2 years ago

@crguezl ¿Deberíamos obligar a nuestros usuarios que sus plugins tengan el prefijo "gh-edu", a modo de namespace, o le damos total libertad y simplemente ponemos un warning? Tener el prefijo gh-edu nos daría más seguridad de que el plug-in esté pensado para nuestro ecosistema, pero también podría limitarlo bastante

crguezl commented 2 years ago

@GGCristo

Creo que es mejor que tengan el prefijo gh-edu. Creo que demuestra intencionalidad por parte del autor del plugin y la gente sabrá que ese espacio de nombres gh-edu esta reservado.

crguezl commented 2 years ago

Checked that the strategy pattern seems to work. Installed gh-edu and then installed the plugin view without problems.

Looks wonderful!

More tests before closing this issue are needed though.