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(bundle.go): add RequiredExtensions #83

Merged
merged 1 commit into from
Jul 30, 2019
Merged

Conversation

vdice
Copy link
Member

@vdice vdice commented Jul 26, 2019

Closes #71

bundle/bundle.go Show resolved Hide resolved
bundle/bundle_test.go Show resolved Hide resolved
bundle/bundle.go Outdated Show resolved Hide resolved
bundle/bundle_test.go Outdated Show resolved Hide resolved
Credentials map[string]Credential `json:"credentials,omitempty" mapstructure:"credentials"`
Outputs *OutputsDefinition `json:"outputs,omitempty" mapstructure:"outputs"`
Definitions definition.Definitions `json:"definitions,omitempty" mapstructure:"definitions"`
RequiredExtensions []string `json:"requiredExtensions,omitempty" mapstructure:"requiredExtensions"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this slice can contain duplicate entries, should we add a test to cover that case and nail down what the behaviour should be?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, good point. Should we just check that there are no duplicates during validation? If there are duplicates, throw an error mentioning this?

Copy link
Member

Choose a reason for hiding this comment

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

The slice can also contain items that are not present in the custom map, and we should probably validate that as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, good point. Should we just check that there are no duplicates during validation? If there are duplicates, throw an error mentioning this?

Yes, that's probably better than issuing a warning and proceeding as that would encourage duplication/sloppiness.

Copy link
Member Author

@vdice vdice Jul 30, 2019

Choose a reason for hiding this comment

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

Updated; Please take a look when convenient.

@vdice vdice force-pushed the feat/req-ext branch 2 times, most recently from 913dd6c to 17e691c Compare July 26, 2019 16:41
Copy link
Member

@radu-matei radu-matei left a comment

Choose a reason for hiding this comment

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

This looks great, a single mention to maybe also test the case when requiredExtensions contains an item that is not present in custom.

That being said, we should also expose how drivers advertise what custom extensions they can handle, and check before actually executing the action - should it also be part of this PR, or should we merge this sooner to be in sync with the bundle definition?

@vdice
Copy link
Member Author

vdice commented Jul 30, 2019

This looks great, a single mention to maybe also test the case when requiredExtensions contains an item that is not present in custom.

Good call; see unit test added -- it should cover scenario mentioned.

That being said, we should also expose how drivers advertise what custom extensions they can handle, and check before actually executing the action - should it also be part of this PR, or should we merge this sooner to be in sync with the bundle definition?

I would suggest we tackle this in a different ticket/PR.

Copy link
Member

@jeremyrickard jeremyrickard left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@radu-matei radu-matei left a comment

Choose a reason for hiding this comment

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

LGTM

@vdice vdice merged commit 121813c into cnabio:master Jul 30, 2019
@vdice vdice deleted the feat/req-ext branch July 30, 2019 18:55
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.

[spec compliance] Add requiredExtensions to Bundle struct
4 participants