Roche / foxops

Templating for Git Repositories

Home Page:https://foxops.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If the incarnation status is "failed", and get-incarnation-by-id, then the template-data should not `null`

feiyunzhou opened this issue · comments

If the incarnation status is "failed", and get-incarnation-by-id, then the template-data should not null

The reason for this is that the template information like template_repository, template_repository_version and template_data is not cached in foxops database, but is queried from the .fengine.yaml file of the incarnation repository. I assume that this file doesn't even exist or doesn't contain that information ...

or the incarnation wasn't yet persisted in the database at all - but then you'd get a 404 when querying the incarnation details.

@feiyunzhou any more insights to what the error situation was?

@defreng I think this one more issue we'll have if foxops is not the single source of truth .. we may be able to mitigate this though by writing the .fengine.yaml file not only on success - but currently we kinda use that fact to indicate a success incarnation.

I got a 200 status, but the field template_data is null. I think I have put the incarnation with the template_data successfully, so whatever the status is "failed"/"pending", the template_data should populated when querying the incarnation details.

@timofurrer yeah I more and more agree that the foxops DB itself should become the source-of-truth for all the information...

There are many other good reasons to have that info in the DB, like:

  • Quick queries for all incarnations with some template
  • proper relations to other Template or Hoster entities in the DB, as soon as we add that feature to foxops

Now I'm wondering, though:

In that case (incarnation initialization fails). Should that incarnation even be added to the database? 🤔