Giter VIP home page Giter VIP logo

ocm-api-metamodel's People

Contributors

ciaranroche avatar dependabot[bot] avatar djberg96 avatar etabak avatar gshilin-sdb avatar igoihman avatar jhernand avatar markturansky avatar nimrodshn avatar renan-campos avatar tbrisker avatar tzvatot avatar vkareh avatar zvikorn avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocm-api-metamodel's Issues

[RFE] Nicer explanations for failure

I'm trying to port over one of our apps, and I figured I'd start small. So, I created a root_resource.model, applications_resource.model and an application_type.model file. They're mostly a copy pasta of some of the other models I saw in the ocm-api-model project.

I've got a local clone of the ocm-sdk-go project, and I'm running the following command on my Mac:

make model_version=HEAD model_url=/Users/dberger/Dev/ocm-api-model generate

This results in the following:

E: Resource 'Application' isn't completely defined
E: Can't read model: there was 1 error

I would like a more helpful error message here, something that explains to me exactly what I'm missing, because it's not immediately obvious to me.

BTW, current fork is here if you have any insights:

https://github.com/djberg96/ocm-api-model/tree/status_board

Later metamodel releases do not generate ocm-api-model sucessfully

There appears to be issues generating the ocm-sdk from ocm-api-model using the latest metamodel code:
I built the metamodel using make binary, then went to the ocm-api-model repository and ran:

ocm-api-metamodel/metamodel generate go --model=model --base=github.com/openshift-online/ocm-sdk-go --output=./sdk/

With the latest metamodel code, the above command fails with the following error:

E: Type 'string' isn't completely defined
E: Can't read model: there was 1 error

If I move the metamodel code to the version specified in the Makefile of ocm-api-model, v0.0.45, then the model is successfully generated.

Is anyone familiar with what this error means?

[RFE] Guard against recursive resources

I made a mistake and put an Applications locator inside an applications_resource.model file. Apparently that caused some kind of recursion/stack overflow when I went to generate the thing:

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc02b4803d8 stack=[0xc02b480000, 0xc04b480000]
fatal error: stack overflow

runtime stack:
runtime.throw(0x145ab32, 0xe)
	/usr/local/opt/go/libexec/src/runtime/panic.go:1117 +0x72
runtime.newstack()
	/usr/local/opt/go/libexec/src/runtime/stack.go:1069 +0x7ed
runtime.morestack()
	/usr/local/opt/go/libexec/src/runtime/asm_amd64.s:458 +0x8f

I would like to see it dynamically check for recursive calls, warn the user and/or just bail out.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.