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

Show warning when docker image ends with ":latest" #113

Closed
jennydaman opened this issue Mar 31, 2021 · 4 comments · Fixed by #119
Closed

Show warning when docker image ends with ":latest" #113

jennydaman opened this issue Mar 31, 2021 · 4 comments · Fixed by #119
Assignees
Labels
good first issue Good for newcomers

Comments

@jennydaman
Copy link
Collaborator

It is bad practice to use the :latest docker images, because the app (e.g. its command-line options) are subject to change in later versions.

The warning message might briefly explain why it's a bad practice, and suggest a remedy:

docker tag user/pl-mything:latest user/pl-mything:1.0.1
docker push user/pl-mything:1.0.1
@jennydaman jennydaman added the good first issue Good for newcomers label Mar 31, 2021
@DivyanshiSingh
Copy link
Contributor

Hey, @mairin I would like to work on this issue. Please assign me this.

@DivyanshiSingh
Copy link
Contributor

Hey, @jennydaman can you provide some more information that will help me in solving this issue.
I am not getting where to write the script for testing the build command.

@jennydaman
Copy link
Collaborator Author

script for testing the build command

I am not sure what you mean by this.

Here's a hacked mock-up

Screenshot

Here the user is trying to create a plugin. They've specified the "Docker Image" (dock_image) as fnndsc/pl-surf. This is a bad practice so we show the warning message

Please tag your Docker image by version.

In that box, you could include a link to a help article explaining why and how, or design a layout to provide immediate help. e.g. show a code block

docker tag fnndsc/pl-surf fnndsc/pl-surf:1.0.1
docker push fnndsc/pl-surf:1.0.1

If the user's input for dock_image ends with :latest instead, then show the warning

The :latest tag is discouraged. Please tag your Docker image by version.

Input validation code is found here

// If all the fields are empty in submission
if (errors.length === 3 && missingRepresentationString !== '') {
return this.handleError('All fields are required.');
// If one fields is empty
} else if (errors.length === 1) {
return this.handleError(`Please ${missingRepresentationString}enter
the ${errors[0]}`);
// If two fields are empty
} else if (errors.length === 2) {
return this.handleError(`Please ${missingRepresentationString}enter
the ${errors[0]} and ${errors[1]}`);
// If more than Plugin Representation or two fields are empty or
}
// If only the Plugin Representation is missing
if (errors.length === 0) {
return this.handleError('Please upload the plugin representation');
}
const lastError = errors.pop();
return this.handleError(`Please ${missingRepresentationString}enter
the ${errors.join(', ')}, and ${lastError}`);

@DivyanshiSingh
Copy link
Contributor

Ok, I got it @jennydaman.
I was moving in the wrong direction...This is a great help. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants