mixlib-versioning 1.0.0 → 1.2.12
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.
- checksums.yaml +7 -0
- data/lib/mixlib/versioning.rb +41 -37
- data/lib/mixlib/versioning/exceptions.rb +2 -2
- data/lib/mixlib/versioning/format.rb +42 -38
- data/lib/mixlib/versioning/format/git_describe.rb +5 -7
- data/lib/mixlib/versioning/format/opscode_semver.rb +8 -19
- data/lib/mixlib/versioning/format/partial_semver.rb +62 -0
- data/lib/mixlib/versioning/format/rubygems.rb +14 -10
- data/lib/mixlib/versioning/format/semver.rb +9 -11
- data/lib/mixlib/versioning/version.rb +3 -3
- metadata +15 -87
- data/.gitignore +0 -18
- data/.yardopts +0 -7
- data/CHANGELOG.md +0 -3
- data/CONTRIBUTING.md +0 -188
- data/Gemfile +0 -9
- data/README.md +0 -364
- data/Rakefile +0 -6
- data/mixlib-versioning.gemspec +0 -22
- data/spec/mixlib/versioning/format/git_describe_spec.rb +0 -178
- data/spec/mixlib/versioning/format/opscode_semver_spec.rb +0 -113
- data/spec/mixlib/versioning/format/rubygems_spec.rb +0 -142
- data/spec/mixlib/versioning/format/semver_spec.rb +0 -107
- data/spec/mixlib/versioning/format_spec.rb +0 -69
- data/spec/mixlib/versioning/versioning_spec.rb +0 -259
- data/spec/spec_helper.rb +0 -43
- data/spec/support/shared_examples/basic_semver.rb +0 -42
- data/spec/support/shared_examples/behaviors/filterable.rb +0 -66
- data/spec/support/shared_examples/behaviors/parses_valid_version_strings.rb +0 -32
- data/spec/support/shared_examples/behaviors/rejects_invalid_version_strings.rb +0 -32
- data/spec/support/shared_examples/behaviors/serializable.rb +0 -51
- data/spec/support/shared_examples/behaviors/sortable.rb +0 -45
- data/spec/support/shared_examples/semver.rb +0 -105
@@ -0,0 +1,62 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Author:: Christopher Maier (<cm@chef.io>)
|
4
|
+
# Author:: Ryan Hass (<rhass@chef.io>)
|
5
|
+
# Copyright:: Copyright (c) 2017-2018 Chef Software Inc.
|
6
|
+
# License:: Apache License, Version 2.0
|
7
|
+
#
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
# you may not use this file except in compliance with the License.
|
10
|
+
# You may obtain a copy of the License at
|
11
|
+
#
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
#
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
|
21
|
+
module Mixlib
|
22
|
+
class Versioning
|
23
|
+
class Format
|
24
|
+
# Handles partial version strings.
|
25
|
+
# -----------------
|
26
|
+
# ```text
|
27
|
+
# MAJOR
|
28
|
+
# MAJOR.MINOR
|
29
|
+
# ```
|
30
|
+
#
|
31
|
+
# EXAMPLES
|
32
|
+
# --------
|
33
|
+
# ```text
|
34
|
+
# 11
|
35
|
+
# 11.0
|
36
|
+
# ```
|
37
|
+
#
|
38
|
+
# @author Seth Chisamore (<schisamo@chef.io>)
|
39
|
+
# @author Christopher Maier (<cm@chef.io>)
|
40
|
+
# @author Ryan Hass (<rhass@chef.io>)
|
41
|
+
class PartialSemVer < Format
|
42
|
+
# http://rubular.com/r/NmRSN8vCie
|
43
|
+
PARTIAL_REGEX = /^(\d+)\.?(?:(\d*))$/
|
44
|
+
# @see Format#parse
|
45
|
+
def parse(version_string)
|
46
|
+
match = version_string.match(PARTIAL_REGEX) rescue nil
|
47
|
+
|
48
|
+
unless match
|
49
|
+
raise Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
|
50
|
+
end
|
51
|
+
|
52
|
+
@major, @minor = match[1..2]
|
53
|
+
@major, @minor, @patch = [@major, @minor, @patch].map(&:to_i)
|
54
|
+
|
55
|
+
# Partial versions do not contain these values, so we just set them to nil.
|
56
|
+
@prerelease = nil
|
57
|
+
@build = nil
|
58
|
+
end
|
59
|
+
end # class Partial
|
60
|
+
end # class Format
|
61
|
+
end # module Versioning
|
62
|
+
end # module Mixlib
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@
|
3
|
-
# Author:: Christopher Maier (<cm@
|
4
|
-
# Copyright:: Copyright (c) 2013
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Author:: Christopher Maier (<cm@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2013-2018 Chef Software, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -39,10 +39,9 @@ module Mixlib
|
|
39
39
|
# 10.16.2
|
40
40
|
# ```
|
41
41
|
#
|
42
|
-
# @author Seth Chisamore (<schisamo@
|
43
|
-
# @author Christopher Maier (<cm@
|
42
|
+
# @author Seth Chisamore (<schisamo@chef.io>)
|
43
|
+
# @author Christopher Maier (<cm@chef.io>)
|
44
44
|
class Rubygems < Format
|
45
|
-
|
46
45
|
RUBYGEMS_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\.([[:alnum:]]+(?:\.[[:alnum:]]+)?))?(?:\-(\d+))?$/
|
47
46
|
|
48
47
|
# @see Format#parse
|
@@ -54,12 +53,17 @@ module Mixlib
|
|
54
53
|
end
|
55
54
|
|
56
55
|
@major, @minor, @patch, @prerelease, @iteration = match[1..5]
|
57
|
-
@major, @minor, @patch
|
56
|
+
@major, @minor, @patch = [@major, @minor, @patch].map(&:to_i)
|
58
57
|
|
59
|
-
# Do not convert @
|
60
|
-
|
58
|
+
# Do not convert @prerelease or @iteration to an integer;
|
59
|
+
# sorting logic will handle the conversion.
|
60
|
+
@iteration = if @iteration.nil? || @iteration.empty?
|
61
|
+
nil
|
62
|
+
else
|
63
|
+
@iteration.to_i
|
64
|
+
end
|
65
|
+
@prerelease = nil if @prerelease.nil? || @prerelease.empty?
|
61
66
|
end
|
62
|
-
|
63
67
|
end # class Rubygems
|
64
68
|
end # class Format
|
65
69
|
end # module Versioning
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@
|
3
|
-
# Author:: Christopher Maier (<cm@
|
4
|
-
# Copyright:: Copyright (c) 2013
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Author:: Christopher Maier (<cm@chef.io>)
|
4
|
+
# Copyright:: Copyright (c) 2013-2018 Chef Software, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -28,7 +28,7 @@ module Mixlib
|
|
28
28
|
# MAJOR.MINOR.PATCH
|
29
29
|
# MAJOR.MINOR.PATCH-PRERELEASE
|
30
30
|
# MAJOR.MINOR.PATCH-PRERELEASE+BUILD
|
31
|
-
|
31
|
+
# ```
|
32
32
|
#
|
33
33
|
# EXAMPLES
|
34
34
|
# --------
|
@@ -39,11 +39,10 @@ module Mixlib
|
|
39
39
|
# 11.0.0-alpha1+20121218164140.git.207.694b062
|
40
40
|
# ```
|
41
41
|
#
|
42
|
-
# @author Seth Chisamore (<schisamo@
|
43
|
-
# @author Christopher Maier (<cm@
|
42
|
+
# @author Seth Chisamore (<schisamo@chef.io>)
|
43
|
+
# @author Christopher Maier (<cm@chef.io>)
|
44
44
|
class SemVer < Format
|
45
|
-
|
46
|
-
SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\-([\dA-Za-z\-\.]+))?(?:\+([\dA-Za-z\-\.]+))?$/
|
45
|
+
SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][a-zA-Z0-9-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][a-zA-Z0-9-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/
|
47
46
|
|
48
47
|
# @see Format#parse
|
49
48
|
def parse(version_string)
|
@@ -56,10 +55,9 @@ module Mixlib
|
|
56
55
|
@major, @minor, @patch, @prerelease, @build = match[1..5]
|
57
56
|
@major, @minor, @patch = [@major, @minor, @patch].map(&:to_i)
|
58
57
|
|
59
|
-
@prerelease = nil if
|
60
|
-
@build = nil if
|
58
|
+
@prerelease = nil if @prerelease.nil? || @prerelease.empty?
|
59
|
+
@build = nil if @build.nil? || @build.empty?
|
61
60
|
end
|
62
|
-
|
63
61
|
end # class SemVer
|
64
62
|
end # class Format
|
65
63
|
end # module Versioning
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@
|
3
|
-
# Copyright:: Copyright (c) 2013
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Copyright:: Copyright (c) 2013-2018 Chef Software, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -18,6 +18,6 @@
|
|
18
18
|
|
19
19
|
module Mixlib
|
20
20
|
class Versioning
|
21
|
-
VERSION = "1.
|
21
|
+
VERSION = "1.2.12"
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixlib-versioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.12
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Seth Chisamore
|
@@ -10,118 +9,47 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: rspec
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
|
-
requirements:
|
20
|
-
- - ! '>='
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '0'
|
23
|
-
type: :development
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
|
-
requirements:
|
28
|
-
- - ! '>='
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: '0'
|
31
|
-
- !ruby/object:Gem::Dependency
|
32
|
-
name: rspec_junit_formatter
|
33
|
-
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
|
-
requirements:
|
36
|
-
- - ! '>='
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: '0'
|
39
|
-
type: :development
|
40
|
-
prerelease: false
|
41
|
-
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
|
-
requirements:
|
44
|
-
- - ! '>='
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '0'
|
12
|
+
date: 2019-12-30 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
47
14
|
description: General purpose Ruby library that allows you to parse, compare and manipulate
|
48
15
|
version strings in multiple formats.
|
49
|
-
email:
|
50
|
-
- schisamo@opscode.com
|
51
|
-
- cm@opscode.com
|
16
|
+
email: info@chef.io
|
52
17
|
executables: []
|
53
18
|
extensions: []
|
54
19
|
extra_rdoc_files: []
|
55
20
|
files:
|
56
|
-
- .gitignore
|
57
|
-
- .yardopts
|
58
|
-
- CHANGELOG.md
|
59
|
-
- CONTRIBUTING.md
|
60
|
-
- Gemfile
|
61
21
|
- LICENSE
|
62
|
-
- README.md
|
63
|
-
- Rakefile
|
64
22
|
- lib/mixlib/versioning.rb
|
65
23
|
- lib/mixlib/versioning/exceptions.rb
|
66
24
|
- lib/mixlib/versioning/format.rb
|
67
25
|
- lib/mixlib/versioning/format/git_describe.rb
|
68
26
|
- lib/mixlib/versioning/format/opscode_semver.rb
|
27
|
+
- lib/mixlib/versioning/format/partial_semver.rb
|
69
28
|
- lib/mixlib/versioning/format/rubygems.rb
|
70
29
|
- lib/mixlib/versioning/format/semver.rb
|
71
30
|
- lib/mixlib/versioning/version.rb
|
72
|
-
|
73
|
-
|
74
|
-
-
|
75
|
-
|
76
|
-
- spec/mixlib/versioning/format/semver_spec.rb
|
77
|
-
- spec/mixlib/versioning/format_spec.rb
|
78
|
-
- spec/mixlib/versioning/versioning_spec.rb
|
79
|
-
- spec/spec_helper.rb
|
80
|
-
- spec/support/shared_examples/basic_semver.rb
|
81
|
-
- spec/support/shared_examples/behaviors/filterable.rb
|
82
|
-
- spec/support/shared_examples/behaviors/parses_valid_version_strings.rb
|
83
|
-
- spec/support/shared_examples/behaviors/rejects_invalid_version_strings.rb
|
84
|
-
- spec/support/shared_examples/behaviors/serializable.rb
|
85
|
-
- spec/support/shared_examples/behaviors/sortable.rb
|
86
|
-
- spec/support/shared_examples/semver.rb
|
87
|
-
homepage: https://github.com/opscode/mixlib-versioning
|
88
|
-
licenses: []
|
31
|
+
homepage: https://github.com/chef/mixlib-versioning
|
32
|
+
licenses:
|
33
|
+
- Apache-2.0
|
34
|
+
metadata: {}
|
89
35
|
post_install_message:
|
90
36
|
rdoc_options: []
|
91
37
|
require_paths:
|
92
38
|
- lib
|
93
39
|
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
-
none: false
|
95
40
|
requirements:
|
96
|
-
- -
|
41
|
+
- - ">="
|
97
42
|
- !ruby/object:Gem::Version
|
98
|
-
version: '0'
|
43
|
+
version: '2.0'
|
99
44
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
-
none: false
|
101
45
|
requirements:
|
102
|
-
- -
|
46
|
+
- - ">="
|
103
47
|
- !ruby/object:Gem::Version
|
104
48
|
version: '0'
|
105
49
|
requirements: []
|
106
|
-
|
107
|
-
rubygems_version: 1.8.25
|
50
|
+
rubygems_version: 3.0.3
|
108
51
|
signing_key:
|
109
|
-
specification_version:
|
52
|
+
specification_version: 4
|
110
53
|
summary: General purpose Ruby library that allows you to parse, compare and manipulate
|
111
54
|
version strings in multiple formats.
|
112
|
-
test_files:
|
113
|
-
- spec/mixlib/versioning/format/git_describe_spec.rb
|
114
|
-
- spec/mixlib/versioning/format/opscode_semver_spec.rb
|
115
|
-
- spec/mixlib/versioning/format/rubygems_spec.rb
|
116
|
-
- spec/mixlib/versioning/format/semver_spec.rb
|
117
|
-
- spec/mixlib/versioning/format_spec.rb
|
118
|
-
- spec/mixlib/versioning/versioning_spec.rb
|
119
|
-
- spec/spec_helper.rb
|
120
|
-
- spec/support/shared_examples/basic_semver.rb
|
121
|
-
- spec/support/shared_examples/behaviors/filterable.rb
|
122
|
-
- spec/support/shared_examples/behaviors/parses_valid_version_strings.rb
|
123
|
-
- spec/support/shared_examples/behaviors/rejects_invalid_version_strings.rb
|
124
|
-
- spec/support/shared_examples/behaviors/serializable.rb
|
125
|
-
- spec/support/shared_examples/behaviors/sortable.rb
|
126
|
-
- spec/support/shared_examples/semver.rb
|
127
|
-
has_rdoc:
|
55
|
+
test_files: []
|
data/.gitignore
DELETED
data/.yardopts
DELETED
data/CHANGELOG.md
DELETED
data/CONTRIBUTING.md
DELETED
@@ -1,188 +0,0 @@
|
|
1
|
-
[jira-project]: http://tickets.opscode.com/browse/MIXLIB
|
2
|
-
[github-project]: http://www.github.com/opscode/mixlib-versioning
|
3
|
-
[github-opscode]: http://www.github.com/opscode
|
4
|
-
[cla]: https://secure.echosign.com/public/hostedForm?formid=PJIF5694K6L
|
5
|
-
[cla-corp]: https://secure.echosign.com/public/hostedForm?formid=PIE6C7AX856
|
6
|
-
[wiki-contribute]: http://wiki.opscode.com/display/chef/How+to+Contribute
|
7
|
-
[wiki-git]: http://wiki.opscode.com/display/chef/Working+with+Git
|
8
|
-
[wiki-code-review]: http://wiki.opscode.com/display/chef/Code+Review
|
9
|
-
[list-chef-dev]: http://lists.opscode.com/sympa/info/chef-dev
|
10
|
-
|
11
|
-
# Contributing to Mixlib::Versioning
|
12
|
-
|
13
|
-
We are glad you want to contribute to `Mixlib::Versioning`! The first step is
|
14
|
-
the desire to improve the project.
|
15
|
-
|
16
|
-
You can find the answers to additional frequently asked questions
|
17
|
-
[on the wiki][wiki-contribute].
|
18
|
-
|
19
|
-
## Quick-contribute
|
20
|
-
|
21
|
-
* Create an account on our [bug tracker][jira-project]
|
22
|
-
* Sign our contributor agreement (CLA) [online][cla] (keep reading if you're
|
23
|
-
contributing on behalf of your employer)
|
24
|
-
* Create a ticket for your change on the [bug tracker][jira-project]. Tickets
|
25
|
-
should be filed under the **MIXLIB** project with the component set to
|
26
|
-
**mixlib-versioning**.
|
27
|
-
* Link to your patch as a rebased git branch or pull request from the ticket
|
28
|
-
* Resolve the ticket as fixed
|
29
|
-
|
30
|
-
We regularly review contributions and will get back to you if we have any
|
31
|
-
suggestions or concerns.
|
32
|
-
|
33
|
-
## The Apache License and the CLA/CCLA
|
34
|
-
|
35
|
-
Licensing is very important to open source projects, it helps ensure the
|
36
|
-
software continues to be available under the terms that the author desired.
|
37
|
-
This project uses the Apache 2.0 license to strike a balance between open
|
38
|
-
contribution and allowing you to use the software however you would like to.
|
39
|
-
|
40
|
-
The license tells you what rights you have that are provided by the copyright
|
41
|
-
holder. It is important that the contributor fully understands what rights they
|
42
|
-
are licensing and agrees to them. Sometimes the copyright holder isn't the
|
43
|
-
contributor, most often when the contributor is doing work for a company.
|
44
|
-
|
45
|
-
To make a good faith effort to ensure these criteria are met, Opscode requires
|
46
|
-
a Contributor License Agreement (CLA) or a Corporate Contributor License
|
47
|
-
Agreement (CCLA) for all contributions. This is without exception due to some
|
48
|
-
matters not being related to copyright and to avoid having to continually check
|
49
|
-
with our lawyers about small patches.
|
50
|
-
|
51
|
-
It only takes a few minutes to complete a CLA, and you retain the copyright to
|
52
|
-
your contribution.
|
53
|
-
|
54
|
-
You can complete our contributor agreement (CLA) [online][cla]. If you're
|
55
|
-
contributing on behalf of your employer, have your employer fill out our
|
56
|
-
[Corporate CLA][cla-corp] instead.
|
57
|
-
|
58
|
-
## Ticket Tracker (JIRA)
|
59
|
-
|
60
|
-
The [ticket tracker][jira-project] is the most important documentation for the
|
61
|
-
code base. It provides significant historical information, such as:
|
62
|
-
|
63
|
-
* Which release a bug fix is included in
|
64
|
-
* Discussion regarding the design and merits of features
|
65
|
-
* Error output to aid in finding similar bugs
|
66
|
-
|
67
|
-
Each ticket should aim to fix one bug or add one feature.
|
68
|
-
|
69
|
-
## Using git
|
70
|
-
|
71
|
-
You can get a quick copy of this project's repository by running:
|
72
|
-
|
73
|
-
```shell
|
74
|
-
git clone git://github.com/opscode/mixlib-versioning.git
|
75
|
-
```
|
76
|
-
|
77
|
-
For collaboration purposes, it is best if you create a Github account and fork
|
78
|
-
the repository to your own account. Once you do this you will be able to push
|
79
|
-
your changes to your Github repository for others to see and use.
|
80
|
-
|
81
|
-
### Branches and Commits
|
82
|
-
|
83
|
-
You should submit your patch as a git branch named after the ticket, such as
|
84
|
-
MIXLIB-1337. This is called a _topic branch_ and allows users to associate a
|
85
|
-
branch of code with the ticket.
|
86
|
-
|
87
|
-
It is a best practice to have your commit message have a _summary line_ that
|
88
|
-
includes the ticket number, followed by an empty line and then a brief
|
89
|
-
description of the commit. This also helps other contributors understand the
|
90
|
-
purpose of changes to the code. Here is an example from the Chef project:
|
91
|
-
|
92
|
-
CHEF-3435: Create deploy dirs before calling scm_provider
|
93
|
-
|
94
|
-
The SCM providers have an assertation that requires the deploy directory to
|
95
|
-
exist. The deploy provider will create missing directories, we don't converge
|
96
|
-
the actions before we call run_action against the SCM provider, so it is not
|
97
|
-
yet created. This ensures we run any converge actions waiting before we call
|
98
|
-
the SCM provider.
|
99
|
-
|
100
|
-
Remember that not all users use this library in the same way or on the same
|
101
|
-
operating systems as you, so it is helpful to be clear about your use case and
|
102
|
-
change so they can understand it even when it doesn't apply to them.
|
103
|
-
|
104
|
-
### Github and Pull Requests
|
105
|
-
|
106
|
-
All of Opscode's open source projects are available on [Github][github-opscode].
|
107
|
-
|
108
|
-
We don't require you to use Github, and we will even take patch diffs attached
|
109
|
-
to tickets on the tracker. However Github has a lot of convenient features,
|
110
|
-
such as being able to see a diff of changes between a pull request and the main
|
111
|
-
repository quickly without downloading the branch.
|
112
|
-
|
113
|
-
If you do choose to use a pull request, please provide a link to the pull
|
114
|
-
request from the ticket __and__ a link to the ticket from the pull request.
|
115
|
-
Because pull requests only have two states, open and closed, we can't easily
|
116
|
-
filter pull requests that are waiting for a reply from the author for various
|
117
|
-
reasons.
|
118
|
-
|
119
|
-
### More information
|
120
|
-
|
121
|
-
Additional help with git is available on the [Working with Git][wiki-git] wiki
|
122
|
-
page.
|
123
|
-
|
124
|
-
## Functional and Unit Tests
|
125
|
-
|
126
|
-
There are rspec unit tests in the 'spec' directory. If you don't have rspec
|
127
|
-
already installed, you can use the 'bundler' gem to help you get the necessary
|
128
|
-
prerequisites by running `sudo gem install bundler` and then `bundle install`
|
129
|
-
from the project root. You can run the project's spec tests by running
|
130
|
-
`rspec spec/*` or `rake spec` from the root directory of the this repository.
|
131
|
-
|
132
|
-
It is good to run the tests once on your system before you get started to
|
133
|
-
ensure they all pass so you have a valid baseline. After you write your patch,
|
134
|
-
run the tests again to see if they all pass.
|
135
|
-
|
136
|
-
If any don't pass, investigate them before submitting your patch.
|
137
|
-
|
138
|
-
These tests don't modify your system, and sometimes tests fail because a
|
139
|
-
command that would be run has changed because of your patch. This should be a
|
140
|
-
simple fix. Other times the failure can show you that an important feature no
|
141
|
-
longer works because of your change.
|
142
|
-
|
143
|
-
Any new feature should have unit tests included with the patch with good code
|
144
|
-
coverage to help protect it from future changes. Similarly, patches that fix a
|
145
|
-
bug or regression should have a _regression test_. Simply put, this is a test
|
146
|
-
that would fail without your patch but passes with it. The goal is to ensure
|
147
|
-
this bug doesn't regress in the future. Consider a regular expression that
|
148
|
-
doesn't match a certain pattern that it should, so you provide a patch and a
|
149
|
-
test to ensure that the part of the code that uses this regular expression
|
150
|
-
works as expected. Later another contributor may modify this regular expression
|
151
|
-
in a way that breaks your use cases. The test you wrote will fail, signalling
|
152
|
-
to them to research your ticket and use case and accounting for it.
|
153
|
-
|
154
|
-
## Code Review
|
155
|
-
|
156
|
-
Opscode regularly reviews code contributions and provides suggestions for
|
157
|
-
improvement in the code itself or the implementation.
|
158
|
-
|
159
|
-
We find contributions by searching the ticket tracker for _resolved_ tickets
|
160
|
-
with a status of _fixed_. If we have feedback we will reopen the ticket and you
|
161
|
-
should resolve it again when you've made the changes or have a response to our
|
162
|
-
feedback. When we believe the patch is ready to be merged, we update the status
|
163
|
-
to _Fix Reviewed_.
|
164
|
-
|
165
|
-
Depending on the project, these tickets are then merged within a week or two,
|
166
|
-
depending on the current release cycle. At this point the ticket status will be
|
167
|
-
updated to _Fix Committed_ or _Closed_.
|
168
|
-
|
169
|
-
Please see the [Code Review][wiki-code-review] page on the wiki for additional
|
170
|
-
information.
|
171
|
-
|
172
|
-
## Release Cycle
|
173
|
-
|
174
|
-
The versioning for the this project is X.Y.Z and follows
|
175
|
-
[SemVer 2.0.0-rc.1 conventions](http://semver.org/):
|
176
|
-
|
177
|
-
* X is a major release, which may not be fully compatible with prior major releases
|
178
|
-
* Y is a minor release, which adds both new features and bug fixes
|
179
|
-
* Z is a patch release, which adds just bug fixes
|
180
|
-
|
181
|
-
There are usually beta releases and release candidates (RC) of major and minor
|
182
|
-
releases announced on the [chef-dev mailing list][list-chef-dev]. Once an
|
183
|
-
RC is released, we wait at least three days to allow for testing for regressions
|
184
|
-
before the final release. If a blocking regression is found then another RC is
|
185
|
-
made containing the fix and the timer is reset.
|
186
|
-
|
187
|
-
Once the official release is made, the release notes are available on the
|
188
|
-
[Opscode blog](http://www.opscode.com/blog).
|