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

Made credentials required by default by adding UnmarshalYAML method to CredentialDefinition type #657

Merged
merged 3 commits into from
Sep 30, 2019

Conversation

AGMETEOR
Copy link
Contributor

@AGMETEOR AGMETEOR commented Sep 26, 2019

What does this change

This PR adds a method, UnmarshalYAML to the CredentialDefinition struct to always mark a credential's definition as required i.e. true when unmarshaling from a YAML to create a manifest file. This makes credentials required by default.

What issue does it fix

#577

Notes for the reviewer

  • In the spec for this issue, it's mentioned that THERE IS NO WARNING. The bundle just fails in odd places with unexpected errors because the bundle was written assuming credentials would be there, and they aren't. Can this be solved within this issue?
  • Also, I was not sure on how to exactly test the change made and what I did was to create a YAML file with-credentials.yaml with some credentials defined. Some advice here would be appreciated.

Checklist

  • Unit Tests
  • Documentation
    • Documentation Not Impacted

@msftclas
Copy link

msftclas commented Sep 26, 2019

CLA assistant check
All CLA requirements met.

@AGMETEOR AGMETEOR changed the title Add UnmarshalYAML method to CredentialDefinition type Made credentials required by default by adding UnmarshalYAML method to CredentialDefinition type Sep 26, 2019
@carolynvs
Copy link
Member

@AGMETEOR Is your pull request ready for someone to review? If so, please click the "Ready for review button" at the bottom of your pull request.

Screen Shot 2019-09-30 at 9 23 47 AM

@AGMETEOR AGMETEOR marked this pull request as ready for review September 30, 2019 14:28
Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

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

LGTM

@carolynvs carolynvs assigned vdice and unassigned jeremyrickard Sep 30, 2019
@carolynvs
Copy link
Member

In the spec for this issue, it's mentioned that THERE IS NO WARNING. The bundle just fails in odd places with unexpected errors because the bundle was written assuming credentials would be there, and they aren't. Can this be solved within this issue?

This is why we decided that in Porter, credentials are required by default. It will avoid that usability problem. 😀

There is a larger discussion coming up in the spec around being able to specify that a credential only applies to a specific action, cnabio/cnab-spec#279. That is a while off though because it would require a spec version bump.

So for now this PR you just submitted is our workaround. 👍

@vdice
Copy link
Member

vdice commented Sep 30, 2019

/azp run porter-integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vdice
Copy link
Member

vdice commented Sep 30, 2019

Integration tests look good. The cli_test failure is separate from this PR (exists on master). I've issued a proposed fix in #671.

Thank you for this feature @AGMETEOR ! Have been looking forward to this update for some time :)

@vdice vdice merged commit f21f395 into getporter:master Sep 30, 2019
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

5 participants