Closed r0mainK closed 6 years ago
OK, this is a bit too much for me :)
Please split. I would suggest:
storage_backend.py
changes separateAmazing work btw, can't wait to have it merged.
Aha no problem, thks ^^ okay then I'll split in something like 5 or 6 PRs, then close this
@r0mainK @vmarkovtsev what issue is this related to?
@marnovo this issue: https://github.com/src-d/backlog/issues/1205
basically having the index of the registry on the backend was not great so now it's gonna be exclusively on github, e.g. https://github.com/src-d/models , and itll be updated with modelforge
cmds.
Closing - it was splitted.
LOL
aha
Thanks! Please let's always try to reference things around so people have more context of why/what is going one.
Idea for the future: intelligent PR splitter, to split large PRs into more manageable ones for review. ;)
Pretty big PR implementing the Git based index:
Breakdown of the changes:
main.py
: added functions for git index args (remote_repo
,username
,password
) and template argstemplate_model
andtemplate_readme
; add--force
to initialization parser so we can not destroy registry carelessely, added--meta
keyword topublish
parser in order to point towards a JSON that will contain all addtionnal information we may want to give (extras, etc). It is not necessary, I added a default JSON template to the repo that is mostly empty if the flag is not used.delete.py
/dump.py
: moved code toregistry.py
, files were deletedgcs_backend.py
: took outfetch_index
andupdate_index
, added a helper function to create the GCS client since bothconnect
and the new methodinitialize_backend
use it and added/renamed some errorsmodel.py
: small change, since backend and index are now separate I had to change a bit the logic to still make it possible to query with only the UUID, added an index dict param to theload
functionmodels.py
: same story, added it in the constructor ofGenericModel
registry.py
: a lot of changes, however most of the logic is not here anymore, the functions almost only call backend/git_index methods. notable change:list
does not require backend anymorestorage_backend.py
: took outfetch_index
andupdate_index
, addedinitialize_backend
and errorstemplates/*
: contains the mebtionned above JSON template as well as jinja2 templates fromsrc-d/models
setup.py
/requirements.txt
: addedsrc-d/models
libs and line to add templates to the packageindex.py
: new file that contains theGitIndex
class now used to maintain the index. Incorporates the old functions ofsrc-d/models
as well as methods to fetch/upload the index, add/remove models, and initialize registries