codefumes 0.2.2 → 0.3.0
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/.rvmrc +2 -0
- data/Gemfile +3 -1
- data/Gemfile.lock +81 -135
- data/History.txt +27 -0
- data/Manifest.txt +4 -0
- data/bin/fumes +84 -7
- data/features/claiming_a_project.feature +5 -5
- data/features/deleting_a_project.feature +4 -4
- data/features/managing_project_build_status.feature +63 -0
- data/features/releasing_a_project.feature +6 -6
- data/features/step_definitions/cli_steps.rb +12 -2
- data/features/storing_user_api_key.feature +4 -4
- data/features/synchronizing_repository_with_project.feature +4 -4
- data/lib/codefumes.rb +1 -1
- data/lib/codefumes/api/build.rb +8 -0
- data/lib/codefumes/api/commit.rb +22 -0
- data/lib/codefumes/cli_helpers.rb +8 -0
- data/lib/codefumes/errors.rb +6 -0
- data/lib/codefumes/exit_codes.rb +13 -9
- data/spec/codefumes/api/build_spec.rb +35 -3
- data/spec/codefumes/api/commit_spec.rb +23 -0
- data/spec/codefumes_service_helpers.rb +6 -0
- data/spec/fixtures/builds.xml +21 -0
- data/spec/fixtures/no_builds.xml +3 -0
- data/tasks/cucumber.rake +6 -0
- metadata +77 -44
data/.rvmrc
ADDED
data/Gemfile
CHANGED
@@ -10,10 +10,12 @@ gem 'gherkin', '2.1.5'
|
|
10
10
|
gem 'gli', '1.1.1'
|
11
11
|
gem 'grit', '2.0'
|
12
12
|
gem 'hanna', '0.1.12'
|
13
|
-
gem 'hoe', '2.
|
13
|
+
gem 'hoe', '2.6.2'
|
14
14
|
gem 'hoe-git', '1.3.0'
|
15
15
|
gem 'httparty', '0.6.1'
|
16
|
+
gem 'launchy', '0.3.7'
|
16
17
|
gem 'rake', '0.8.7'
|
17
18
|
gem 'rspec', '1.3.0'
|
18
19
|
gem 'rubigen', '1.5.5'
|
19
20
|
gem 'ruby-debug'
|
21
|
+
gem 'ZenTest'
|
data/Gemfile.lock
CHANGED
@@ -1,135 +1,81 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
- columnize:
|
83
|
-
version: 0.3.1
|
84
|
-
- crack:
|
85
|
-
version: 0.1.8
|
86
|
-
- diff-lcs:
|
87
|
-
version: 1.1.2
|
88
|
-
- trollop:
|
89
|
-
version: 1.16.2
|
90
|
-
- gherkin:
|
91
|
-
version: 2.1.5
|
92
|
-
- json_pure:
|
93
|
-
version: 1.4.6
|
94
|
-
- term-ansicolor:
|
95
|
-
version: 1.0.5
|
96
|
-
- cucumber:
|
97
|
-
version: 0.8.5
|
98
|
-
- fakeweb:
|
99
|
-
version: 1.2.8
|
100
|
-
- gemcutter:
|
101
|
-
version: 0.6.1
|
102
|
-
- gli:
|
103
|
-
version: 1.1.1
|
104
|
-
- mime-types:
|
105
|
-
version: "1.16"
|
106
|
-
- grit:
|
107
|
-
version: 2.0.0
|
108
|
-
- haml:
|
109
|
-
version: 2.2.24
|
110
|
-
- rdoc:
|
111
|
-
version: 2.3.0
|
112
|
-
- hanna:
|
113
|
-
version: 0.1.12
|
114
|
-
- rubyforge:
|
115
|
-
version: 2.0.4
|
116
|
-
- hoe:
|
117
|
-
version: 2.5.0
|
118
|
-
- hoe-git:
|
119
|
-
version: 1.3.0
|
120
|
-
- httparty:
|
121
|
-
version: 0.6.1
|
122
|
-
- linecache:
|
123
|
-
version: "0.43"
|
124
|
-
- rspec:
|
125
|
-
version: 1.3.0
|
126
|
-
- rubigen:
|
127
|
-
version: 1.5.5
|
128
|
-
- ruby-debug-base:
|
129
|
-
version: 0.10.3
|
130
|
-
- ruby-debug:
|
131
|
-
version: 0.10.3
|
132
|
-
hash: 3b81c08f31e7b6fea59ef7782384b348c7d2609a
|
133
|
-
sources:
|
134
|
-
- Rubygems:
|
135
|
-
uri: http://gemcutter.org
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
ZenTest (4.4.0)
|
5
|
+
activesupport (2.3.5)
|
6
|
+
aruba (0.2.1)
|
7
|
+
builder (2.1.2)
|
8
|
+
caleb-chronic (0.3.0)
|
9
|
+
columnize (0.3.1)
|
10
|
+
configuration (1.1.0)
|
11
|
+
crack (0.1.8)
|
12
|
+
cucumber (0.8.5)
|
13
|
+
builder (~> 2.1.2)
|
14
|
+
diff-lcs (~> 1.1.2)
|
15
|
+
gherkin (~> 2.1.4)
|
16
|
+
json_pure (~> 1.4.3)
|
17
|
+
term-ansicolor (~> 1.0.4)
|
18
|
+
diff-lcs (1.1.2)
|
19
|
+
fakeweb (1.2.8)
|
20
|
+
gherkin (2.1.5)
|
21
|
+
trollop (~> 1.16.2)
|
22
|
+
gli (1.1.1)
|
23
|
+
grit (2.0.0)
|
24
|
+
diff-lcs (>= 1.1.2)
|
25
|
+
mime-types (>= 1.15)
|
26
|
+
haml (2.2.24)
|
27
|
+
hanna (0.1.12)
|
28
|
+
haml (~> 2.2.8)
|
29
|
+
rake (~> 0.8.2)
|
30
|
+
rdoc (~> 2.3.0)
|
31
|
+
hoe (2.6.2)
|
32
|
+
rake (>= 0.8.7)
|
33
|
+
rubyforge (>= 2.0.4)
|
34
|
+
hoe-git (1.3.0)
|
35
|
+
hoe (>= 2.2.0)
|
36
|
+
httparty (0.6.1)
|
37
|
+
crack (= 0.1.8)
|
38
|
+
json_pure (1.4.6)
|
39
|
+
launchy (0.3.7)
|
40
|
+
configuration (>= 0.0.5)
|
41
|
+
rake (>= 0.8.1)
|
42
|
+
linecache (0.43)
|
43
|
+
mime-types (1.16)
|
44
|
+
rake (0.8.7)
|
45
|
+
rdoc (2.3.0)
|
46
|
+
rspec (1.3.0)
|
47
|
+
rubigen (1.5.5)
|
48
|
+
activesupport (~> 2.3.5)
|
49
|
+
ruby-debug (0.10.3)
|
50
|
+
columnize (>= 0.1)
|
51
|
+
ruby-debug-base (~> 0.10.3.0)
|
52
|
+
ruby-debug-base (0.10.3)
|
53
|
+
linecache (>= 0.3)
|
54
|
+
rubyforge (2.0.4)
|
55
|
+
json_pure (>= 1.1.7)
|
56
|
+
term-ansicolor (1.0.5)
|
57
|
+
trollop (1.16.2)
|
58
|
+
|
59
|
+
PLATFORMS
|
60
|
+
ruby
|
61
|
+
|
62
|
+
DEPENDENCIES
|
63
|
+
ZenTest
|
64
|
+
activesupport (= 2.3.5)
|
65
|
+
aruba (= 0.2.1)
|
66
|
+
caleb-chronic (= 0.3.0)
|
67
|
+
crack (= 0.1.8)
|
68
|
+
cucumber (= 0.8.5)
|
69
|
+
fakeweb (= 1.2.8)
|
70
|
+
gherkin (= 2.1.5)
|
71
|
+
gli (= 1.1.1)
|
72
|
+
grit (= 2.0)
|
73
|
+
hanna (= 0.1.12)
|
74
|
+
hoe (= 2.6.2)
|
75
|
+
hoe-git (= 1.3.0)
|
76
|
+
httparty (= 0.6.1)
|
77
|
+
launchy (= 0.3.7)
|
78
|
+
rake (= 0.8.7)
|
79
|
+
rspec (= 1.3.0)
|
80
|
+
rubigen (= 1.5.5)
|
81
|
+
ruby-debug
|
data/History.txt
CHANGED
@@ -1,3 +1,30 @@
|
|
1
|
+
=== 0.3.0 / 2010-09-12
|
2
|
+
|
3
|
+
NEW FEATURES:
|
4
|
+
* Added Commit#builds, which returns all associated builds of a commit
|
5
|
+
* Implemented initial form of 'fumes build' command
|
6
|
+
* Allows you to manage the state of builds associated with a project
|
7
|
+
[thanks Roy Kolak]
|
8
|
+
Examples:
|
9
|
+
# starts a build named 'specs' with the latest commit on the
|
10
|
+
# CodeFumes project (sets state to 'running' & start time to 'now')
|
11
|
+
fumes build --start specs
|
12
|
+
|
13
|
+
# Set the resulting build status of 'specs' build (end time is set to 'now')
|
14
|
+
fumes build --finished=successful specs
|
15
|
+
fumes build --finished=failure specs
|
16
|
+
|
17
|
+
# Retrieve the status of a specific build associated with latest commit
|
18
|
+
fumes build --status specs
|
19
|
+
|
20
|
+
# Retrieve the status of all builds associated with latest commit
|
21
|
+
fumes build --status --all
|
22
|
+
|
23
|
+
BUG FIXES/UPDATES:
|
24
|
+
* Moved away from hard-coded exit codes in features
|
25
|
+
* Slight refactoring of build state validation
|
26
|
+
* Added rvmrc/cucumber:wip task [thanks Roy Kolak]
|
27
|
+
|
1
28
|
=== 0.2.2 / 2010-08-23
|
2
29
|
|
3
30
|
* Fixed integrity notifier namespacing issue
|
data/Manifest.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
.rvmrc
|
1
2
|
Gemfile
|
2
3
|
Gemfile.lock
|
3
4
|
History.txt
|
@@ -10,6 +11,7 @@ config/website.yml
|
|
10
11
|
cucumber.yml
|
11
12
|
features/claiming_a_project.feature
|
12
13
|
features/deleting_a_project.feature
|
14
|
+
features/managing_project_build_status.feature
|
13
15
|
features/releasing_a_project.feature
|
14
16
|
features/step_definitions/cli_steps.rb
|
15
17
|
features/step_definitions/common_steps.rb
|
@@ -47,9 +49,11 @@ spec/codefumes/harvester_spec.rb
|
|
47
49
|
spec/codefumes/source_control_spec.rb
|
48
50
|
spec/codefumes_service_helpers.rb
|
49
51
|
spec/fixtures/build.xml
|
52
|
+
spec/fixtures/builds.xml
|
50
53
|
spec/fixtures/commit.xml
|
51
54
|
spec/fixtures/commit_with_custom_attrs.xml
|
52
55
|
spec/fixtures/multiple_commits.xml
|
56
|
+
spec/fixtures/no_builds.xml
|
53
57
|
spec/fixtures/payload.xml
|
54
58
|
spec/fixtures/project.xml
|
55
59
|
spec/fixtures/project_update.xml
|
data/bin/fumes
CHANGED
@@ -155,10 +155,76 @@ command :open do |c|
|
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
158
|
+
desc "Set/read the build status of a project"
|
159
|
+
command :build do |c|
|
160
|
+
c.desc 'Start the specified build'
|
161
|
+
c.default_value false
|
162
|
+
c.switch [:start]
|
163
|
+
|
164
|
+
c.desc 'Mark the specified build with the supplied result'
|
165
|
+
c.arg_name "successful-or-failure"
|
166
|
+
c.default_value nil
|
167
|
+
c.flag [:finished]
|
168
|
+
|
169
|
+
c.desc 'Retrieve the build status of the specified build'
|
170
|
+
c.default_value false
|
171
|
+
c.switch [:status, :s]
|
172
|
+
|
173
|
+
c.desc 'Retrieve the the status of all builds associated with the latest commit'
|
174
|
+
c.default_value false
|
175
|
+
c.switch [:all, :a]
|
176
|
+
|
177
|
+
c.action do |global_options, options, args|
|
178
|
+
project_public_key = options[:public_key] || SourceControl.new('./').public_key
|
179
|
+
build_name = args.first
|
180
|
+
|
181
|
+
if build_name.nil? && options[:status] && !options[:all]
|
182
|
+
puts "You must specify a build name or the --all/-a switch."
|
183
|
+
raise Errors::InvalidCommandSyntax
|
184
|
+
end
|
185
|
+
|
186
|
+
if options[:status]
|
187
|
+
puts "Retrieving build status for '#{project_public_key}' project..."
|
188
|
+
project = Project.find(project_public_key)
|
189
|
+
commit = Commit.latest(project)
|
190
|
+
|
191
|
+
puts "Commit: #{commit.id[0..8]} (#{commit.short_message[0..49]})"
|
192
|
+
builds = options[:all] ? commit.builds : [Build.find(commit, build_name)].compact
|
193
|
+
|
194
|
+
if builds.empty?
|
195
|
+
puts "No builds found!"
|
196
|
+
puts "Exiting..."
|
197
|
+
else
|
198
|
+
builds.each do |build|
|
199
|
+
puts "\t'#{build.name}' build: #{build.state}"
|
200
|
+
end
|
201
|
+
end
|
202
|
+
elsif options[:start] || options[:finished]
|
203
|
+
new_status = options[:finished] ? options[:finished] : "started"
|
204
|
+
msg = "Setting '#{build_name}' build status to '#{new_status}'"
|
205
|
+
|
206
|
+
issue_project_commands(msg, [project_public_key]) do |project|
|
207
|
+
if options[:start] && QuickBuild.start(build_name)
|
208
|
+
puts "'#{build_name}' build successfully marked as '#{new_status}'"
|
209
|
+
elsif options[:finished] && QuickBuild.finish(build_name, options[:finished])
|
210
|
+
puts "'#{build_name}' build successfully marked as '#{new_status}'"
|
211
|
+
end
|
212
|
+
end
|
213
|
+
else
|
214
|
+
commands[:help].execute(global_options, options, ['build'])
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
158
219
|
pre do |global,command,options,args|
|
159
220
|
unless API.mode?(:production) || command_doesnt_use_api?(command)
|
160
221
|
print_api_mode_notification
|
161
222
|
end
|
223
|
+
|
224
|
+
if issuing_build_command?(command) && multiple_build_states?(options)
|
225
|
+
puts "Specifying multiple states in the same command is not allowed"
|
226
|
+
raise CodeFumes::Errors::InvalidCommandSyntax
|
227
|
+
end
|
162
228
|
true
|
163
229
|
end
|
164
230
|
|
@@ -168,11 +234,13 @@ end
|
|
168
234
|
on_error do |exception|
|
169
235
|
case exception
|
170
236
|
when CodeFumes::Errors::UnsupportedScmToolError
|
171
|
-
puts "Unsupported repository type.
|
237
|
+
puts "Unsupported repository type."
|
238
|
+
puts "Exiting..."
|
172
239
|
exit(ExitCodes::UNSUPPORTED_SCM)
|
173
240
|
when CodeFumes::Errors::UnknownProjectError
|
174
|
-
msg = "Could not find specified project on CodeFumes
|
175
|
-
msg << "Please verify the key and try again
|
241
|
+
msg = "Could not find specified project on CodeFumes.\n"
|
242
|
+
msg << "Please verify the key and try again.\n"
|
243
|
+
msg << "Exiting..."
|
176
244
|
puts msg
|
177
245
|
exit(ExitCodes::PROJECT_NOT_FOUND)
|
178
246
|
when CodeFumes::Errors::NoUserApiKeyError
|
@@ -180,7 +248,7 @@ on_error do |exception|
|
|
180
248
|
msg << "your CodeFumes config file.\n"
|
181
249
|
msg << "Log into your CodeFumes account, grab your API key, and run:\n"
|
182
250
|
msg << "\tfumes setup YOUR-API-KEY-HERE\n\n"
|
183
|
-
msg << "Exiting
|
251
|
+
msg << "Exiting..."
|
184
252
|
puts msg
|
185
253
|
exit(ExitCodes::NO_USER_CREDENTIALS)
|
186
254
|
when CodeFumes::Errors::InsufficientCredentials
|
@@ -188,18 +256,27 @@ on_error do |exception|
|
|
188
256
|
msg << "associated with the specified project. Please verify "
|
189
257
|
msg << "your API key is identical to what is listed on your "
|
190
258
|
msg << "CodeFumes.com account page"
|
191
|
-
msg << "Exiting
|
259
|
+
msg << "Exiting..."
|
192
260
|
puts msg
|
193
261
|
exit(ExitCodes::INCORRECT_USER_CREDENTIALS)
|
194
262
|
when Errors::NoApiKeySpecified
|
195
|
-
puts "No API key specified. To clear your api-key, use the '-c/--clear' flag
|
263
|
+
puts "No API key specified. To clear your api-key, use the '-c/--clear' flag."
|
264
|
+
puts "Exiting..."
|
196
265
|
exit(ExitCodes::NO_API_KEY_SPECIFIED)
|
197
266
|
when Errors::MissingLaunchyGem
|
198
267
|
puts ""
|
199
268
|
puts ""
|
200
269
|
puts "Sorry, you need to install launchy: `gem install launchy`"
|
201
|
-
puts "Exiting
|
270
|
+
puts "Exiting..."
|
202
271
|
exit(ExitCodes::MISSING_DEPENDENCY)
|
272
|
+
when Errors::InvalidBuildState
|
273
|
+
puts "Invalid build state specified."
|
274
|
+
puts "Valid --finished values are: #{API::Build::VALID_BUILD_RESULT_STATES.join(",")}"
|
275
|
+
puts "Exiting..."
|
276
|
+
exit(ExitCodes::INVALID_BUILD_STATE)
|
277
|
+
when Errors::InvalidCommandSyntax
|
278
|
+
puts "Exiting..."
|
279
|
+
exit(ExitCodes::INVALID_COMMAND_SYNTAX)
|
203
280
|
when RuntimeError
|
204
281
|
# allow default handler to take over when invalid arguments are passed in
|
205
282
|
else
|
@@ -9,7 +9,7 @@ Feature: Claiming a project
|
|
9
9
|
Given valid user credentials have been stored in the CodeFumes config file
|
10
10
|
When I run "#{@bin_path}/fumes claim -p bad-public-key"
|
11
11
|
Then the output should contain "Not Found"
|
12
|
-
And the exit status should be
|
12
|
+
And the exit status should be "SUCCESS"
|
13
13
|
|
14
14
|
Scenario: Attempting to claim a project without having an API key entry in the CodeFumes config file
|
15
15
|
Given I have cloned and synchronized 1 project
|
@@ -22,25 +22,25 @@ Feature: Claiming a project
|
|
22
22
|
And I have cloned and synchronized 1 project
|
23
23
|
When I claim the project
|
24
24
|
Then the output should contain "Denied"
|
25
|
-
And the exit status should be
|
25
|
+
And the exit status should be "SUCCESS"
|
26
26
|
|
27
27
|
Scenario: Claim a project using the key stored in a CodeFumes project directory
|
28
28
|
Given valid user credentials have been stored in the CodeFumes config file
|
29
29
|
And I have cloned and synchronized 1 project
|
30
30
|
When I claim the project
|
31
31
|
Then the output should contain "Success"
|
32
|
-
And the exit status should be
|
32
|
+
And the exit status should be "SUCCESS"
|
33
33
|
|
34
34
|
Scenario: Claiming one of multiple projects in your CodeFumes config file
|
35
35
|
Given valid user credentials have been stored in the CodeFumes config file
|
36
36
|
And I have cloned and synchronized 2 projects
|
37
37
|
When I claim the 1st project
|
38
38
|
Then the output should contain 1 successful claim message
|
39
|
-
And the exit status should be
|
39
|
+
And the exit status should be "SUCCESS"
|
40
40
|
|
41
41
|
Scenario: Claim all projects in your CodeFumes config file
|
42
42
|
Given valid user credentials have been stored in the CodeFumes config file
|
43
43
|
And I have cloned and synchronized 2 projects
|
44
44
|
And I run "#{@bin_path}/fumes claim -a"
|
45
45
|
Then the output should contain 2 successful claim messages
|
46
|
-
And the exit status should be
|
46
|
+
And the exit status should be "SUCCESS"
|