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

"Add Version" Create Button Should Be Inactive Until Version Provided #995

Closed
2 tasks done
msymons opened this issue Sep 16, 2024 · 8 comments · Fixed by #1039
Closed
2 tasks done

"Add Version" Create Button Should Be Inactive Until Version Provided #995

msymons opened this issue Sep 16, 2024 · 8 comments · Fixed by #1039
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Issues eligible for Hacktoberfest contributions size/S Small effort
Milestone

Comments

@msymons
Copy link
Member

msymons commented Sep 16, 2024

Current Behavior

In the Frontend, a new project version can be created via View Details -> Add Version

The resulting dialog has a create button that is active. Clicking it without providing a Version string will result in an HTTP 400 error and some 190 lines of exception logging in the server log, starting with...

2024-09-15 19:08:46,561 ERROR [ServerRuntime$Responder] An I/O error has occurred while writing a response message entity to the container output stream.
org.glassfish.jersey.server.internal.process.MappableException: org.eclipse.jetty.io.EofException
	at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:67)
	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:139)
	at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1116)
	at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:649)

If an admin is looking at the logs then they have absolutely no context for what caused the exception.

Proposed Behavior

The "Create" button should be inactive until something has been provided in the "Version" field.

image

Checklist

@msymons msymons added enhancement New feature or request good first issue Good for newcomers size/S Small effort labels Sep 16, 2024
@leec94 leec94 added the hacktoberfest Issues eligible for Hacktoberfest contributions label Sep 26, 2024
@IdrisGit
Copy link
Contributor

IdrisGit commented Oct 6, 2024

Hi, I think it should also have a backend validation for the request body to check if the version value is provided and correct, however, a client-side validation is very useful from the UX and the program side.

I can look into this issue, does this issue need to be assigned to me or can I fix and open a PR for it? Please let me know.

@msymons
Copy link
Member Author

msymons commented Oct 7, 2024

@IdrisGit, you can normally just start working on an issue and submit a PR, but assigning the issue to you is a process improvement because then others can see that the issue is "spoken for". That's especially valuable right at the moment during Hacktoberfest.

Are you participating in Hacktoberfest? If you are not then let us know and the hackoberfest label can be removed from this issue.

@IdrisGit
Copy link
Contributor

IdrisGit commented Oct 7, 2024

Sure, I will start working on it.
I am participating in the Hacktoberfest and hoping to use it as an opportunity to get into the world of Open Source as a contributor.

@IdrisGit
Copy link
Contributor

IdrisGit commented Oct 7, 2024

I am trying to setup and test out my changes locally, I am able to launch the dev server for the frontend and the backend, frontend requires login credentials, are there any default values or a bypass method that I can use to test locally, or do I need to setup the database and users table?

@leec94
Copy link

leec94 commented Oct 7, 2024

hi @IdrisGit , the default credentials can be found here: https://docs.dependencytrack.org/getting-started/initial-startup/

@IdrisGit
Copy link
Contributor

IdrisGit commented Oct 8, 2024

I have opened a PR that fixes the issue. Please let me know if any changes are required or if you need any additional details from me.

Also, I noticed that the version input field is optional when creating a new project. Is this intentional, or is a version value required when a new project is created?
Image

If it is not intentional and the version is required, let me know and I can work on that part and raise a new PR or update the existing PR.

@msymons
Copy link
Member Author

msymons commented Oct 9, 2024

@IdrisGit, thanks again for the contribution.

Also, I noticed that the version input field is optional when creating a new project. Is this intentional, or is a version value required when a new project is created?

It is intentional. Or, rather, it perhaps "was originally intentional" in the days before the ability to clone a project was introduced.

I have several projects in my production system that have been created without versions and they all work perfectly fine.

I am sure that things can be improved and things might be re-evaluated in the future after collection projects, etc, are introduced.

Having said that, I have tested new project creation and perhaps logging can be improved.

@IdrisGit
Copy link
Contributor

Let me know if there some task that I can look into for the project creation and logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Issues eligible for Hacktoberfest contributions size/S Small effort
Projects
None yet
4 participants