integrity-integrity 0.1.9.3 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/AUTHORS ADDED
@@ -0,0 +1,35 @@
1
+ Integrity is maintained by Nicolás Sanguinetti and Simon Rozet.
2
+
3
+ Thanks to the following people for their feedbacks, ideas and patches :
4
+
5
+ * Bodaniel Jeanes
6
+ * James Golick
7
+ * Wilson Bilkovich
8
+ * Mislav Marohnić
9
+ * Miles Z. Sterrett
10
+ * Kyle Hargraves
11
+ * Josh Nichols
12
+ * Jeremy Hinegardner
13
+ * Chris Wanstrath
14
+ * Will Leinweber
15
+ * Pier-Hugues Pellerin
16
+ * Justin Knowlden
17
+ * Elliott Cable
18
+ * dbr
19
+ * Scott Taylor
20
+ * Jeff Whitmire
21
+ * Diego Algorta
22
+ * Eric Mill
23
+ * Pat Nakajima
24
+ * Nick Quaranto
25
+ * Levent Ali
26
+ * Jeff Schoolcraft
27
+ * James Adam
28
+ * Harry Vangberg
29
+ * Guilherme Chapiewski
30
+ * David Dollar
31
+ * Corey Donohoe
32
+ * Christopher Redinger
33
+ * Alexander Lang
34
+
35
+ NOTE: Please let us know if your name is missing
data/CHANGES CHANGED
@@ -1,8 +1,26 @@
1
- 0.1.9.4 / unreleased
1
+ 0.1.10 / 2009-05-14
2
2
  ====================
3
3
 
4
- * Fix that notifications are sent to every notifiers,
5
- including disabled ones
4
+ * Bundle the NULL commit author/message fix as a migration
5
+
6
+ * Fix issue with stale notifier. See 693c95e for details
7
+
8
+ * Rename the "Build the last commit" button to "Fetch and build"
9
+
10
+ * Fix the rebuild button (Eric Mill)
11
+
12
+ * Various improvements to the Heroku install (Miles Z. Sterrett)
13
+
14
+ * Documentation to the default config.yml for the
15
+ :build_all_commits option. (Jeff Whitmire)
16
+
17
+ * `integrity launch` now saves the database into $HOME/.integrity.sqlite3
18
+
19
+ * Changed the Notifier::Test API. Notifiers tests are expected
20
+ to break. That API is still not defined and might change at
21
+ any time. See [#130] to discuss this.
22
+
23
+ * Send notifications to enabled notifiers only
6
24
 
7
25
  0.1.9.3 / 2009-04-06
8
26
  ====================
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008, 2009 Nicolás Sanguinetti <http://nicolassanguinetti.info>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -11,9 +11,9 @@ Integrity
11
11
  Try it!
12
12
  -------
13
13
 
14
- $ git clone git://github.com/foca/integrity.git
14
+ $ git clone git://github.com/integrity/integrity.git
15
15
  $ rake launch
16
- # Navigate to <http://0.0.0.0:4567>
16
+ $ open http://0.0.0.0:4567/
17
17
 
18
18
  Run the test suite
19
19
  ------------------
@@ -24,59 +24,17 @@ Run the test suite
24
24
  `gem build integrity.gemspec && gem install *.gem --development`.
25
25
  3. Run the test suite: `rake test`
26
26
 
27
- Thanks
28
- ------
27
+ Why we don't `require "rubygems"`
28
+ ---------------------------------
29
29
 
30
- Thanks to the following people for their feedbacks, ideas and patches :
31
-
32
- * [James Adam][james]
33
- * [Elliott Cable][ec]
34
- * [Corey Donohoe][atmos]
35
- * [Kyle Hargraves][kyle]
36
- * [Pier-Hugues Pellerin][ph]
37
- * [Simon Rozet][sr]
38
- * [Scott Taylor][scott]
39
-
40
- License
41
- -------
42
-
43
- (The MIT License)
44
-
45
- Copyright (c) 2008 [Nicolás Sanguinetti][foca], [entp][]
46
-
47
- Permission is hereby granted, free of charge, to any person obtaining
48
- a copy of this software and associated documentation files (the
49
- 'Software'), to deal in the Software without restriction, including
50
- without limitation the rights to use, copy, modify, merge, publish,
51
- distribute, sublicense, and/or sell copies of the Software, and to
52
- permit persons to whom the Software is furnished to do so, subject to
53
- the following conditions:
54
-
55
- The above copyright notice and this permission notice shall be
56
- included in all copies or substantial portions of the Software.
57
-
58
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
59
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
60
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
61
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
62
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
63
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
64
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
+ We decided to leave that choice up to the user. For more information, please
31
+ see [Why "require 'rubygems'" In Your Library/App/Tests Is Wrong][rubygems]
32
+ by [Ryan Tomayko][rtomayko].
65
33
 
66
34
  [website]: http://integrityapp.com
67
35
  [demo]: http://builder.integrityapp.com
68
- [repo]: http://github.com/foca/integrity
36
+ [repo]: http://github.com/integrity/integrity
69
37
  [lighthouse]: http://integrity.lighthouseapp.com/projects/14308-integrity
70
38
  [irc-channel]: irc://irc.freenode.net/integrity
71
-
72
- [foca]: http://nicolassanguinetti.info/
73
- [entp]: http://entp.com
74
-
75
- [james]: http://github.com/lazyatom
76
- [ec]: http://github.com/elliotcabble
77
- [atmos]: http://github.com/atmos
78
- [kyle]: http://github.com/pd
79
- [ph]: http://github.com/ph
80
- [sr]: http://purl.org/net/sr/
81
- [scott]: http://github.com/smtlaissezfaire
82
-
39
+ [rubygems]: http://gist.github.com/54177
40
+ [rtomayko]: http://tomayko.com/about
data/integrity.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "integrity"
3
- s.version = "0.1.9.3"
4
- s.date = "2009-04-06"
3
+ s.version = "0.1.10"
4
+ s.date = "2009-05-14"
5
5
 
6
6
  s.description = "Your Friendly Continuous Integration server. Easy, fun and painless!"
7
7
  s.summary = "The easy and fun Continuous Integration server"
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.has_rdoc = false
19
19
  s.rubygems_version = "1.3.1"
20
20
 
21
- s.add_dependency "sinatra", [">= 0.9.1.1"]
21
+ s.add_dependency "sinatra", ["= 0.9.1.1"]
22
22
  s.add_dependency "sinatra-authorization"
23
23
  s.add_dependency "haml", [">= 2.0.0"]
24
24
  s.add_dependency "data_mapper", ["= 0.9.11"]
@@ -42,7 +42,9 @@ Gem::Specification.new do |s|
42
42
 
43
43
  s.files = %w[
44
44
  .gitignore
45
+ AUTHORS
45
46
  CHANGES
47
+ LICENSE
46
48
  README.md
47
49
  Rakefile
48
50
  bin/integrity
@@ -95,6 +97,7 @@ test/acceptance/error_page_test.rb
95
97
  test/acceptance/installer_test.rb
96
98
  test/acceptance/manual_build_project_test.rb
97
99
  test/acceptance/not_found_page_test.rb
100
+ test/acceptance/notifier_test_test.rb
98
101
  test/acceptance/project_syndication_test.rb
99
102
  test/acceptance/stylesheet_test.rb
100
103
  test/acceptance/unauthorized_page_test.rb
data/lib/integrity.rb CHANGED
@@ -2,6 +2,8 @@ $:.unshift File.expand_path(File.dirname(__FILE__))
2
2
 
3
3
  require "json"
4
4
  require "haml"
5
+ require "sass"
6
+ require "builder"
5
7
  require "dm-core"
6
8
  require "dm-validations"
7
9
  require "dm-types"
@@ -17,12 +17,12 @@ module Integrity
17
17
  project_url(project, path).path
18
18
  end
19
19
 
20
- def commit_url(commit)
21
- project_url(commit.project, "commits", commit.identifier)
20
+ def commit_url(commit, *path)
21
+ project_url(commit.project, ["commits", commit.identifier, *path].flatten)
22
22
  end
23
23
 
24
24
  def commit_path(commit, *path)
25
- commit_url(commit).path
25
+ commit_url(commit, *path).path
26
26
  end
27
27
 
28
28
  def build_path(build, *path)
@@ -47,7 +47,8 @@ module Integrity
47
47
  require "thin"
48
48
  require "do_sqlite3"
49
49
 
50
- options[:port] ||= 4567
50
+ port = options[:port] || 4567
51
+
51
52
  config = { :database_uri => "sqlite3://#{ENV["HOME"]}/.integrity.db",
52
53
  :base_uri => "http://0.0.0.0:#{options[:port]}",
53
54
  :export_directory => "/tmp/integrity-exports" }
@@ -55,7 +56,7 @@ module Integrity
55
56
 
56
57
  migrate_db(config)
57
58
 
58
- Thin::Server.start("0.0.0.0", options[:port], Integrity::App)
59
+ Thin::Server.start("0.0.0.0", port, Integrity::App)
59
60
  rescue LoadError => boom
60
61
  $stderr << "Make sure thin and do_sqlite3 are insatalled\n\n"
61
62
  raise
@@ -84,8 +84,8 @@ module Integrity
84
84
  create_table :integrity_commits do
85
85
  column :id, Integer, :serial => true
86
86
  column :identifier, String, :nullable => false
87
- column :message, String, :nullable => true, :length => 255
88
- column :author, String, :nullable => true, :length => 255
87
+ column :message, String, :nullable => false, :length => 255
88
+ column :author, String, :nullable => false, :length => 255
89
89
  column :committed_at, DateTime, :nullable => false
90
90
  column :created_at, DateTime
91
91
  column :updated_at, DateTime
@@ -147,5 +147,26 @@ module Integrity
147
147
  # modify_table(:integrity_notifiers) { drop_column :enabled }
148
148
  end
149
149
  end
150
+
151
+ migration 4, :nil_commit_metadata do
152
+ up do
153
+ all_commits = Commit.all.collect { |c| c.dup }
154
+ drop_table :integrity_commits
155
+
156
+ create_table :integrity_commits do
157
+ column :id, Integer, :serial => true
158
+ column :identifier, String, :nullable => false
159
+ column :message, String, :nullable => true, :length => 255
160
+ column :author, String, :nullable => true, :length => 255
161
+ column :committed_at, DateTime, :nullable => false
162
+ column :created_at, DateTime
163
+ column :updated_at, DateTime
164
+
165
+ column :project_id, Integer
166
+ end
167
+
168
+ all_commits.each { |commit| Commit.create(commit.attributes) }
169
+ end
170
+ end
150
171
  end
151
172
  end
@@ -33,7 +33,7 @@ module Integrity
33
33
  private_class_method :valid?
34
34
 
35
35
  def notify_of_build(build)
36
- to_const.notify_of_build(build, config)
36
+ to_const.notify_of_build(build, config) if to_const
37
37
  end
38
38
 
39
39
  private
@@ -17,6 +17,8 @@ module Integrity
17
17
  property :created_at, DateTime
18
18
  property :updated_at, DateTime
19
19
 
20
+ default_scope(:default).update(:order => [:name.asc])
21
+
20
22
  has n, :commits, :class_name => "Integrity::Commit"
21
23
  has n, :notifiers, :class_name => "Integrity::Notifier"
22
24
 
@@ -1,6 +1,5 @@
1
1
  require File.dirname(__FILE__) + "/../helpers/acceptance"
2
2
  require "helpers/acceptance/notifier_helper"
3
- require "helpers/acceptance/textfile_notifier"
4
3
  require "helpers/acceptance/email_notifier"
5
4
 
6
5
  class BuildNotificationsTest < Test::Unit::AcceptanceTestCase
@@ -14,7 +13,11 @@ class BuildNotificationsTest < Test::Unit::AcceptanceTestCase
14
13
 
15
14
  before(:each) do
16
15
  # This is needed before any available notifier is unset
17
- # in the global #before
16
+ # in the global #before.
17
+ # But, we need the reload this one because we remove_const
18
+ # it in a test case. Sigh.
19
+ load "helpers/acceptance/textfile_notifier.rb"
20
+
18
21
  Notifier.register(Integrity::Notifier::Textfile)
19
22
  Notifier.register(Integrity::Notifier::Email)
20
23
  end
@@ -79,6 +82,27 @@ class BuildNotificationsTest < Test::Unit::AcceptanceTestCase
79
82
  assert_have_email_notifier
80
83
  end
81
84
 
85
+ scenario "an admin enables the Textfile notifier and get rid of it later" do
86
+ git_repo(:my_test_project).add_successful_commit
87
+ Project.gen(:my_test_project, :uri => git_repo(:my_test_project).path)
88
+
89
+ login_as "admin", "test"
90
+ visit "/my-test-project"
91
+
92
+ click_link "Edit Project"
93
+ check "enabled_notifiers_textfile"
94
+ fill_in "File", :with => "/tmp/textfile_notifications.txt"
95
+ click_button "Update Project"
96
+
97
+ Notifier.send(:remove_const, :Textfile)
98
+ Notifier.available.clear
99
+ rm_f "/tmp/textfile_notifications.txt"
100
+
101
+ click_button "manual build"
102
+
103
+ assert ! File.file?("/tmp/textfile_notifications.txt")
104
+ end
105
+
82
106
  scenario "an admin configures various notifiers accros multiple projects" do
83
107
  Project.first(:permalink => "integrity").should be_nil
84
108
 
@@ -53,7 +53,7 @@ class ManualBuildProjectTest < Test::Unit::AcceptanceTestCase
53
53
  click_button "Update Project"
54
54
 
55
55
  visit "/my-test-project"
56
- click_button "Build the last commit"
56
+ click_button "Fetch and build"
57
57
 
58
58
  assert_have_tag("h1", :content => "success")
59
59
  end
@@ -0,0 +1,37 @@
1
+ require File.dirname(__FILE__) + "/../helpers/acceptance"
2
+ require "helpers/acceptance/email_notifier"
3
+ require "helpers/acceptance/textfile_notifier"
4
+
5
+ require "integrity/notifier/test"
6
+
7
+ class NotifierTestTest < Test::Unit::TestCase
8
+ include Integrity::Notifier::Test
9
+
10
+ setup do
11
+ @notifier = Integrity::Notifier::Textfile
12
+ @config = {"file" => "/tmp/integrity.txt"}
13
+
14
+ FileUtils.rm @config["file"] if File.exists?(@config["file"])
15
+ end
16
+
17
+ def notifier
18
+ "Textfile"
19
+ end
20
+
21
+ test "it provides a formulary to configure options" do
22
+ assert provides_option?("file")
23
+ assert provides_option?("file", @config["file"])
24
+ end
25
+
26
+ test "it sends notification" do
27
+ build = build(:successful)
28
+
29
+ @notifier.notify_of_build(build, @config)
30
+
31
+ notification = File.read(@config["file"])
32
+
33
+ assert notification.start_with?("===")
34
+ assert notification.include?(build.commit.identifier)
35
+ assert notification.include?("successful")
36
+ end
37
+ end
@@ -61,6 +61,13 @@ class BrowsePublicProjectsTest < Test::Unit::TestCase
61
61
  }
62
62
  end
63
63
 
64
+ test "build commit" do
65
+ assert_equal "/ci/foo-bar/commits/#{@commit.identifier}/builds",
66
+ @h.commit_path(@build.commit, :builds)
67
+ assert_equal "http://example.org/ci/foo-bar/commits/#{@commit.identifier}/builds",
68
+ @h.commit_url(@build.commit, :builds).to_s
69
+ end
70
+
64
71
  test "compat" do
65
72
  silence_warnings {
66
73
  assert_equal @h.build_path(@build), @h.commit_path(@build.commit)
@@ -31,18 +31,20 @@ class MigrationsTest < Test::Unit::TestCase
31
31
  test "upgrading a pre migration database" do
32
32
  capture_stdout { Integrity.migrate_db }
33
33
 
34
- current_migrations.should == ["initial", "add_commits", "add_enabled_column"]
34
+ current_migrations.should == ["initial", "add_commits",
35
+ "add_enabled_column", "nil_commit_metadata"]
35
36
  assert table_exists?("integrity_projects")
36
37
  assert table_exists?("integrity_builds")
37
38
  assert table_exists?("integrity_notifiers")
38
39
  assert table_exists?("integrity_commits")
39
40
  end
40
41
 
41
- test "migrating data from initial to add_commits migration" do
42
+ test "migrating data up from initial to the last migration" do
42
43
  load_initial_migration_fixture
43
-
44
44
  capture_stdout { Integrity.migrate_db }
45
- current_migrations.should == ["initial", "add_commits", "add_enabled_column"]
45
+
46
+ current_migrations.should == ["initial", "add_commits",
47
+ "add_enabled_column", "nil_commit_metadata"]
46
48
 
47
49
  sinatra = Project.first(:name => "Sinatra")
48
50
  sinatra.should have(1).commits
@@ -145,6 +145,20 @@ class ProjectTest < Test::Unit::TestCase
145
145
  end
146
146
  end
147
147
 
148
+ describe "Finding any project" do
149
+ before(:each) do
150
+ @rails = Project.gen(:name => "rails", :public => true)
151
+ @merb = Project.gen(:name => "merb", :public => true)
152
+ @sinatra = Project.gen(:name => "sinatra", :public => true)
153
+ @camping = Project.gen(:name => "camping", :public => false)
154
+ end
155
+
156
+ it "should always be ordered by name" do
157
+ Project.all.should == [@camping, @merb, @rails, @sinatra]
158
+ Project.all(:public => true).should == [@merb, @rails, @sinatra]
159
+ end
160
+ end
161
+
148
162
  describe "When finding its previous builds" do
149
163
  before(:each) do
150
164
  @project = Project.generate(:commits => 5.of { Commit.gen })
@@ -212,8 +226,10 @@ class ProjectTest < Test::Unit::TestCase
212
226
 
213
227
  assert_equal 2, Notifier.count
214
228
  assert_equal 2, project.enabled_notifiers.count
215
- assert_equal "IRC", project.notifiers.first.name
216
- assert_equal "Twitter", project.notifiers.last.name
229
+
230
+ notifier_names = project.notifiers.map { |n| n.name }
231
+ assert notifier_names.include?("IRC")
232
+ assert notifier_names.include?("Twitter")
217
233
 
218
234
  project.update_notifiers(["Twitter"],
219
235
  {"IRC" => {"uri" => "irc://irc.freenode.net/integrity"},
data/views/project.haml CHANGED
@@ -14,9 +14,8 @@
14
14
 
15
15
  %form{ :action => project_path(@project, :builds), :method => :post }
16
16
  %p.submit.manual-build
17
- %button{ :type => :submit, :title => "Fetch the last commit and build it" }<
18
- Build the last commit
19
- in the repository (or rebuild the latest)
17
+ %button{ :type => :submit, :title => "Fetch the last commit from the remote repository and build it" }<
18
+ Fetch and build
20
19
 
21
20
  - unless @project.previous_commits.empty?
22
21
  %h2 Previous builds
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: integrity-integrity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9.3
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Nicol\xC3\xA1s Sanguinetti"
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-04-06 00:00:00 -07:00
13
+ date: 2009-05-14 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -19,7 +19,7 @@ dependencies:
19
19
  version_requirement:
20
20
  version_requirements: !ruby/object:Gem::Requirement
21
21
  requirements:
22
- - - ">="
22
+ - - "="
23
23
  - !ruby/object:Gem::Version
24
24
  version: 0.9.1.1
25
25
  version:
@@ -203,7 +203,9 @@ extra_rdoc_files: []
203
203
 
204
204
  files:
205
205
  - .gitignore
206
+ - AUTHORS
206
207
  - CHANGES
208
+ - LICENSE
207
209
  - README.md
208
210
  - Rakefile
209
211
  - bin/integrity
@@ -256,6 +258,7 @@ files:
256
258
  - test/acceptance/installer_test.rb
257
259
  - test/acceptance/manual_build_project_test.rb
258
260
  - test/acceptance/not_found_page_test.rb
261
+ - test/acceptance/notifier_test_test.rb
259
262
  - test/acceptance/project_syndication_test.rb
260
263
  - test/acceptance/stylesheet_test.rb
261
264
  - test/acceptance/unauthorized_page_test.rb