-
Notifications
You must be signed in to change notification settings - Fork 1
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
San 5253 no dockerfile error #1849
base: master
Are you sure you want to change the base?
Conversation
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) { |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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) // ???
}
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.