Force users to reenter integration passwords instead of silently clearing them
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "bug" label: - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary Under certain conditions (usually when changing fields like URL), we clear fields with `type: :password` to avoid accidental exposure. Instead of silently clearing it (bypassing our validations, and breaking the configuration), we should force users to reenter passwords. <!-- Summarize the bug encountered concisely. --> ### Steps to reproduce <!-- Describe how one can reproduce the issue - this is very important. Please use an ordered list. --> 1. Create a new `Jenkins CI` integration, filling in the URL, project name, username, and password fields. 1. Save the form. 1. Edit the URL, without changing any other fields. 1. Save the form. ### What is the current *bug* behavior? <!-- Describe what actually happens. --> The integration is saved without errors, but the `password` field in the DB is now blank. The UI won't really show any indication of this, except that the form label now says `Password` again instead of `Enter new password`. The same bug can be observed on other integrations with password fields, depending on which fields are changed: - `BambooService` - `JenkinsService` - `JiraService` - `TeamcityService` ### What is the expected *correct* behavior? <!-- Describe what you should see instead. --> Users should have to reenter passwords. ### Output of checks This bug happens on GitLab.com ### Possible fixes <!-- If you can, link to the line of code that might be responsible for the problem. --> The problem is with the `before_update :reset_password` callbacks in these integrations, this should be done in `before_validation` instead.
issue