Skip to content

Commit

Permalink
[api] fix regexp of cve tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Jan 24, 2012
1 parent c832c48 commit 0ed9e15
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/api/db/development_structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,8 @@ INSERT INTO schema_migrations (version) VALUES ('20120120104301');

INSERT INTO schema_migrations (version) VALUES ('20120120114301');

INSERT INTO schema_migrations (version) VALUES ('20120124114301');

INSERT INTO schema_migrations (version) VALUES ('21');

INSERT INTO schema_migrations (version) VALUES ('22');
Expand Down
15 changes: 15 additions & 0 deletions src/api/db/migrate/20120124114301_fix_cve_regexp.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class FixCveRegexp < ActiveRecord::Migration
def self.up
t=IssueTracker.find_by_name('cve')
t.regex="(CVE-\d{4,4}-\d{4,4})"
t.save
Delayed::Job.enqueue IssueTrackersToBackendJob.new
end

def self.down
t=IssueTracker.find_by_name('cve')
t.regex="CVE-\d{4,4}-\d{4,4}"
t.save
Delayed::Job.enqueue IssueTrackersToBackendJob.new
end
end
2 changes: 1 addition & 1 deletion src/api/db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
IssueTracker.find_or_create_by_name('boost', :description => 'Boost Trac', :kind => 'trac', :regex => 'boost#(\d+)', :url => 'https://svn.boost.org/trac/boost/', :long_name => "boost#%s", :show_url => 'https://svn.boost.org/trac/boost/ticket/@@@')
IssueTracker.find_or_create_by_name('bco', :description => 'Clutter Project Bugzilla', :kind => 'bugzilla', :regex => 'bco#(\d+)', :url => 'http://bugzilla.clutter-project.org/', :long_name => "bco#%s", :show_url => 'http://bugzilla.clutter-project.org/show_bug.cgi?id=@@@')
IssueTracker.find_or_create_by_name('RT', :description => 'CPAN Bugs', :kind => 'other', :regex => 'RT#(\d+)', :url => 'https://rt.cpan.org/', :long_name => "RT#%s", :show_url => 'http://rt.cpan.org/Public/Bug/Display.html?id=@@@')
IssueTracker.find_or_create_by_name('cve', :description => 'CVE Numbers', :kind => 'cve', :regex => 'CVE-\d{4,4}-\d{4,4}', :url => 'http://cve.mitre.org/', :long_name => "%s", :show_url => 'http://cve.mitre.org/cgi-bin/cvename.cgi?name=@@@')
IssueTracker.find_or_create_by_name('cve', :description => 'CVE Numbers', :kind => 'cve', :regex => '(CVE-\d{4,4}-\d{4,4})', :url => 'http://cve.mitre.org/', :long_name => "%s", :show_url => 'http://cve.mitre.org/cgi-bin/cvename.cgi?name=@@@')
IssueTracker.find_or_create_by_name('deb', :description => 'Debian Bugzilla', :kind => 'bugzilla', :regex => 'deb#(\d+)', :url => 'http://bugs.debian.org/', :long_name => "deb#%s", :show_url => 'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=@@@')
IssueTracker.find_or_create_by_name('fdo', :description => 'Freedesktop.org Bugzilla', :kind => 'bugzilla', :regex => 'fdo#(\d+)', :url => 'https://bugs.freedesktop.org/', :long_name => "fdo#%s", :show_url => 'https://bugs.freedesktop.org/show_bug.cgi?id=@@@')
IssueTracker.find_or_create_by_name('GCC', :description => 'GCC Bugzilla', :kind => 'bugzilla', :regex => 'GCC#(\d+)', :url => 'http://gcc.gnu.org/bugzilla/', :long_name => "GCC#%s", :show_url => 'http://gcc.gnu.org/bugzilla/show_bug.cgi?id=@@@')
Expand Down

0 comments on commit 0ed9e15

Please sign in to comment.