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

San 5253 no dockerfile error #1849

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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.

2 participants