-
Notifications
You must be signed in to change notification settings - Fork 297
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
Make Module Metadata accessable from CUE #3617
Comments
Thanks @nxcc. This is a very interesting observation. We have talked about this in the past in the context of having Do you have a particular idea of the format in mind? |
May just provide pkg like golang’s https://pkg.go.dev/runtime/debug#ReadBuildInfo i based package component
import (
"piper.octohelm.tech/client"
crkitcomponent "github.com/octohelm/crkit/cuepkg/component/crkit"
)
component: {
_module: client.#Module & {}
"container-registry": output: crkitcomponent.#ContainerRegistry & {
spec: version: _module.deps["github.com/octohelm/crkit@v0"]
}
} once cue could provide the if could be simple package component
import (
"runtime/debug"
)
component: {
"container-registry": output: crkitcomponent.#ContainerRegistry & {
spec: version: debug.Dep("github.com/octohelm/crkit@v0")
}
} |
Indeed, that's the kind of information that we had in mind. To be clear, the main thrust of my question is where and in what format that information would be available. Something that just occurred to me is that this information could, as one option, be available on a per module basis as some sort of special hidden field. That would allow us to expose this information via standard CUE commands ( On a related note, I've also just raised #3618 because I couldn't find an existing issue (which surprised me, but that's another matter!). |
Is your feature request related to a problem? Please describe.
There is no way to get metadata about the package in a package. If, for example, a configuration is created with cue, it would be desirable in some situations, especially if the packages involved dynamically come from a configuration, to be able to embed the package name and version in the output in order to later be able to trace which packages/versions the output was based on.
Describe the solution you'd like
A new package or a new function that returns metadata such as module name, package name, version and other information from
modules.cue
Describe alternatives you've considered
One solution that isn't clean would be to
@embed
the modules.cue file, but this is currently only possible as plain text. This would also only contain the module information and not the version that the module had in the registry, the package name, if it is a subpackage of the module, would also not be available.The text was updated successfully, but these errors were encountered: