Skip to content

GitLab

  • Menu
    • Projects Groups Snippets
      Help
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #3615

Closed
Open
Created 12 years ago by Administrator@rootOwner
  • New issue

  • Report abuse

  • New issue

  • Report abuse

Validation webhooks

Closed

Validation webhooks

Created by: joren

The validation on web hooks doesn't really does his job. It only ignores url's that don't start with http or https. But when the url is tested or actually called it failes because URI.parse fails.

I'm not sure what the preferred change is. I could change URI.regexp() with a better regex, use a custom validator or something like http://www.simonecarletti.com/code/publicsuffix/. I'm not really familiar with the style guide of the development but would like to help.

I added 3 test of url's that should fail because it would not be able to be parsed when the webhook gets called.

Failures:

  1) ProjectHook Validations url format 
     Failure/Error: it { should_not allow_value("http://ex_ample.com").for(:url) }
       Expected errors  when url is set to "http://ex_ample.com", got no errors
     # ./spec/models/web_hook_spec.rb:38:in `block (4 levels) in <top (required)>'

  2) ProjectHook Validations url format 
     Failure/Error: it { should_not allow_value("http://example").for(:url) }
       Expected errors  when url is set to "http://example", got no errors
     # ./spec/models/web_hook_spec.rb:39:in `block (4 levels) in <top (required)>'

  3) ProjectHook Validations url format 
     Failure/Error: it { should_not allow_value("http://ex ample").for(:url) }
       Expected errors  when url is set to "http://ex ample", got no errors
     # ./spec/models/web_hook_spec.rb:40:in `block (4 levels) in <top (required)>'

Linked issues
0


  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: bbodenmiller

    I'd just submit a pull request with your desired changes.

    By Administrator on 2013-05-16T19:51:09 (imported from GitLab project)

  • Administrator
    Administrator @root · 12 years ago
    Owner

    Created by: senny

    I'm closing this one as it is more a question / feature request than a bug report.

    If you are interested to work on GitLab and improve the validations it would be much appreciated! You can start by reading the contribution guidelines. Then just work on a simple sample implementation to make your desired changes and open a Pull Request. Feel free to ping me if you have further questions.

    By Administrator on 2013-05-19T06:59:40 (imported from GitLab project)

  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
0 Assignees
None
Assign to
Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Due date
None
None
0
Labels
None
Assign labels
  • No matching results
  • Manage project labels
Confidentiality
Not confidential
Not confidential

You are going to turn on confidentiality. Only team members with at least Reporter access will be able to see and leave comments on the issue.

Lock issue
Unlocked
1
1 participant
user avatar
Reference: gpt/large_projects/gitlabhq1#3615

Menu

Projects Groups Snippets
Help