Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Proposals don't support empty commit links #96

Open
evonide opened this issue Feb 5, 2021 · 2 comments
Open

Proposals don't support empty commit links #96

evonide opened this issue Feb 5, 2021 · 2 comments
Assignees
Milestone

Comments

@evonide
Copy link
Contributor

evonide commented Feb 5, 2021

Describe the bug
Creating a proposal with an empty commit link currently leads to the application error: "Please specify a valid commit link".

To Reproduce
Steps to reproduce the behavior:

  1. Go to any vulnerability entry (with an existing commit link).
  2. Propose changes and leave commit link empty or remove it.
  3. Submit changes.

Expected behavior
Commit links are supposed to be optional.

Additional context
data/models/vulnerability.py has a commit_link.setter. Using just a return for empty strings leads to an error in the diff algorithm in data/models/base.py where it would not recognize that the commit link has been changed and reject the proposal.

@evonide evonide added this to the Gray Mercury milestone Feb 5, 2021
@evonide
Copy link
Contributor Author

evonide commented Feb 5, 2021

There is also redundant code like if form_submitted and commit["commit_link"]: in the router logic for vulnerabilities and profiles that attempts to validate a commit link once it has been passed. Once this is fixed we should be able to remove such code.

@bluec0re
Copy link
Contributor

Clearing an existing commit link also requires to remove the respective linked commit entry in the database. So this requires at least the following, separate steps:

  • Allowing empty commit links on new/vanilla entries
  • Allowing to clear commit links on existing entries
  • Removal of commit entries if a commit link was cleared
  • Improving the diff code

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants