Skip to content

Conversation

@henrymollman
Copy link
Contributor

This PR will display a dockerfile error message in the case that a user has a dockerfile in their master branch, but no dockerfile in a feature branch. If the user tries to deploy that branch, the build will error out but will give no indication as to why.

Test included to verify that an instance w/ a dockerfile configured, but no dockerfile capable of being fetched by repo/branchname, will show the showNoDockerfileError in the UI.

var repoName = repoAndBranchName[0];
var branchName = repoAndBranchName[1];
var dockerfilePath = keypather.get(BLC, 'instance.mirroredDockerfile.attrs.path') + keypather.get(BLC, 'instance.mirroredDockerfile.attrs.name');
if (!!dockerfilePath) {
Copy link
Member

Choose a reason for hiding this comment

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

No need for the !!. We don't use this convention anywhere for if statements, since the result is exactly the same.

var repoAndBranchName = BLC.instance.getRepoAndBranchName().split('/');
var repoName = repoAndBranchName[0];
var branchName = repoAndBranchName[1];
var dockerfilePath = keypather.get(BLC, 'instance.mirroredDockerfile.attrs.path') + keypather.get(BLC, 'instance.mirroredDockerfile.attrs.name');
Copy link
Member

Choose a reason for hiding this comment

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

We're 100% the path has a / a the end, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would it make a difference? I'm assuming there is nothing at the end, usually it is just repo/branch

var repoAndBranchName = BLC.instance.getRepoAndBranchName().split('/');
var repoName = repoAndBranchName[0];
var branchName = repoAndBranchName[1];
var dockerfilePath = keypather.get(BLC, 'instance.mirroredDockerfile.attrs.path') + keypather.get(BLC, 'instance.mirroredDockerfile.attrs.name');
Copy link
Member

Choose a reason for hiding this comment

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

Hmm... this code only works as expected because of this kirk: !!(null + null), right? Seems like we should be checking for these properties individually?

var dockerfilePath = keypather.get(BLC, 'instance.mirroredDockerfile.attrs.path');
var dockerfileName = keypather.get(BLC, 'instance.mirroredDockerfile.attrs.name');
if (dockerfilePath && dockerfileName) {
  fetchRepoDockerfile(repoName, branchName, dockerfilePath + dockerfileName) // ???
} 

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.

3 participants