sleet 0.4.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +8 -18
- data/.gitignore +2 -0
- data/.rubocop.yml +3 -27
- data/CHANGELOG.md +104 -9
- data/README.md +1 -0
- data/docs/CNAME +1 -0
- data/docs/README.md +160 -0
- data/docs/_config.yml +1 -0
- data/lib/sleet.rb +1 -0
- data/lib/sleet/branch.rb +4 -3
- data/lib/sleet/build_selector.rb +2 -2
- data/lib/sleet/cli.rb +14 -0
- data/lib/sleet/config.rb +13 -1
- data/lib/sleet/fetch_command.rb +0 -1
- data/lib/sleet/job_fetcher.rb +0 -4
- data/lib/sleet/local_repo.rb +75 -0
- data/lib/sleet/repo.rb +17 -60
- data/lib/sleet/version.rb +1 -1
- data/sleet.gemspec +9 -12
- metadata +40 -53
- data/README.md +0 -142
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 468840169e965b440a007d755c413a5aea8c4b1513eb918ba6d449b0795b44fd
|
4
|
+
data.tar.gz: 8cf53f2fdfe7d1e204e172ed522fa27edc7b6fe075416b441785ba130cbadd18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 490094a454da75a7f8e06bff8c006351ce170b16bd7d87f144905705d16251cee46391c086c0daa8217ad772f06ee7b466ae12d553623c8da75715367828bde2
|
7
|
+
data.tar.gz: 2071a3299339a6008ca98bead1e4e2c1f7b77b45a78825fa3463d9eff5362f009c91ce85df34d0b7e4e4c6842068b91a092cc67a3179228dcd363a083a4e4675
|
data/.circleci/config.yml
CHANGED
@@ -1,30 +1,15 @@
|
|
1
1
|
version: 2
|
2
2
|
jobs:
|
3
|
-
|
4
|
-
parallelism:
|
3
|
+
test:
|
4
|
+
parallelism: 1
|
5
5
|
docker:
|
6
6
|
- image: circleci/ruby:latest
|
7
7
|
|
8
8
|
steps:
|
9
9
|
- checkout
|
10
10
|
|
11
|
-
- run: date +%U-%Y > 'date-cache-key.txt'
|
12
|
-
- run: ruby -v > 'ruby-version.txt'
|
13
|
-
|
14
|
-
## Bundler
|
15
|
-
# Restore Cache
|
16
|
-
- restore_cache:
|
17
|
-
keys:
|
18
|
-
- gem-cache-{{ checksum "ruby-version.txt" }}-{{ checksum "sleet.gemspec" }}-
|
19
|
-
- gem-cache-{{ checksum "ruby-version.txt" }}-
|
20
|
-
- gem-cache-
|
21
11
|
# Install
|
22
12
|
- run: bundle check --path vendor/bundle || sudo apt-get install cmake && bundle install --path vendor/bundle
|
23
|
-
# Store Cache
|
24
|
-
- save_cache:
|
25
|
-
key: gem-cache-{{ checksum "ruby-version.txt" }}-{{ checksum "sleet.gemspec" }}-{{ checksum "date-cache-key.txt" }}
|
26
|
-
paths:
|
27
|
-
- vendor/bundle
|
28
13
|
|
29
14
|
- type: shell
|
30
15
|
command: |
|
@@ -35,7 +20,7 @@ jobs:
|
|
35
20
|
--out /tmp/test-results/rubocop.xml \
|
36
21
|
--format progress \
|
37
22
|
--force-exclusion \
|
38
|
-
$(
|
23
|
+
$(circleci tests glob "**/*.rb" | circleci tests split --split-by=filesize --show-counts)
|
39
24
|
|
40
25
|
# Run rspec in parallel
|
41
26
|
- type: shell
|
@@ -53,3 +38,8 @@ jobs:
|
|
53
38
|
- store_artifacts:
|
54
39
|
path: spec/.rspec_example_statuses
|
55
40
|
|
41
|
+
workflows:
|
42
|
+
version: 2
|
43
|
+
test-workflow:
|
44
|
+
jobs:
|
45
|
+
- test
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,35 +1,11 @@
|
|
1
|
-
|
1
|
+
inherit_gem:
|
2
|
+
rubocop-coreyja:
|
3
|
+
- config/default.yml
|
2
4
|
|
3
5
|
inherit_from: .rubocop_todo.yml
|
4
6
|
|
5
7
|
AllCops:
|
6
8
|
TargetRubyVersion: 2.4
|
7
|
-
Exclude:
|
8
|
-
- 'vendor/**/*'
|
9
|
-
|
10
|
-
Metrics/LineLength:
|
11
|
-
Max: 120
|
12
|
-
|
13
|
-
Metrics/ClassLength:
|
14
|
-
Exclude:
|
15
|
-
- 'spec/**/*'
|
16
|
-
|
17
|
-
Metrics/BlockLength:
|
18
|
-
Exclude:
|
19
|
-
- 'spec/**/*'
|
20
|
-
- '*.gemspec'
|
21
|
-
|
22
|
-
Documentation:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
Style/StringLiterals:
|
26
|
-
Description: Checks if uses of quotes match the configured preference.
|
27
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
28
|
-
Enabled: true
|
29
|
-
EnforcedStyle: single_quotes
|
30
|
-
SupportedStyles:
|
31
|
-
- single_quotes
|
32
|
-
- double_quotes
|
33
9
|
|
34
10
|
RSpec/MultipleExpectations:
|
35
11
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,90 @@
|
|
1
|
-
#
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [v0.5.1](https://github.com/coreyja/sleet/tree/v0.5.1) (2020-06-14)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.5.0...v0.5.1)
|
6
|
+
|
7
|
+
**Merged pull requests:**
|
8
|
+
|
9
|
+
- bug: Fix bug in error message when no upstream exists [\#79](https://github.com/coreyja/sleet/pull/79) ([coreyja](https://github.com/coreyja))
|
10
|
+
|
11
|
+
## [v0.5.0](https://github.com/coreyja/sleet/tree/v0.5.0) (2020-06-14)
|
12
|
+
|
13
|
+
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.4.3...v0.5.0)
|
14
|
+
|
15
|
+
**Closed issues:**
|
16
|
+
|
17
|
+
- Add Support for Forked Repos in Github [\#41](https://github.com/coreyja/sleet/issues/41)
|
18
|
+
|
19
|
+
**Merged pull requests:**
|
20
|
+
|
21
|
+
- Support PR builds from forked repos!!! ✨ [\#77](https://github.com/coreyja/sleet/pull/77) ([smudge](https://github.com/smudge))
|
22
|
+
- Update rugged requirement from \>= 0.26, \< 0.100 to \>= 0.26, \< 1.1 [\#76](https://github.com/coreyja/sleet/pull/76) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
23
|
+
- Update rugged requirement from \>= 0.26, \< 0.29 to \>= 0.26, \< 0.100 [\#75](https://github.com/coreyja/sleet/pull/75) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
24
|
+
- Update thor requirement from ~\> 0.20.0 to \>= 0.20, \< 1.1 [\#70](https://github.com/coreyja/sleet/pull/70) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
25
|
+
|
26
|
+
## [v0.4.3](https://github.com/coreyja/sleet/tree/v0.4.3) (2020-03-07)
|
27
|
+
|
28
|
+
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.4.2...v0.4.3)
|
29
|
+
|
30
|
+
**Closed issues:**
|
31
|
+
|
32
|
+
- s/Artifcats/Artifacts/ [\#44](https://github.com/coreyja/sleet/issues/44)
|
33
|
+
|
34
|
+
**Merged pull requests:**
|
35
|
+
|
36
|
+
- fix: Replace "artifi🐱s" with "artifacts". [\#74](https://github.com/coreyja/sleet/pull/74) ([temochka](https://github.com/temochka))
|
37
|
+
- feat: Look at 100 recent builds instead of just 30. [\#73](https://github.com/coreyja/sleet/pull/73) ([temochka](https://github.com/temochka))
|
38
|
+
- Update webmock requirement from ~\> 3.7.0 to ~\> 3.8.0 [\#72](https://github.com/coreyja/sleet/pull/72) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
39
|
+
- Update faraday requirement from \>= 0.13.1, \< 0.16.0 to \>= 0.13.1, \< 1.1.0 [\#71](https://github.com/coreyja/sleet/pull/71) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
40
|
+
- Update gem-release requirement from = 2.1.0 to = 2.1.1 [\#69](https://github.com/coreyja/sleet/pull/69) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
41
|
+
- Update gem-release requirement from = 2.0.4 to = 2.1.0 [\#68](https://github.com/coreyja/sleet/pull/68) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
42
|
+
- Update gem-release requirement from = 2.0.3 to = 2.0.4 [\#67](https://github.com/coreyja/sleet/pull/67) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
43
|
+
- Update rake requirement from ~\> 12.3 to ~\> 13.0 [\#64](https://github.com/coreyja/sleet/pull/64) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
44
|
+
- Update webmock requirement from ~\> 3.6.0 to ~\> 3.7.0 [\#63](https://github.com/coreyja/sleet/pull/63) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
45
|
+
- Update gem-release requirement from = 2.0.2 to = 2.0.3 [\#62](https://github.com/coreyja/sleet/pull/62) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
46
|
+
- Update gem-release requirement from = 2.0.1 to = 2.0.2 [\#61](https://github.com/coreyja/sleet/pull/61) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
47
|
+
- Update webmock requirement from ~\> 3.5.1 to ~\> 3.6.0 [\#60](https://github.com/coreyja/sleet/pull/60) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
48
|
+
|
49
|
+
## [v0.4.2](https://github.com/coreyja/sleet/tree/v0.4.2) (2019-05-27)
|
50
|
+
|
51
|
+
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.4.1...v0.4.2)
|
52
|
+
|
53
|
+
**Closed issues:**
|
54
|
+
|
55
|
+
- Dependabot can't resolve your Ruby dependency files [\#51](https://github.com/coreyja/sleet/issues/51)
|
56
|
+
- Dependabot can't resolve your Ruby dependency files [\#50](https://github.com/coreyja/sleet/issues/50)
|
57
|
+
- Dependabot can't resolve your Ruby dependency files [\#48](https://github.com/coreyja/sleet/issues/48)
|
58
|
+
- Dependabot can't resolve your Ruby dependency files [\#49](https://github.com/coreyja/sleet/issues/49)
|
59
|
+
|
60
|
+
**Merged pull requests:**
|
61
|
+
|
62
|
+
- Fix CircleCI Builds [\#59](https://github.com/coreyja/sleet/pull/59) ([coreyja](https://github.com/coreyja))
|
63
|
+
- Add a Gitter chat badge to README.md [\#58](https://github.com/coreyja/sleet/pull/58) ([gitter-badger](https://github.com/gitter-badger))
|
64
|
+
- Symlink to docs README.md from top level [\#57](https://github.com/coreyja/sleet/pull/57) ([coreyja](https://github.com/coreyja))
|
65
|
+
- Docs site fixes [\#56](https://github.com/coreyja/sleet/pull/56) ([coreyja](https://github.com/coreyja))
|
66
|
+
- Setup Github Pages [\#54](https://github.com/coreyja/sleet/pull/54) ([coreyja](https://github.com/coreyja))
|
67
|
+
- Update rugged requirement from \>= 0.26, \< 0.28 to \>= 0.26, \< 0.29 [\#53](https://github.com/coreyja/sleet/pull/53) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
68
|
+
- Remove direct dependency on Bundler [\#52](https://github.com/coreyja/sleet/pull/52) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
69
|
+
- Update webmock requirement from ~\> 3.4.0 to ~\> 3.5.1 [\#47](https://github.com/coreyja/sleet/pull/47) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
70
|
+
|
71
|
+
## [v0.4.1](https://github.com/coreyja/sleet/tree/v0.4.1) (2018-11-24)
|
72
|
+
|
73
|
+
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.4.0...v0.4.1)
|
74
|
+
|
75
|
+
**Merged pull requests:**
|
76
|
+
|
77
|
+
- chore: Set up Rubocop-Coreyja gem [\#45](https://github.com/coreyja/sleet/pull/45) ([coreyja](https://github.com/coreyja))
|
78
|
+
- Update README.md [\#40](https://github.com/coreyja/sleet/pull/40) ([coreyja](https://github.com/coreyja))
|
79
|
+
- Update gem-release requirement to = 2.0.1 [\#33](https://github.com/coreyja/sleet/pull/33) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
80
|
+
- Update webmock requirement to ~\> 3.4.0 [\#28](https://github.com/coreyja/sleet/pull/28) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
81
|
+
- Update faraday requirement to \>= 0.13.1, \< 0.16.0 [\#27](https://github.com/coreyja/sleet/pull/27) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
82
|
+
- Update rubocop requirement to ~\> 0.55.0 [\#26](https://github.com/coreyja/sleet/pull/26) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
83
|
+
- Update gem-release requirement to = 2.0.0.rc.3 [\#25](https://github.com/coreyja/sleet/pull/25) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
84
|
+
- Update rugged requirement to \>= 0.26, \< 0.28 [\#24](https://github.com/coreyja/sleet/pull/24) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
2
85
|
|
3
86
|
## [v0.4.0](https://github.com/coreyja/sleet/tree/v0.4.0) (2018-03-08)
|
87
|
+
|
4
88
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.10...v0.4.0)
|
5
89
|
|
6
90
|
**Closed issues:**
|
@@ -12,14 +96,16 @@
|
|
12
96
|
- Get Token From Config File [\#21](https://github.com/coreyja/sleet/pull/21) ([coreyja](https://github.com/coreyja))
|
13
97
|
|
14
98
|
## [v0.3.10](https://github.com/coreyja/sleet/tree/v0.3.10) (2018-03-08)
|
99
|
+
|
15
100
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.9...v0.3.10)
|
16
101
|
|
17
102
|
**Merged pull requests:**
|
18
103
|
|
19
104
|
- Base Version Option [\#20](https://github.com/coreyja/sleet/pull/20) ([coreyja](https://github.com/coreyja))
|
20
|
-
- Update rubocop requirement to ~\> 0.53.0 [\#19](https://github.com/coreyja/sleet/pull/19) ([dependabot[bot]](https://github.com/apps/dependabot))
|
105
|
+
- Update rubocop requirement to ~\> 0.53.0 [\#19](https://github.com/coreyja/sleet/pull/19) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
21
106
|
|
22
107
|
## [v0.3.9](https://github.com/coreyja/sleet/tree/v0.3.9) (2018-03-04)
|
108
|
+
|
23
109
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.8...v0.3.9)
|
24
110
|
|
25
111
|
**Closed issues:**
|
@@ -29,17 +115,16 @@
|
|
29
115
|
**Merged pull requests:**
|
30
116
|
|
31
117
|
- Refactor [\#18](https://github.com/coreyja/sleet/pull/18) ([coreyja](https://github.com/coreyja))
|
32
|
-
- Update rake requirement to ~\> 12.3 [\#17](https://github.com/coreyja/sleet/pull/17) ([dependabot[bot]](https://github.com/apps/dependabot))
|
33
|
-
- Update faraday requirement to \>= 0.13.1, \< 0.15.0 [\#16](https://github.com/coreyja/sleet/pull/16) ([dependabot[bot]](https://github.com/apps/dependabot))
|
118
|
+
- Update rake requirement to ~\> 12.3 [\#17](https://github.com/coreyja/sleet/pull/17) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
119
|
+
- Update faraday requirement to \>= 0.13.1, \< 0.15.0 [\#16](https://github.com/coreyja/sleet/pull/16) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
120
|
+
- More Specs [\#15](https://github.com/coreyja/sleet/pull/15) ([coreyja](https://github.com/coreyja))
|
34
121
|
|
35
122
|
## [v0.3.8](https://github.com/coreyja/sleet/tree/v0.3.8) (2018-02-25)
|
36
|
-
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.7...v0.3.8)
|
37
|
-
|
38
|
-
**Merged pull requests:**
|
39
123
|
|
40
|
-
|
124
|
+
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.7...v0.3.8)
|
41
125
|
|
42
126
|
## [v0.3.7](https://github.com/coreyja/sleet/tree/v0.3.7) (2018-01-19)
|
127
|
+
|
43
128
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.6...v0.3.7)
|
44
129
|
|
45
130
|
**Merged pull requests:**
|
@@ -47,6 +132,7 @@
|
|
47
132
|
- Fix token auth and finally add a spec for it so I don't break it again [\#14](https://github.com/coreyja/sleet/pull/14) ([coreyja](https://github.com/coreyja))
|
48
133
|
|
49
134
|
## [v0.3.6](https://github.com/coreyja/sleet/tree/v0.3.6) (2018-01-18)
|
135
|
+
|
50
136
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.5...v0.3.6)
|
51
137
|
|
52
138
|
**Merged pull requests:**
|
@@ -54,9 +140,11 @@
|
|
54
140
|
- Fix Auth By Going Back to Query Params [\#13](https://github.com/coreyja/sleet/pull/13) ([coreyja](https://github.com/coreyja))
|
55
141
|
|
56
142
|
## [v0.3.5](https://github.com/coreyja/sleet/tree/v0.3.5) (2018-01-17)
|
143
|
+
|
57
144
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.4...v0.3.5)
|
58
145
|
|
59
146
|
## [v0.3.4](https://github.com/coreyja/sleet/tree/v0.3.4) (2018-01-17)
|
147
|
+
|
60
148
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.3...v0.3.4)
|
61
149
|
|
62
150
|
**Merged pull requests:**
|
@@ -65,6 +153,7 @@
|
|
65
153
|
- Fix Auth [\#11](https://github.com/coreyja/sleet/pull/11) ([coreyja](https://github.com/coreyja))
|
66
154
|
|
67
155
|
## [v0.3.3](https://github.com/coreyja/sleet/tree/v0.3.3) (2018-01-16)
|
156
|
+
|
68
157
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.2...v0.3.3)
|
69
158
|
|
70
159
|
**Merged pull requests:**
|
@@ -72,6 +161,7 @@
|
|
72
161
|
- Add `version` cmd [\#10](https://github.com/coreyja/sleet/pull/10) ([coreyja](https://github.com/coreyja))
|
73
162
|
|
74
163
|
## [v0.3.2](https://github.com/coreyja/sleet/tree/v0.3.2) (2018-01-16)
|
164
|
+
|
75
165
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.1...v0.3.2)
|
76
166
|
|
77
167
|
**Merged pull requests:**
|
@@ -79,6 +169,7 @@
|
|
79
169
|
- Update Readme and Add Descriptions to Help Menus [\#8](https://github.com/coreyja/sleet/pull/8) ([coreyja](https://github.com/coreyja))
|
80
170
|
|
81
171
|
## [v0.3.1](https://github.com/coreyja/sleet/tree/v0.3.1) (2018-01-15)
|
172
|
+
|
82
173
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.0...v0.3.1)
|
83
174
|
|
84
175
|
**Merged pull requests:**
|
@@ -86,6 +177,7 @@
|
|
86
177
|
- Add Dependency Versions [\#5](https://github.com/coreyja/sleet/pull/5) ([coreyja](https://github.com/coreyja))
|
87
178
|
|
88
179
|
## [v0.3.0](https://github.com/coreyja/sleet/tree/v0.3.0) (2018-01-15)
|
180
|
+
|
89
181
|
[Full Changelog](https://github.com/coreyja/sleet/compare/v0.2.0...v0.3.0)
|
90
182
|
|
91
183
|
**Closed issues:**
|
@@ -98,10 +190,13 @@
|
|
98
190
|
- Error Messages [\#3](https://github.com/coreyja/sleet/pull/3) ([coreyja](https://github.com/coreyja))
|
99
191
|
|
100
192
|
## [v0.2.0](https://github.com/coreyja/sleet/tree/v0.2.0) (2018-01-14)
|
193
|
+
|
194
|
+
[Full Changelog](https://github.com/coreyja/sleet/compare/aa005fdae00ae843909f3a2d1753db3727a27c2c...v0.2.0)
|
195
|
+
|
101
196
|
**Merged pull requests:**
|
102
197
|
|
103
198
|
- Gemify [\#2](https://github.com/coreyja/sleet/pull/2) ([coreyja](https://github.com/coreyja))
|
104
199
|
|
105
200
|
|
106
201
|
|
107
|
-
\* *This
|
202
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
./docs/README.md
|
data/docs/CNAME
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
sleet.dev
|
data/docs/README.md
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
# Sleet ☁️ ❄️
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/sleet.svg)](https://badge.fury.io/rb/sleet)
|
4
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/7f346b368d72b53ef630/maintainability)](https://codeclimate.com/github/coreyja/sleet/maintainability)
|
5
|
+
[![CircleCI](https://circleci.com/gh/coreyja/sleet.svg?style=svg)](https://circleci.com/gh/coreyja/sleet)
|
6
|
+
[![Join the chat at https://gitter.im/rspec-sleet/community](https://badges.gitter.im/rspec-sleet/community.svg)](https://gitter.im/rspec-sleet/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
7
|
+
|
8
|
+
## Background and Problem
|
9
|
+
|
10
|
+
RSpec has a [feature](https://relishapp.com/rspec/rspec-core/v/3-7/docs/command-line/only-failures) that I find very useful which is the `--only-failures` option. This will re-run only that examples that failed the previous run.
|
11
|
+
|
12
|
+
CircleCI has support for [uploading artifacts](https://circleci.com/docs/2.0/artifacts/) with your builds, which allows us to store the persistance file that powers the RSpec only failures option.
|
13
|
+
However! CircleCI also supports and encourages parallelizing your build, which means even if you upload your rspec persistance file, you actually have a number of them each containing a subset of your test suite.
|
14
|
+
This is where `Sleet` comes in!
|
15
|
+
|
16
|
+
## Purpose
|
17
|
+
|
18
|
+
This tool does two things:
|
19
|
+
1. It downloads all of the `.rspec_failed_examples` files that were uploaded to CircleCI for the most recent build of the current branch
|
20
|
+
2. It combines the multiple files into a single sorted `.rspec_failed_examples` file, and moves it to the [current directory](https://github.com/coreyja/CRSPFA/issues/1)
|
21
|
+
|
22
|
+
## Getting Started
|
23
|
+
|
24
|
+
### 1. Configure RSpec to Create and Use an example persistance file
|
25
|
+
|
26
|
+
We need to set the `example_status_persistence_file_path` config in RSpec. Here are the relevant [RSpec docs](https://relishapp.com/rspec/rspec-core/v/3-7/docs/command-line/only-failures#background).
|
27
|
+
|
28
|
+
The first step is to create(/or add to) your `spec/spec_helper.rb` file. We want to include the following configuration, which tells RSpec where to store the status persistance file. The actual location and file name are up to you, this is just an example. (Though using this name will require less configuration later.)
|
29
|
+
|
30
|
+
```
|
31
|
+
RSpec.configure do |c|
|
32
|
+
c.example_status_persistence_file_path = ".rspec_example_statuses"
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
if you just created the `spec_helper.rb` file then you will need to create a `.rspec` file containing the following to load your new helper file.
|
37
|
+
|
38
|
+
```
|
39
|
+
--require spec_helper
|
40
|
+
```
|
41
|
+
|
42
|
+
Again there are other ways to load your `spec_helper.rb` file, including requiring it from each spec. Pick one that works for you.
|
43
|
+
|
44
|
+
### 2. Collect the example persistance files in CircleCI
|
45
|
+
|
46
|
+
To do this we need to create a step which [saves](https://circleci.com/docs/2.0/artifacts/) the `.rspec_example_statuses` as artifacts of the build. The following is an example of such a step in CircleCI. This must happen after rspec has run or else the persistance file will not exist.
|
47
|
+
|
48
|
+
```
|
49
|
+
- store_artifacts:
|
50
|
+
path: .rspec_example_statuses
|
51
|
+
|
52
|
+
```
|
53
|
+
|
54
|
+
### 3. Save a CircleCI Token locally (to access private builds)
|
55
|
+
|
56
|
+
In order to see private builds/repos in CircleCI you will need to get a CircleCI token and save it locally to a Sleet Configuration file.
|
57
|
+
The recommended approach is to create a yml file in your home directory which contains your the key `circle_ci_token`
|
58
|
+
|
59
|
+
```
|
60
|
+
circle_ci_token: PLACE_TOKEN_HERE
|
61
|
+
```
|
62
|
+
|
63
|
+
An API token can be generated here: [https://circleci.com/account/api](https://circleci.com/account/api)
|
64
|
+
|
65
|
+
### 4. Run this tool from your project
|
66
|
+
|
67
|
+
```
|
68
|
+
sleet
|
69
|
+
```
|
70
|
+
|
71
|
+
This will look up the latest completed build in CircleCI for this branch, and download all the relevant `.rspec_example_statuses` files. It then combines and sorts them and saves the result to the `.rspec_example_statuses` file locally.
|
72
|
+
|
73
|
+
### 5. Run RSpec with `--only-failures`
|
74
|
+
|
75
|
+
```
|
76
|
+
bundle exec rspec --only-failures
|
77
|
+
```
|
78
|
+
|
79
|
+
This will run only the examples that failed in CircleCI!
|
80
|
+
|
81
|
+
## Configuration
|
82
|
+
|
83
|
+
If you are using Worklfows in your CircleCI builds, or you are working with a different persistance file name, you may need to configure Sleet beyond the defaults.
|
84
|
+
|
85
|
+
Sleet currently supports two ways to input configurations:
|
86
|
+
|
87
|
+
1. Through YML files
|
88
|
+
- `Sleet` will search 'up' from where the command was run and look for `.sleet.yml` files. It will combine all the files it finds, such that 'deeper' files take presedence. This allows you to have a user-level config at `~/.sleet.yml` and have project specific files which take presendence over the user level config (ex: `~/Projects/foo/.sleet.yml`)
|
89
|
+
2. Through the CLI
|
90
|
+
- These always take presendece the options provided in the YML files
|
91
|
+
|
92
|
+
To view your current configuration use the `sleet config` command which will give you a table of the current configuration. You can also use the `--print-config` flag with the `fetch` command to print out the config, including any other CLI options. This can be useful for bebugging as the output also tells you where each option came from.
|
93
|
+
|
94
|
+
### Options
|
95
|
+
|
96
|
+
These are the options that are currently supported
|
97
|
+
|
98
|
+
#### `--source_dir`
|
99
|
+
|
100
|
+
Alias: `s`
|
101
|
+
|
102
|
+
This is the directory of the source git repo. If a `source_dir` is NOT given we look up from the current directory for the nearest git repo.
|
103
|
+
|
104
|
+
#### `--input_file`
|
105
|
+
|
106
|
+
Alias: `i`
|
107
|
+
|
108
|
+
This is the name of the Rspec Circle Persistance File in CircleCI. The default is `.rspec_example_statuses`
|
109
|
+
|
110
|
+
This will match if the full path on CircleCI ends in the given name.
|
111
|
+
|
112
|
+
#### `--output_file`
|
113
|
+
|
114
|
+
Alias: `o`
|
115
|
+
|
116
|
+
This is the name for the output file, on your local system. It is relative to the `source_dir`.
|
117
|
+
|
118
|
+
Will be IGNORED if `workflows` is provided.
|
119
|
+
|
120
|
+
#### `--workflows`
|
121
|
+
|
122
|
+
Alias: `w`
|
123
|
+
|
124
|
+
If you are using workflows in CircleCI, then this is for you! You need to tell `Sleet` which build(s) to look in, and where each output should be saved.
|
125
|
+
The input is a hash, where the key is the build name and the value is the `output_file` for that build. Sleet supports saving the artifacts to multiple builds, meaning it can support a mono-repo setup.
|
126
|
+
|
127
|
+
Build-Test-Deploy Demo:
|
128
|
+
|
129
|
+
For this example you have three jobs in your CircleCI Workflow, `build`, `test` and `deploy`, but only 1 (the `test` build) generate an Rspec persistance file
|
130
|
+
|
131
|
+
This command will pick the `test` build and save its artifacts to the `.rspec_example_statuses` file
|
132
|
+
|
133
|
+
```
|
134
|
+
sleet fetch --workflows test:.rspec_example_statuses
|
135
|
+
```
|
136
|
+
MonoRepo Demo:
|
137
|
+
|
138
|
+
If you have a mono-repo that contains 3 sub-dirs. `foo`, `bar` and `baz`. And each one has an accompanying build. We can process all these sub-dirs at once with the following workflow command.
|
139
|
+
|
140
|
+
```
|
141
|
+
sleet fetch --workflows foo-test:foo/.rpsec_example_statuses bar-test:bar/.rspec_example_statuses baz-specs:baz/spec/examples.txt
|
142
|
+
```
|
143
|
+
|
144
|
+
#### `--username`
|
145
|
+
|
146
|
+
Alias: `u`
|
147
|
+
|
148
|
+
This is the GitHub username that is referenced by the CircleCI build. By default, Sleet will base this on your upstream git remote.
|
149
|
+
|
150
|
+
#### `--project`
|
151
|
+
|
152
|
+
Alias: `p`
|
153
|
+
|
154
|
+
This is the GitHub project that is referenced by the CircleCI build. By default, Sleet will base this on your upstream git remote.
|
155
|
+
|
156
|
+
#### `--branch`
|
157
|
+
|
158
|
+
Alias: `b`
|
159
|
+
|
160
|
+
This is the remote branch that is referenced by the CircleCI build. Sleet will attempt to guess this by default, but if you are pushing to a forked repo, you may need to specify a different branch name (e.g. "pull/1234").
|
data/docs/_config.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
theme: jekyll-theme-slate
|
data/lib/sleet.rb
CHANGED
data/lib/sleet/branch.rb
CHANGED
@@ -6,14 +6,14 @@ module Sleet
|
|
6
6
|
@circle_ci_token = circle_ci_token
|
7
7
|
@github_user = github_user
|
8
8
|
@github_repo = github_repo
|
9
|
-
@branch = branch
|
9
|
+
@branch = CGI.escape(branch)
|
10
10
|
end
|
11
11
|
|
12
12
|
def builds
|
13
13
|
@builds ||= JSON.parse(Sleet::CircleCi.get(url, circle_ci_token).body)
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
16
|
+
def builds_with_artifacts
|
17
17
|
builds.select { |b| b['has_artifacts'] }
|
18
18
|
end
|
19
19
|
|
@@ -22,7 +22,8 @@ module Sleet
|
|
22
22
|
attr_reader :github_user, :github_repo, :branch, :circle_ci_token
|
23
23
|
|
24
24
|
def url
|
25
|
-
"https://circleci.com/api/v1.1/project/github/#{github_user}/#{github_repo}/tree/#{branch}
|
25
|
+
"https://circleci.com/api/v1.1/project/github/#{github_user}/#{github_repo}/tree/#{branch}" \
|
26
|
+
'?filter=completed&limit=100'
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
data/lib/sleet/build_selector.rb
CHANGED
@@ -29,14 +29,14 @@ module Sleet
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def chosen_build_json
|
32
|
-
branch.
|
32
|
+
branch.builds_with_artifacts.find do |b|
|
33
33
|
b.fetch('workflows', nil)&.fetch('job_name', nil) == job_name
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
def must_find_a_build_with_artifacts!
|
38
38
|
!chosen_build_json.nil? ||
|
39
|
-
raise(Error, "No builds with
|
39
|
+
raise(Error, "No builds with artifacts found#{" for job name [#{job_name}]" if job_name}")
|
40
40
|
end
|
41
41
|
|
42
42
|
def chosen_build_must_have_input_file!
|
data/lib/sleet/cli.rb
CHANGED
@@ -4,6 +4,10 @@ module Sleet
|
|
4
4
|
class Cli < Thor
|
5
5
|
default_task :fetch
|
6
6
|
|
7
|
+
def self.exit_on_failure?
|
8
|
+
true
|
9
|
+
end
|
10
|
+
|
7
11
|
desc 'fetch', 'Fetch and Aggregate RSpec Persistance Files from CircleCI'
|
8
12
|
long_desc <<~LONGDESC
|
9
13
|
`sleet fetch` will find build(s) in CircleCI for the current branch, and
|
@@ -20,6 +24,15 @@ module Sleet
|
|
20
24
|
option :output_file, type: :string, aliases: [:o], desc: <<~DESC
|
21
25
|
This is the name for the output file, on your local system. It is relative to the source_dir. Will be IGNORED if workflows is provided.
|
22
26
|
DESC
|
27
|
+
option :username, type: :string, aliases: [:u], desc: <<~DESC
|
28
|
+
This is the GitHub username that is referenced by the CircleCI build. By default, Sleet will base this on your upstream git remote.
|
29
|
+
DESC
|
30
|
+
option :project, type: :string, aliases: [:p], desc: <<~DESC
|
31
|
+
This is the GitHub project that is referenced by the CircleCI build. By default, Sleet will base this on your upstream git remote.
|
32
|
+
DESC
|
33
|
+
option :branch, type: :string, aliases: [:b], desc: <<~DESC
|
34
|
+
This is the remote branch that is referenced by the CircleCI build. Sleet will attempt to guess this by default, but if you are pushing to a forked repo, you may need to specify a different branch name (e.g. "pull/1234").
|
35
|
+
DESC
|
23
36
|
option :workflows, type: :hash, aliases: [:w], desc: <<~DESC
|
24
37
|
To use Sleet with CircleCI Workflows you need to tell Sleet which build(s) to look in, and where each output should be saved. The input is a hash, where the key is the build name and the value is the output_file for that build. Sleet supports saving the artifacts to multiple builds, meaning it can support a mono-repo setup.
|
25
38
|
DESC
|
@@ -31,6 +44,7 @@ module Sleet
|
|
31
44
|
exit
|
32
45
|
end
|
33
46
|
raise Sleet::Error, 'circle_ci_token required and not provided' unless sleet_config.circle_ci_token
|
47
|
+
|
34
48
|
Sleet::FetchCommand.new(sleet_config).do!
|
35
49
|
end
|
36
50
|
|
data/lib/sleet/config.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Sleet
|
4
|
-
class Config
|
4
|
+
class Config # rubocop:disable Metrics/ClassLength
|
5
5
|
OPTION_FILENAME = '.sleet.yml'
|
6
6
|
HIDDEN_UNLESS_IN_CLI_OPTIONS = %w[show_sensitive print_config].freeze
|
7
7
|
ConfigOption = Struct.new(:value, :source)
|
@@ -23,6 +23,18 @@ module Sleet
|
|
23
23
|
options_hash[:output_file]
|
24
24
|
end
|
25
25
|
|
26
|
+
def username
|
27
|
+
options_hash[:username]
|
28
|
+
end
|
29
|
+
|
30
|
+
def project
|
31
|
+
options_hash[:project]
|
32
|
+
end
|
33
|
+
|
34
|
+
def branch
|
35
|
+
options_hash[:branch]
|
36
|
+
end
|
37
|
+
|
26
38
|
def workflows
|
27
39
|
options_hash[:workflows]
|
28
40
|
end
|
data/lib/sleet/fetch_command.rb
CHANGED
data/lib/sleet/job_fetcher.rb
CHANGED
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sleet
|
4
|
+
class LocalRepo
|
5
|
+
REMOTE_BRANCH_REGEX = %r{^([^\/.]+)\/(.+)}.freeze
|
6
|
+
CURRENT_BRANCH_REGEX = %r{^refs\/heads\/}.freeze
|
7
|
+
GITHUB_MATCH_REGEX = %r{github.com[:\/](.+)\/(.+)\.git}.freeze
|
8
|
+
|
9
|
+
def initialize(source_dir:)
|
10
|
+
@source_dir = source_dir
|
11
|
+
end
|
12
|
+
|
13
|
+
def username
|
14
|
+
validate!
|
15
|
+
|
16
|
+
github_match[1]
|
17
|
+
end
|
18
|
+
|
19
|
+
def project
|
20
|
+
validate!
|
21
|
+
|
22
|
+
github_match[2]
|
23
|
+
end
|
24
|
+
|
25
|
+
def branch_name
|
26
|
+
validate!
|
27
|
+
|
28
|
+
current_branch.upstream.name.match(REMOTE_BRANCH_REGEX)[2]
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
attr_reader :source_dir
|
34
|
+
|
35
|
+
def current_branch_name
|
36
|
+
@current_branch_name ||= repo.head.name.sub(CURRENT_BRANCH_REGEX, '')
|
37
|
+
end
|
38
|
+
|
39
|
+
def current_branch
|
40
|
+
@current_branch ||= repo.branches[current_branch_name]
|
41
|
+
end
|
42
|
+
|
43
|
+
def github_match
|
44
|
+
@github_match ||= GITHUB_MATCH_REGEX.match(current_branch.remote.url)
|
45
|
+
end
|
46
|
+
|
47
|
+
def repo
|
48
|
+
@repo ||= Rugged::Repository.new(source_dir)
|
49
|
+
end
|
50
|
+
|
51
|
+
def validate!
|
52
|
+
return if @validated
|
53
|
+
|
54
|
+
must_be_on_branch!
|
55
|
+
must_have_an_upstream_branch!
|
56
|
+
upstream_remote_must_be_github!
|
57
|
+
@validated = true
|
58
|
+
end
|
59
|
+
|
60
|
+
def must_be_on_branch!
|
61
|
+
!current_branch.nil? ||
|
62
|
+
raise(Error, 'Not on a branch')
|
63
|
+
end
|
64
|
+
|
65
|
+
def must_have_an_upstream_branch!
|
66
|
+
!current_branch.remote.nil? ||
|
67
|
+
raise(Error, "No upstream branch set for the current branch of #{repo.current_branch_name}")
|
68
|
+
end
|
69
|
+
|
70
|
+
def upstream_remote_must_be_github!
|
71
|
+
!github_match.nil? ||
|
72
|
+
raise(Error, 'Upstream remote is not GitHub')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
data/lib/sleet/repo.rb
CHANGED
@@ -2,87 +2,44 @@
|
|
2
2
|
|
3
3
|
module Sleet
|
4
4
|
class Repo
|
5
|
-
REMOTE_BRANCH_REGEX = %r{^([^\/.]+)\/(.+)}
|
6
|
-
CURRENT_BRANCH_REGEX = %r{^refs\/heads\/}
|
7
|
-
GITHUB_MATCH_REGEX = %r{github.com[:\/](.+)\/(.+)\.git}
|
8
|
-
|
9
5
|
def self.from_config(config)
|
6
|
+
local_repo = Sleet::LocalRepo.new(source_dir: config.source_dir)
|
7
|
+
|
10
8
|
new(
|
11
|
-
|
12
|
-
|
9
|
+
circle_ci_token: config.circle_ci_token,
|
10
|
+
username: config.username || local_repo.username,
|
11
|
+
project: config.project || local_repo.project,
|
12
|
+
branch_name: config.branch || local_repo.branch_name
|
13
13
|
)
|
14
14
|
end
|
15
15
|
|
16
|
-
def initialize(
|
17
|
-
@repo = repo
|
16
|
+
def initialize(circle_ci_token:, username:, project:, branch_name:)
|
18
17
|
@circle_ci_token = circle_ci_token
|
18
|
+
@github_user = username
|
19
|
+
@github_repo = project
|
20
|
+
@branch_name = branch_name
|
19
21
|
end
|
20
22
|
|
21
|
-
def
|
22
|
-
|
23
|
-
must_have_an_upstream_branch!
|
24
|
-
upstream_remote_must_be_github!
|
25
|
-
end
|
26
|
-
|
27
|
-
def branch
|
28
|
-
@branch ||= Sleet::Branch.new(
|
23
|
+
def build_for(build_num)
|
24
|
+
Sleet::Build.new(
|
29
25
|
circle_ci_token: circle_ci_token,
|
30
26
|
github_user: github_user,
|
31
27
|
github_repo: github_repo,
|
32
|
-
|
28
|
+
build_num: build_num
|
33
29
|
)
|
34
30
|
end
|
35
31
|
|
36
|
-
def
|
37
|
-
Sleet::
|
32
|
+
def branch
|
33
|
+
@branch ||= Sleet::Branch.new(
|
38
34
|
circle_ci_token: circle_ci_token,
|
39
35
|
github_user: github_user,
|
40
36
|
github_repo: github_repo,
|
41
|
-
|
37
|
+
branch: branch_name
|
42
38
|
)
|
43
39
|
end
|
44
40
|
|
45
41
|
private
|
46
42
|
|
47
|
-
attr_reader :
|
48
|
-
|
49
|
-
def remote_branch
|
50
|
-
current_branch.upstream.name.match(REMOTE_BRANCH_REGEX)[2]
|
51
|
-
end
|
52
|
-
|
53
|
-
def github_user
|
54
|
-
github_match[1]
|
55
|
-
end
|
56
|
-
|
57
|
-
def github_repo
|
58
|
-
github_match[2]
|
59
|
-
end
|
60
|
-
|
61
|
-
def current_branch_name
|
62
|
-
repo.head.name.sub(CURRENT_BRANCH_REGEX, '')
|
63
|
-
end
|
64
|
-
|
65
|
-
def current_branch
|
66
|
-
repo.branches[current_branch_name]
|
67
|
-
end
|
68
|
-
|
69
|
-
def github_match
|
70
|
-
@github_match ||= GITHUB_MATCH_REGEX.match(current_branch.remote.url)
|
71
|
-
end
|
72
|
-
|
73
|
-
def must_be_on_branch!
|
74
|
-
!current_branch.nil? ||
|
75
|
-
raise(Error, 'Not on a branch')
|
76
|
-
end
|
77
|
-
|
78
|
-
def must_have_an_upstream_branch!
|
79
|
-
!current_branch.remote.nil? ||
|
80
|
-
raise(Error, "No upstream branch set for the current branch of #{repo.current_branch_name}")
|
81
|
-
end
|
82
|
-
|
83
|
-
def upstream_remote_must_be_github!
|
84
|
-
!github_match.nil? ||
|
85
|
-
raise(Error, 'Upstream remote is not GitHub')
|
86
|
-
end
|
43
|
+
attr_reader :circle_ci_token, :github_user, :github_repo, :branch_name
|
87
44
|
end
|
88
45
|
end
|
data/lib/sleet/version.rb
CHANGED
data/sleet.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
lib = File.expand_path('lib', __dir__)
|
@@ -14,8 +13,8 @@ Gem::Specification.new do |spec|
|
|
14
13
|
spec.summary = 'CircleCI RSpec Status Persistance File Aggregator'
|
15
14
|
spec.description = <<~DOC
|
16
15
|
Sleet provides an easy way to grab the most recent Rspec persistance files from CircleCI.
|
17
|
-
It also aggregates the
|
18
|
-
|
16
|
+
It also aggregates the artifacts from CircleCI, since you will have 1 per build container.
|
17
|
+
DOC
|
19
18
|
spec.homepage = 'https://github.com/coreyja/sleet'
|
20
19
|
spec.license = 'MIT'
|
21
20
|
|
@@ -27,18 +26,16 @@ Gem::Specification.new do |spec|
|
|
27
26
|
spec.require_paths = ['lib']
|
28
27
|
|
29
28
|
spec.add_dependency 'colorize', '~> 0.8.1'
|
30
|
-
spec.add_dependency 'faraday', '>= 0.13.1', '<
|
29
|
+
spec.add_dependency 'faraday', '>= 0.13.1', '< 1.1.0'
|
31
30
|
spec.add_dependency 'rspec', '~> 3.0'
|
32
|
-
spec.add_dependency 'rugged', '
|
31
|
+
spec.add_dependency 'rugged', '>= 0.26', '< 1.1'
|
33
32
|
spec.add_dependency 'terminal-table', '~> 1.8'
|
34
|
-
spec.add_dependency 'thor', '
|
33
|
+
spec.add_dependency 'thor', '>= 0.20', '< 1.1'
|
35
34
|
|
36
|
-
spec.add_development_dependency '
|
37
|
-
spec.add_development_dependency 'gem-release', '2.0.0.dev.5'
|
35
|
+
spec.add_development_dependency 'gem-release', '= 2.1.1'
|
38
36
|
spec.add_development_dependency 'github_changelog_generator', '~> 1.14'
|
39
37
|
spec.add_development_dependency 'pry', '~> 0.10'
|
40
|
-
spec.add_development_dependency 'rake', '~>
|
41
|
-
spec.add_development_dependency 'rubocop', '
|
42
|
-
spec.add_development_dependency '
|
43
|
-
spec.add_development_dependency 'webmock', '~> 3.3.0'
|
38
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
39
|
+
spec.add_development_dependency 'rubocop-coreyja', '0.4.0'
|
40
|
+
spec.add_development_dependency 'webmock', '~> 3.8.0'
|
44
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sleet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Alexander
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: 0.13.1
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
36
|
+
version: 1.1.0
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 0.13.1
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 1.1.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,16 +62,22 @@ dependencies:
|
|
62
62
|
name: rugged
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0.26
|
67
|
+
version: '0.26'
|
68
|
+
- - "<"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '1.1'
|
68
71
|
type: :runtime
|
69
72
|
prerelease: false
|
70
73
|
version_requirements: !ruby/object:Gem::Requirement
|
71
74
|
requirements:
|
72
|
-
- - "
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0.26'
|
78
|
+
- - "<"
|
73
79
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
80
|
+
version: '1.1'
|
75
81
|
- !ruby/object:Gem::Dependency
|
76
82
|
name: terminal-table
|
77
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,44 +96,36 @@ dependencies:
|
|
90
96
|
name: thor
|
91
97
|
requirement: !ruby/object:Gem::Requirement
|
92
98
|
requirements:
|
93
|
-
- - "
|
99
|
+
- - ">="
|
94
100
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.20
|
101
|
+
version: '0.20'
|
102
|
+
- - "<"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '1.1'
|
96
105
|
type: :runtime
|
97
106
|
prerelease: false
|
98
107
|
version_requirements: !ruby/object:Gem::Requirement
|
99
108
|
requirements:
|
100
|
-
- - "
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 0.20.0
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: bundler
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
109
|
+
- - ">="
|
108
110
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
110
|
-
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
111
|
+
version: '0.20'
|
112
|
+
- - "<"
|
115
113
|
- !ruby/object:Gem::Version
|
116
|
-
version: '1.
|
114
|
+
version: '1.1'
|
117
115
|
- !ruby/object:Gem::Dependency
|
118
116
|
name: gem-release
|
119
117
|
requirement: !ruby/object:Gem::Requirement
|
120
118
|
requirements:
|
121
119
|
- - '='
|
122
120
|
- !ruby/object:Gem::Version
|
123
|
-
version: 2.
|
121
|
+
version: 2.1.1
|
124
122
|
type: :development
|
125
123
|
prerelease: false
|
126
124
|
version_requirements: !ruby/object:Gem::Requirement
|
127
125
|
requirements:
|
128
126
|
- - '='
|
129
127
|
- !ruby/object:Gem::Version
|
130
|
-
version: 2.
|
128
|
+
version: 2.1.1
|
131
129
|
- !ruby/object:Gem::Dependency
|
132
130
|
name: github_changelog_generator
|
133
131
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,59 +160,45 @@ dependencies:
|
|
162
160
|
requirements:
|
163
161
|
- - "~>"
|
164
162
|
- !ruby/object:Gem::Version
|
165
|
-
version: '
|
166
|
-
type: :development
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: '12.3'
|
173
|
-
- !ruby/object:Gem::Dependency
|
174
|
-
name: rubocop
|
175
|
-
requirement: !ruby/object:Gem::Requirement
|
176
|
-
requirements:
|
177
|
-
- - "~>"
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: 0.53.0
|
163
|
+
version: '13.0'
|
180
164
|
type: :development
|
181
165
|
prerelease: false
|
182
166
|
version_requirements: !ruby/object:Gem::Requirement
|
183
167
|
requirements:
|
184
168
|
- - "~>"
|
185
169
|
- !ruby/object:Gem::Version
|
186
|
-
version:
|
170
|
+
version: '13.0'
|
187
171
|
- !ruby/object:Gem::Dependency
|
188
|
-
name: rubocop-
|
172
|
+
name: rubocop-coreyja
|
189
173
|
requirement: !ruby/object:Gem::Requirement
|
190
174
|
requirements:
|
191
|
-
- -
|
175
|
+
- - '='
|
192
176
|
- !ruby/object:Gem::Version
|
193
|
-
version:
|
177
|
+
version: 0.4.0
|
194
178
|
type: :development
|
195
179
|
prerelease: false
|
196
180
|
version_requirements: !ruby/object:Gem::Requirement
|
197
181
|
requirements:
|
198
|
-
- -
|
182
|
+
- - '='
|
199
183
|
- !ruby/object:Gem::Version
|
200
|
-
version:
|
184
|
+
version: 0.4.0
|
201
185
|
- !ruby/object:Gem::Dependency
|
202
186
|
name: webmock
|
203
187
|
requirement: !ruby/object:Gem::Requirement
|
204
188
|
requirements:
|
205
189
|
- - "~>"
|
206
190
|
- !ruby/object:Gem::Version
|
207
|
-
version: 3.
|
191
|
+
version: 3.8.0
|
208
192
|
type: :development
|
209
193
|
prerelease: false
|
210
194
|
version_requirements: !ruby/object:Gem::Requirement
|
211
195
|
requirements:
|
212
196
|
- - "~>"
|
213
197
|
- !ruby/object:Gem::Version
|
214
|
-
version: 3.
|
198
|
+
version: 3.8.0
|
215
199
|
description: |
|
216
200
|
Sleet provides an easy way to grab the most recent Rspec persistance files from CircleCI.
|
217
|
-
It also aggregates the
|
201
|
+
It also aggregates the artifacts from CircleCI, since you will have 1 per build container.
|
218
202
|
email:
|
219
203
|
- coreyja@gmail.com
|
220
204
|
executables:
|
@@ -238,6 +222,9 @@ files:
|
|
238
222
|
- bin/console
|
239
223
|
- bin/release
|
240
224
|
- bin/setup
|
225
|
+
- docs/CNAME
|
226
|
+
- docs/README.md
|
227
|
+
- docs/_config.yml
|
241
228
|
- exe/sleet
|
242
229
|
- lib/sleet.rb
|
243
230
|
- lib/sleet/artifact_downloader.rb
|
@@ -250,6 +237,7 @@ files:
|
|
250
237
|
- lib/sleet/error.rb
|
251
238
|
- lib/sleet/fetch_command.rb
|
252
239
|
- lib/sleet/job_fetcher.rb
|
240
|
+
- lib/sleet/local_repo.rb
|
253
241
|
- lib/sleet/repo.rb
|
254
242
|
- lib/sleet/rspec_file_merger.rb
|
255
243
|
- lib/sleet/version.rb
|
@@ -273,8 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
261
|
- !ruby/object:Gem::Version
|
274
262
|
version: '0'
|
275
263
|
requirements: []
|
276
|
-
|
277
|
-
rubygems_version: 2.7.3
|
264
|
+
rubygems_version: 3.0.1
|
278
265
|
signing_key:
|
279
266
|
specification_version: 4
|
280
267
|
summary: CircleCI RSpec Status Persistance File Aggregator
|
data/README.md
DELETED
@@ -1,142 +0,0 @@
|
|
1
|
-
# Sleet ☁️ ❄️
|
2
|
-
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/sleet.svg)](https://badge.fury.io/rb/sleet)
|
4
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/7f346b368d72b53ef630/maintainability)](https://codeclimate.com/github/coreyja/sleet/maintainability)
|
5
|
-
[![CircleCI](https://circleci.com/gh/coreyja/sleet.svg?style=svg)](https://circleci.com/gh/coreyja/sleet)
|
6
|
-
|
7
|
-
## Background and Problem
|
8
|
-
|
9
|
-
RSpec has a [feature](https://relishapp.com/rspec/rspec-core/v/3-7/docs/command-line/only-failures) that I find very useful which is the `--only-failures` option. This will re-run only that examples that failed the previous run.
|
10
|
-
|
11
|
-
CircleCI has support for [uploading artifcats](https://circleci.com/docs/2.0/artifacts/) with your builds, which allows us to store the persistance file that powers the RSpec only failures option.
|
12
|
-
However! CircleCI also supports and encourages parallelizing your build, which means even if you upload your rspec persistance file, you actually have a number of them each containing a subset of your test suite.
|
13
|
-
This is where `Sleet` comes in!
|
14
|
-
|
15
|
-
## Purpose
|
16
|
-
|
17
|
-
This tool does two things:
|
18
|
-
1. It downloads all of the `.rspec_failed_examples` files that were uploaded to CircleCI for the most recent build of the current branch
|
19
|
-
2. It combines the multiple files into a single sorted `.rspec_failed_examples` file, and moves it to the [current directory](https://github.com/coreyja/CRSPFA/issues/1)
|
20
|
-
|
21
|
-
## Getting Started
|
22
|
-
|
23
|
-
### 1. Configure RSpec to Create and Use an example persistance file
|
24
|
-
|
25
|
-
We need to set the `example_status_persistence_file_path` config in RSpec. Here are the relevant [RSpec docs](https://relishapp.com/rspec/rspec-core/v/3-7/docs/command-line/only-failures#background).
|
26
|
-
|
27
|
-
The first step is to create(/or add to) your `spec/spec_helper.rb` file. We want to include the following configuration, which tells RSpec where to store the status persistance file. The actual location and file name are up to you, this is just an example. (Though using this name will require less configuration later.)
|
28
|
-
|
29
|
-
```
|
30
|
-
RSpec.configure do |c|
|
31
|
-
c.example_status_persistence_file_path = ".rspec_example_statuses"
|
32
|
-
end
|
33
|
-
```
|
34
|
-
|
35
|
-
if you just created the `spec_helper.rb` file then you will need to create a `.rspec` file containing the following to load your new helper file.
|
36
|
-
|
37
|
-
```
|
38
|
-
--require spec_helper
|
39
|
-
```
|
40
|
-
|
41
|
-
Again there are other ways to load your `spec_helper.rb` file, including requiring it from each spec. Pick one that works for you.
|
42
|
-
|
43
|
-
### 2. Collect the example persistance files in CircleCI
|
44
|
-
|
45
|
-
To do this we need to create a step which [saves](https://circleci.com/docs/2.0/artifacts/) the `.rspec_example_statuses` as artifacts of the build. The following is an example of such a step in CircleCI. This must happen after rspec has run or else the persistance file will not exist.
|
46
|
-
|
47
|
-
```
|
48
|
-
- store_artifacts:
|
49
|
-
path: .rspec_example_statuses
|
50
|
-
|
51
|
-
```
|
52
|
-
|
53
|
-
### 3. Save a CircleCI Token locally (to access private builds)
|
54
|
-
|
55
|
-
In order to see private builds/repos in CircleCI you will need to get a CircleCI token and save it locally to a Sleet Configuration file.
|
56
|
-
The recommended approach is to create a yml file in your home directory which contains your the key `circle_ci_token`
|
57
|
-
|
58
|
-
```
|
59
|
-
circle_ci_token: PLACE_TOKEN_HERE
|
60
|
-
```
|
61
|
-
|
62
|
-
An API token can be generated here: [https://circleci.com/account/api](https://circleci.com/account/api)
|
63
|
-
|
64
|
-
### 4. Run this tool from your project
|
65
|
-
|
66
|
-
```
|
67
|
-
sleet
|
68
|
-
```
|
69
|
-
|
70
|
-
This will look up the latest completed build in CircleCI for this branch, and download all the relevant `.rspec_example_statuses` files. It then combines and sorts them and saves the result to the `.rspec_example_statuses` file locally.
|
71
|
-
|
72
|
-
### 5. Run RSpec with `--only-failures`
|
73
|
-
|
74
|
-
```
|
75
|
-
bundle exec rspec --only-failures
|
76
|
-
```
|
77
|
-
|
78
|
-
This will run only the examples that failed in CircleCI!
|
79
|
-
|
80
|
-
## Configuration
|
81
|
-
|
82
|
-
If you are using Worklfows in your CircleCI builds, or you are working with a different persistance file name, you may need to configure Sleet beyond the defaults.
|
83
|
-
|
84
|
-
Sleet currently supports two ways to input configurations:
|
85
|
-
|
86
|
-
1. Through YML files
|
87
|
-
- `Sleet` will search 'up' from where the command was run and look for `.sleet.yml` files. It will combine all the files it finds, such that 'deeper' files take presedence. This allows you to have a user-level config at `~/.sleet.yml` and have project specific files which take presendence over the user level config (ex: `~/Projects/foo/.sleet.yml`)
|
88
|
-
2. Through the CLI
|
89
|
-
- These always take presendece the options provided in the YML files
|
90
|
-
|
91
|
-
To view your current configuration use the `sleet config` command which will give you a table of the current configuration. You can also use the `--print-config` flag with the `fetch` command to print out the config, including any other CLI options. This can be useful for bebugging as the output also tells you where each option came from.
|
92
|
-
|
93
|
-
### Options
|
94
|
-
|
95
|
-
These are the options that are currently supported
|
96
|
-
|
97
|
-
#### `source_dir`
|
98
|
-
|
99
|
-
Alias: s
|
100
|
-
|
101
|
-
This is the directory of the source git repo. If a `source_dir` is NOT given we look up from the current directory for the nearest git repo.
|
102
|
-
|
103
|
-
#### `input_file`
|
104
|
-
|
105
|
-
Alias: i
|
106
|
-
|
107
|
-
This is the name of the Rspec Circle Persistance File in CircleCI. The default is `.rspec_example_statuses`
|
108
|
-
|
109
|
-
This will match if the full path on CircleCI ends in the given name.
|
110
|
-
|
111
|
-
#### `output_file`
|
112
|
-
|
113
|
-
Alias: o
|
114
|
-
|
115
|
-
This is the name for the output file, on your local system. It is relative to the `source_dir`.
|
116
|
-
|
117
|
-
Will be IGNORED if `workflows` is provided.
|
118
|
-
|
119
|
-
#### `workflows`
|
120
|
-
|
121
|
-
Alias: w
|
122
|
-
|
123
|
-
If you are using workflows in CircleCI, then this is for you! You need to tell `Sleet` which build(s) to look in, and where each output should be saved.
|
124
|
-
The input is a hash, where the key is the build name and the value is the `output_file` for that build. Sleet supports saving the artifacts to multiple builds, meaning it can support a mono-repo setup.
|
125
|
-
|
126
|
-
Build-Test-Deploy Demo:
|
127
|
-
|
128
|
-
For this example you have three jobs in your CircleCI Workflow, `build`, `test` and `deploy`, but only 1 (the `test` build) generate an Rspec persistance file
|
129
|
-
|
130
|
-
This command will pick the `test` build and saw it's artificats to the `.rspec_example_statuses` file
|
131
|
-
|
132
|
-
```
|
133
|
-
sleet fetch --workflows test:.rspec_example_statuses
|
134
|
-
```
|
135
|
-
|
136
|
-
MonoRepo Demo:
|
137
|
-
|
138
|
-
If you have a mono-repo that contains 3 sub-dirs. `foo`, `bar` and `baz`. And each one has an accompanying build. We can process all these sub-dirs at once with the following workflow command.
|
139
|
-
|
140
|
-
```
|
141
|
-
sleet fetch --workflows foo-test:foo/.rpsec_example_statuses bar-test:bar/.rspec_example_statuses baz-specs:baz/spec/examples.txt
|
142
|
-
```
|