Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

troubles with config.json #13

Open
crguezl opened this issue Jun 27, 2022 · 5 comments
Open

troubles with config.json #13

crguezl opened this issue Jun 27, 2022 · 5 comments
Assignees

Comments

@crguezl
Copy link

crguezl commented Jun 27, 2022

I pulled the repo (27/06/2022) and installed using a link (gh extension install .)

Then I did:

➜  gh-edu git:(main) ✗ gh edu -h
No configuration file detected
Remote config file detected
Configuration file dowloaded
All commands must have a lastCommit field

Which is because I had already a tuned profile repo, but not compatible with the gh-edu current version.
That leads to a couple of questions:

  • Compatibility between different versions of the config file?
  • How to manage corruption of the config file?

I noticed the file config.json is a plain file downloaded from my gh-edu repo, but there is no way to track from what repo was obtained. I prefer you make a folder config/config.json that is an image of the config repo (i.e. is a local repo from user/gh-edu-profile).

So I decided to remove my gh-edu-profile user repo at GitHub and try it again, remove the extension

➜  gh-edu git:(casiano) ✗ gh extension remove gh-edu
✓ Removed extension edu

and install gh-edu again, this time without the link:

➜  gh-edu git:(casiano) ✗ gh extension install gh-cli-for-education/gh-edu

Clonando en '/Users/casianorodriguezleon/.local/share/gh/extensions/gh-edu'...
remote: Enumerating objects: 5645, done.
remote: Counting objects: 100% (40/40), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 5645 (delta 16), reused 28 (delta 12), pack-reused 5605
Recibiendo objetos: 100% (5645/5645), 5.13 MiB | 5.41 MiB/s, listo.
Resolviendo deltas: 100% (1802/1802), listo.
✓ Installed extension gh-cli-for-education/gh-edu

but the problem repeats:

➜  gh-edu git:(casiano) ✗ gh edu -h
No configuration file detected
Remote config file detected
Internal error: runCommand:  gh repo clone gh-edu-profile /var/folders/t8/zb7yv2x968537k4bjzrm189m0000gn/T/tmp-22371-hkF0yLyvycyd
GraphQL: Could not resolve to a Repository with the name 'crguezl/gh-edu-profile'. (repository)
Internal error: runCommand:  mv /var/folders/t8/zb7yv2x968537k4bjzrm189m0000gn/T/tmp-22371-hkF0yLyvycyd/config.json /Users/casianorodriguezleon/.local/share/gh/extensions/gh-edu/config.json

It says Remote config file detected but I have deleted my config repo and also the error says Could not resolve to a Repository with the name 'crguezl/gh-edu-profile' that I guess is normal, since the repo no longer exists. It does not creates the repo in case it doesn't exist?

@GGCristo
Copy link
Collaborator

GGCristo commented Jun 27, 2022

Compatibility between different versions of the config file?

I am going to do a backward compatibility promise when we reach 1.X version, this means that after that release we will be able to do changes as long as they don't break something. I think this is the best approach for me as the developer and for the plugin developers. With a unique configuration file, it is too easy to fall into a diamond dependency problem.

I prefer you make a folder config/config.json that is an image of the config repo (i.e. is a local repo from user/gh-edu-profile).

I am sorry you are right, we have already talked about this. I will notify you when it is finished.

It says Remote config file detected but I have deleted my config repo

I will look into it, thanks for the issue

@GGCristo
Copy link
Collaborator

Since I am changing the configuration file system, what do you think(@crguezl ) if the configuration file is renamed: config.json -> data.json
If we think about, it is no longer just a mere configuration file, but it also has cache and data from plugins.

@crguezl
Copy link
Author

crguezl commented Jun 27, 2022

Agree 👍

@GGCristo
Copy link
Collaborator

GGCristo commented Jun 27, 2022

You can try now the new system, but "view" and "data" plugins are not updated yet, and I have to include this changes in the documentation
Now it creates a directory called "data" which is under version control with git. inside of it there is data.json

@crguezl
Copy link
Author

crguezl commented Jun 28, 2022

Cuando lo pruebe te digo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants