Skip to content
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

(feat) Bundles v2: Implement Bundle Interface Document #2922

Merged
merged 6 commits into from
Sep 22, 2023

Conversation

schristoff
Copy link
Member

@schristoff schristoff commented Sep 22, 2023

What does this change

When setting a sharing mode is turned on for installations we need a way to share param/outputs/creds between them so we can wire them together.

The way we are doing this without updating the cnab spec is by converting everything into a document (type interface). This document type is something CNAB already implements - so once we get to translating porter yaml -> cnab json we get a smiley face.

Problem:
I remember talking to Carolyn about issues with using the existing bundle.Parameters and bundle.Credentials and I recall it being about the required types needed passed into them (for example, path being required for parameters) but I don't remember where we left off with that.
I guess we'll see what happens when we get there.

#2548

Checklist

  • [x ] Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list. Thank you for making Porter better! 🙇‍♀️

Reviewer Checklist

  • Comment with /azp run test-porter-release if a magefile or build script was modified
  • Comment with /azp run porter-integration if it's a non-trivial PR

Sarah Christoff and others added 5 commits April 20, 2023 10:38
Signed-off-by: Sarah Christoff <[email protected]>
Signed-off-by: Carolyn Van Slyck <[email protected]>
Signed-off-by: Sarah Christoff <[email protected]>
Signed-off-by: Sarah Christoff <[email protected]>
Signed-off-by: schristoff <[email protected]>
@schristoff
Copy link
Member Author

/azp run porter-integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@schristoff
Copy link
Member Author

Keeping Carolyn as a co-author on this for obvious reasons. Even months later, you're still the driving force behind this project @carolynvs ❤️

@schristoff
Copy link
Member Author

/azp run porter-integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@schristoff
Copy link
Member Author

oh i already did that

@schristoff schristoff merged commit cfacd0f into getporter:main Sep 22, 2023
17 checks passed
@schristoff schristoff deleted the schristoff_iss2548 branch September 22, 2023 20:55
Copy link
Member

@devigned devigned left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessarily about this PR, but you may want to consider starting spans for more functions. For example, creating a logger is nice, but the span is still the same span as from the parent (I believe from looking at the implementation of LoggerFromContext), so the attributed log entries on the span will not have the localization to the function as one might expect.

I don't have enough depth to give a functional review. However, there are a couple superficial things that might be good to update, and one more widespread thing to consider, granularity of spans.


for _, o := range c.Manifest.Outputs {
addOutput(o)
defName := c.addDefinition(sourceParam.Name, kind, sourceParam.Schema, defs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defName := c.addDefinition(sourceParam.Name, kind, sourceParam.Schema, defs)
p.Definition = c.addDefinition(sourceParam.Name, kind, sourceParam.Schema, defs)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now I believe most of our stuff goes to stdOut, I would love to implement a structured logger so we could follow the span throughout multiple functions, appending more data, and being able to see exactly what func errors.
I believe right now because we abstract away our logging that implementing a structured logger wouldn't be a huge undertaking.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh hey, this is new https://go.dev/blog/slog

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Structured log is good, but tracing is better. Tracing is structured logs + causality through call hierarchy. This is probably going to be more apparent in the operator as stuff will be less going to stdout and more to some telemetry ingestion pipeline.

pkg/cnab/config-adapter/adapter_test.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants