Fix validation on External Wiki service template form
Summary
In Administration → Service Templates → External Wiki the form always requires a URL, while the form in Project Settings → Integrations → External Wiki only requires a URL if the service is enabled. We should fix the form in the administration to do the same.
The original report below mentioned some other issues regarding the behaviour of service templates, some of which should be addressed by the work in &2430.
Original report
Summary
If the external wiki is activated on service template once, this first configuration will never be overwritten by further configurations.
Steps to reproduce
- As admin, activate the external wiki with a given url on the service template
- Check on a project that the wiki forward to the link.
- Go back to service template and desactivate external wiki. 3.a (Bug 1) Delete the url: It will not accept an empty url whereas the activation checkbox is not filled
- (Bug 2) Check on a project the wiki link, it will still point toward the first url
- Go back to service template and activate with another different url
- (Bug 3) Check on a project the wiki link, it will still point toward the first url
Example Project
Not applicable since it requires root privileges
What is the current bug behavior?
- Does not allow an empty url even if the activation checkbox is unfilled
- Does not revert to internal wiki after unfilling the acivation of the service template
- Does not update to a new external wiki
What is the expected correct behavior?
see above
Relevant logs and/or screenshots
n/a
Output of checks
happen on my private instance
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.13.4 Sidekiq Version:5.0.0 Go Version: unknown
GitLab information Version: 9.4.5 Revision: 140292e Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.3.1 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...
GitLab Shell version >= 5.3.1 ? ... OK (5.3.1) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 4/8 ... ok 4/9 ... ok 4/10 ... ok 4/11 ... ok 4/15 ... ok 4/17 ... ok 5/19 ... ok 5/20 ... ok 5/21 ... ok 5/22 ... ok 5/23 ... ok 5/24 ... ok 5/25 ... ok 5/26 ... ok 5/27 ... ok 10/29 ... ok 4/30 ... ok 10/31 ... ok 11/32 ... ok 11/33 ... ok 11/34 ... ok 11/35 ... ok 11/36 ... ok 11/37 ... ok 5/38 ... ok 12/39 ... ok 12/41 ... ok 12/42 ... ok 12/43 ... ok 12/44 ... ok 14/47 ... ok 10/48 ... ok 17/51 ... ok 17/52 ... ok 17/53 ... ok 17/54 ... ok 10/55 ... ok 14/56 ... ok 1/57 ... ok 11/58 ... ok 10/59 ... ok 10/60 ... ok 11/61 ... repository is empty 15/62 ... repository is empty Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 4/8 ... yes 4/9 ... yes 4/10 ... yes 4/11 ... yes 4/15 ... yes 4/17 ... yes 5/19 ... yes 5/20 ... yes 5/21 ... yes 5/22 ... yes 5/23 ... yes 5/24 ... yes 5/25 ... yes 5/26 ... yes 5/27 ... yes 10/29 ... yes 4/30 ... yes 10/31 ... yes 11/32 ... yes 11/33 ... yes 11/34 ... yes 11/35 ... yes 11/36 ... yes 11/37 ... yes 5/38 ... yes 12/39 ... yes 12/41 ... yes 12/42 ... yes 12/43 ... yes 12/44 ... yes 14/47 ... yes 10/48 ... yes 17/51 ... yes 17/52 ... yes 17/53 ... yes 17/54 ... yes 10/55 ... yes 14/56 ... yes 1/57 ... yes 11/58 ... yes 10/59 ... yes 10/60 ... yes 11/61 ... yes 15/62 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.3 ? ... yes (2.3.3) Git version >= 2.7.3 ? ... yes (2.13.4) Active users: ... 2
Checking GitLab ... Finished