Git Product home page Git Product logo

virtuslab / besom Goto Github PK

View Code? Open in Web Editor NEW
119.0 119.0 7.0 24.54 MB

Besom - a Pulumi SDK for Scala. Also, incidentally, a broom made of twigs tied round a stick. Brooms and besoms are used for protection, to ward off evil spirits, and cleansing of ritual spaces.

Home Page: https://virtuslab.github.io/besom/

License: Apache License 2.0

Scala 96.93% Just 0.85% Go 1.34% JavaScript 0.68% CSS 0.08% TypeScript 0.11%
infrastructure-as-code pulumi scala

besom's People

Contributors

dependabot[bot] avatar gryfit avatar kacperfkorban avatar kubukoz avatar lbialy avatar nikolaiser avatar note avatar pawelgizka avatar pawelgizka1 avatar pawelprazak avatar polkx avatar prolativ avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

besom's Issues

Implement registerResourceOutputs

The registerResourceOutputs implementation needs to be written. It should be used to correctly handle Stack outputs (exports) and we need to ensure we are able to output them out of pulumi program.

Rewrite supported features into separate case class

It is recommended to rewrite the supported features into a separate case class, which will be resolved before the Context is created. This can be achieved by making parallel calls to all of the supported feature requests to the backend. Additionally, integrate variables such as PULUMI_DISABLE_RESOURCE_REFERENCES into the same.

Discussion on the usability of Output for end user

A discussion is required regarding the usability of Output for end users, such as handling optionality of Output, dealing with errors in Outputs, and how flatMap from F[_] will work and its correctness.

Rewrite supported features into separate case class

It is recommended to rewrite the supported features into a separate case class, which will be resolved before the Context is created. This can be achieved by making parallel calls to all of the supported feature requests to the backend. Additionally, integrate variables such as PULUMI_DISABLE_RESOURCE_REFERENCES into the same.

Resolve issue with `protect` flag

We currently handle the protect flag the same way pulumi-go does and honor only the ResourceOption for a given resource. However, pulumi-java sets protect to true if a resource's parent has it enabled. We need to determine the correct approach.

Implement CustomTimeouts ResourceOption

A CustomTimeouts ResourceOption implementation is missing. A notable part of this task involves converting a scala.concurrent.Duration into a Go duration string.

Fix `Decoder[JsValue]` issue

There's an issue with Decoder[JsValue] - we currently aren't deserializing JSON values. We assumed that they would arrive as strings in protobuf, but they actually arrive as protobuf structs and need to be translated to spray-json AST.

Improve Encoder/Decoder debugging

Consider adding proper label passing for Encoder/Decoder debugging to improve the visibility and traceability of potential issues.

Refactor Remote API logic out of Context

The Remote API logic should be moved out of Context and into a separate entity. This would simplify testing and make Context a thinner entity than it currently is.

Improve URN and ID types

URN and ID should be opaque types that are subtypes of String and have validation to obtain them. Currently, we have a stringly typed implementation which leaves room for improvement.

Fix resource propagation in `outputEncoder[A]`

There's an issue with resource propagation in outputEncoder[A]. We are currently passing empty resource sets out of this. It's advisable to check what Go and Java do in this case. This is likely broken.

Resolve lazy evaluation issue of Result

The current lazy evaluation of Result is causing multiple registrations of the same resource, essentially causing problems with the usage of resources. Outputs that contain resources should be Promise-based to ensure they are effectively memoized.

Refactor Context class

The Context class needs to be cleaned up and refactored for improved readability and performance.

Remove `readOrRegisterResource`

readOrRegisterResource might not be necessary. It was originally a workaround in pulumi-C# and pulumi-java due to both rehydration and registration hitting the same code path of Resource.constructor. We don't use constructors, we can differentiate between cases and call correct methods on Context.

Improve Decoder functionality

Work is needed on the Decoder. The 'mapping' feature should be dropped and a way should be found to prevent throwing in implementations (since OutputData doesn't have an error channel). Using 'boundary/break' might be a solution.

Investigate id handling in `ResourceResolver.resolve`

In ResourceResolver.resolve, there's a scenario where the id being an empty string is treated differently in pulumi-java. We currently do not account for this, which might be a bug on our side, or a typing issue on pulumi's side.

Resolve lazy evaluation issue of Result

The current lazy evaluation of Result is causing multiple registrations of the same resource, essentially causing problems with the usage of resources. Outputs that contain resources should be Promise-based to ensure they are effectively memoized.

Evaluate type casting in Output

Evaluate whether improvements are needed in handling type casts in Output, as in case out: Output[_] => out.asInstanceOf[Output[A]] // TODO TypeTest?. This might not be necessary as the A type is guaranteed by the extension method being called on Output[A].

Codegen: Implement default values for kubernetes args properties

For kubernetes args properties (i.e. kind: Pod, version: v1), there should be default values. The const fields in the schema declare which properties have to be passed verbatim. These should be dropped from the apply method argument list and passed as-is to the Args class constructor directly.

Consider generic TC[head] typeclass implementation

There's a note suggesting implementation of a generic TC[head] typeclass: 'all of these could summon a generic TC[head] typeclass but it's harder so... later?'. This needs to be considered for implementation.

Prepare a compatibility matrix

A compatibility matrix needs to be prepared for our libraries, based on the protobuf version on which the language SDK is built, the language SDK version, and the schema version for the provider SDK.

Codegen: Consider optional Args for certain situations

In certain scenarios, where none of the args are required, optional Args should be considered, for example, creating a kubernetes Namespace should be possible with just the name, args should be optional (like passing labels).

Consider need for `Decoder[Output[A]]`

There is a need to investigate whether we need a Decoder[Output[A]]. Checking Java and Go implementations might provide some insight into what they do in similar situations.

Review failure conditions of RegisterResourceResponse

Currently, our implementation fails if RegisterResourceResponse doesn't contain an object. This might not always be the correct behavior as evidenced by the comment throw new Exception('ONIXPECTED: no object in response') // TODO is this correct?.

Review `ResourceDecoder` naming

Either rename ResourceDecoder or remove the TODO comment associated with it. Current suggestion is to drop the TODO as ResourceDecoder seems appropriate.

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.