facter 1.7.6 → 2.0.1.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of facter might be problematic. Click here for more details.

Files changed (155) hide show
  1. checksums.yaml +7 -0
  2. data/COMMITTERS.md +194 -0
  3. data/CONTRIBUTING.md +63 -235
  4. data/Gemfile +12 -8
  5. data/README.md +1 -2
  6. data/Rakefile +1 -1
  7. data/bin/facter +0 -4
  8. data/ext/build_defaults.yaml +2 -2
  9. data/ext/project_data.yaml +18 -0
  10. data/install.rb +1 -16
  11. data/lib/facter.rb +171 -171
  12. data/lib/facter/application.rb +65 -54
  13. data/lib/facter/core/aggregate.rb +220 -0
  14. data/lib/facter/core/directed_graph.rb +46 -0
  15. data/lib/facter/core/execution.rb +100 -0
  16. data/lib/facter/core/execution/base.rb +73 -0
  17. data/lib/facter/core/execution/posix.rb +50 -0
  18. data/lib/facter/core/execution/windows.rb +57 -0
  19. data/lib/facter/core/logging.rb +169 -0
  20. data/lib/facter/core/resolvable.rb +94 -0
  21. data/lib/facter/core/suitable.rb +117 -0
  22. data/lib/facter/domain.rb +15 -9
  23. data/lib/facter/filesystems.rb +1 -1
  24. data/lib/facter/hardwaremodel.rb +1 -1
  25. data/lib/facter/hostname.rb +3 -3
  26. data/lib/facter/interfaces.rb +6 -1
  27. data/lib/facter/ipaddress.rb +2 -2
  28. data/lib/facter/kernel.rb +1 -1
  29. data/lib/facter/kernelrelease.rb +1 -1
  30. data/lib/facter/ldom.rb +1 -1
  31. data/lib/facter/lsbdistcodename.rb +1 -1
  32. data/lib/facter/lsbdistdescription.rb +1 -1
  33. data/lib/facter/lsbdistid.rb +1 -1
  34. data/lib/facter/lsbdistrelease.rb +1 -1
  35. data/lib/facter/lsbrelease.rb +1 -1
  36. data/lib/facter/macaddress.rb +1 -14
  37. data/lib/facter/macosx.rb +2 -2
  38. data/lib/facter/memory.rb +8 -19
  39. data/lib/facter/operatingsystem.rb +1 -1
  40. data/lib/facter/operatingsystemrelease.rb +34 -1
  41. data/lib/facter/physicalprocessorcount.rb +6 -6
  42. data/lib/facter/processor.rb +11 -10
  43. data/lib/facter/selinux.rb +4 -15
  44. data/lib/facter/ssh.rb +5 -2
  45. data/lib/facter/util/architecture.rb +2 -2
  46. data/lib/facter/util/collection.rb +42 -38
  47. data/lib/facter/util/config.rb +19 -9
  48. data/lib/facter/util/confine.rb +34 -4
  49. data/lib/facter/util/ec2.rb +1 -1
  50. data/lib/facter/util/fact.rb +108 -36
  51. data/lib/facter/util/file_read.rb +7 -6
  52. data/lib/facter/util/formatter.rb +38 -0
  53. data/lib/facter/util/ip.rb +3 -3
  54. data/lib/facter/util/loader.rb +62 -42
  55. data/lib/facter/util/macosx.rb +7 -8
  56. data/lib/facter/util/manufacturer.rb +3 -3
  57. data/lib/facter/util/memory.rb +13 -13
  58. data/lib/facter/util/monkey_patches.rb +0 -31
  59. data/lib/facter/util/netmask.rb +3 -3
  60. data/lib/facter/util/normalization.rb +94 -0
  61. data/lib/facter/util/nothing_loader.rb +3 -6
  62. data/lib/facter/util/parser.rb +3 -5
  63. data/lib/facter/util/plist/generator.rb +1 -1
  64. data/lib/facter/util/processor.rb +15 -15
  65. data/lib/facter/util/resolution.rb +112 -289
  66. data/lib/facter/util/solaris_zones.rb +4 -4
  67. data/lib/facter/util/uptime.rb +8 -3
  68. data/lib/facter/util/values.rb +67 -1
  69. data/lib/facter/util/virtual.rb +10 -10
  70. data/lib/facter/util/xendomains.rb +1 -1
  71. data/lib/facter/version.rb +42 -39
  72. data/lib/facter/virtual.rb +6 -7
  73. data/lib/facter/zfs_version.rb +3 -3
  74. data/lib/facter/zpool_version.rb +3 -3
  75. data/spec/fixtures/unit/netmask/darwin_10_8_5.txt +30 -0
  76. data/spec/unit/application_spec.rb +46 -1
  77. data/spec/unit/core/aggregate_spec.rb +125 -0
  78. data/spec/unit/core/directed_graph_spec.rb +79 -0
  79. data/spec/unit/core/execution/base_spec.rb +119 -0
  80. data/spec/unit/core/execution/posix_spec.rb +86 -0
  81. data/spec/unit/core/execution/windows_spec.rb +106 -0
  82. data/spec/unit/core/execution_spec.rb +37 -0
  83. data/spec/unit/core/logging_spec.rb +104 -0
  84. data/spec/unit/core/resolvable_spec.rb +81 -0
  85. data/spec/unit/core/suitable_spec.rb +96 -0
  86. data/spec/unit/domain_spec.rb +5 -5
  87. data/spec/unit/facter_spec.rb +61 -222
  88. data/spec/unit/filesystems_spec.rb +2 -2
  89. data/spec/unit/hardwareisa_spec.rb +5 -5
  90. data/spec/unit/hardwaremodel_spec.rb +1 -1
  91. data/spec/unit/hostname_spec.rb +4 -4
  92. data/spec/unit/id_spec.rb +3 -3
  93. data/spec/unit/interfaces_spec.rb +10 -0
  94. data/spec/unit/ipaddress6_spec.rb +4 -4
  95. data/spec/unit/ipaddress_spec.rb +1 -1
  96. data/spec/unit/kernel_spec.rb +2 -2
  97. data/spec/unit/kernelmajversion_spec.rb +1 -1
  98. data/spec/unit/kernelrelease_spec.rb +4 -4
  99. data/spec/unit/kernelversion_spec.rb +2 -2
  100. data/spec/unit/ldom_spec.rb +2 -2
  101. data/spec/unit/lsbdistcodename_spec.rb +2 -2
  102. data/spec/unit/lsbdistdescription_spec.rb +2 -2
  103. data/spec/unit/lsbdistid_spec.rb +2 -2
  104. data/spec/unit/lsbdistrelease_spec.rb +2 -2
  105. data/spec/unit/lsbrelease_spec.rb +2 -2
  106. data/spec/unit/manufacturer_spec.rb +1 -1
  107. data/spec/unit/memory_spec.rb +24 -31
  108. data/spec/unit/netmask_spec.rb +9 -0
  109. data/spec/unit/operatingsystem_spec.rb +1 -1
  110. data/spec/unit/operatingsystemrelease_spec.rb +62 -4
  111. data/spec/unit/physicalprocessorcount_spec.rb +10 -10
  112. data/spec/unit/processor_spec.rb +11 -11
  113. data/spec/unit/selinux_spec.rb +2 -8
  114. data/spec/unit/ssh_spec.rb +3 -2
  115. data/spec/unit/uniqueid_spec.rb +3 -3
  116. data/spec/unit/util/collection_spec.rb +37 -35
  117. data/spec/unit/util/config_spec.rb +20 -0
  118. data/spec/unit/util/confine_spec.rb +21 -0
  119. data/spec/unit/util/directory_loader_spec.rb +1 -0
  120. data/spec/unit/util/ec2_spec.rb +6 -6
  121. data/spec/unit/util/fact_spec.rb +92 -90
  122. data/spec/unit/util/ip_spec.rb +2 -2
  123. data/spec/unit/util/loader_spec.rb +127 -186
  124. data/spec/unit/util/macaddress_spec.rb +2 -2
  125. data/spec/unit/util/macosx_spec.rb +8 -8
  126. data/spec/unit/util/manufacturer_spec.rb +3 -3
  127. data/spec/unit/util/normalization_spec.rb +113 -0
  128. data/spec/unit/util/parser_spec.rb +25 -3
  129. data/spec/unit/util/processor_spec.rb +2 -2
  130. data/spec/unit/util/resolution_spec.rb +60 -631
  131. data/spec/unit/util/solaris_zones_spec.rb +5 -5
  132. data/spec/unit/util/uptime_spec.rb +1 -1
  133. data/spec/unit/util/values_spec.rb +131 -0
  134. data/spec/unit/util/virtual_spec.rb +16 -16
  135. data/spec/unit/util/xendomains_spec.rb +2 -2
  136. data/spec/unit/virtual_spec.rb +39 -39
  137. data/spec/unit/zfs_version_spec.rb +11 -11
  138. data/spec/unit/zonename_spec.rb +2 -2
  139. data/spec/unit/zones_spec.rb +1 -1
  140. data/spec/unit/zpool_version_spec.rb +11 -11
  141. metadata +466 -447
  142. data/lib/facter/util/cfpropertylist.rb +0 -6
  143. data/lib/facter/util/cfpropertylist/LICENSE +0 -19
  144. data/lib/facter/util/cfpropertylist/README +0 -44
  145. data/lib/facter/util/cfpropertylist/Rakefile +0 -44
  146. data/lib/facter/util/cfpropertylist/THANKS +0 -7
  147. data/lib/facter/util/cfpropertylist/lib/cfpropertylist.rb +0 -6
  148. data/lib/facter/util/cfpropertylist/lib/rbBinaryCFPropertyList.rb +0 -562
  149. data/lib/facter/util/cfpropertylist/lib/rbCFPlistError.rb +0 -26
  150. data/lib/facter/util/cfpropertylist/lib/rbCFPropertyList.rb +0 -407
  151. data/lib/facter/util/cfpropertylist/lib/rbCFTypes.rb +0 -244
  152. data/lib/facter/util/cfpropertylist/lib/rbLibXMLParser.rb +0 -135
  153. data/lib/facter/util/cfpropertylist/lib/rbNokogiriParser.rb +0 -140
  154. data/lib/facter/util/cfpropertylist/lib/rbREXMLParser.rb +0 -136
  155. data/spec/unit/util/monkey_patches_spec.rb +0 -42
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3d91c7a71d4cc61bb1f50ab005c54eb09b938691
4
+ data.tar.gz: 624a61aa2493e96ffa71b8a0b9a0c258eec84d49
5
+ SHA512:
6
+ metadata.gz: 0364c8c7f7238493331a2e33ba53e6104dcba79a1c8f63f83b76714c86bc67a82e5ac5bfe651f767ee553d96366be8684beb8e4055de43d6e661a5f3e20878ba
7
+ data.tar.gz: 0261cc7fe89129ccde61c5b42eaac43f74e3532c5f761d0ebb88f0305b4e838d0a069dba636c39651a34e7d7f5442128024f1ef6b04ae2cce91c5dfeee7d65ab
@@ -0,0 +1,194 @@
1
+ Committing changes to Facter
2
+ ====
3
+
4
+ We would like to make it easier for community members to contribute to facter
5
+ using pull requests, even if it makes the task of reviewing and committing
6
+ these changes a little harder. Pull requests are only ever based on a single
7
+ branch, however, we maintain more than one active branch. As a result
8
+ contributors should target their changes at the facter-2 branch. This makes the
9
+ process of contributing a little easier for the contributor since they don't
10
+ need to concern themselves with the question, "What branch do I base my changes
11
+ on?" This is already called out in the [CONTRIBUTING.md](http://goo.gl/XRH2J).
12
+
13
+ Therefore, it is the responsibility of the committer to re-base the change set
14
+ on the appropriate branch which should receive the contribution.
15
+
16
+ The rest of this document addresses the concerns of the committer. This
17
+ document will help guide the committer decide which branch to base, or re-base
18
+ a contribution on top of. This document also describes our branch management
19
+ strategy, which is closely related to the decision of what branch to commit
20
+ changes into.
21
+
22
+ Terminology
23
+ ====
24
+
25
+ Many of these terms have more than one meaning. For the purposes of this
26
+ document, the following terms refer to specific things.
27
+
28
+ **contributor** - A person who makes a change to facter and submits a change
29
+ set in the form of a pull request.
30
+
31
+ **change set** - A set of discrete patches which combined together form a
32
+ contribution. A change set takes the form of Git commits and is submitted to
33
+ facter in the form of a pull request.
34
+
35
+ **committer** - A person responsible for reviewing a pull request and then
36
+ making the decision what base branch to merge the change set into.
37
+
38
+ **base branch** - A branch in Git that contains an active history of changes
39
+ and will eventually be released using semantic version guidelines. The branch
40
+ named master will always exist as a base branch.
41
+
42
+ Committer Guide
43
+ ====
44
+
45
+ This section provides a guide to follow while committing change sets to facter
46
+ base branches.
47
+
48
+ How to decide what release(s) should be patched
49
+ ---
50
+
51
+ This section provides a guide to help a committer decide the specific base
52
+ branch that a change set should be merged into.
53
+
54
+ The latest minor release of a major release is the only base branch that should
55
+ be patched. Older minor releases in a major release do not get patched. Before
56
+ the switch to [semantic versions](http://semver.org/) committers did not have
57
+ to think about the difference between minor and major releases. Committing to
58
+ the latest minor release of a major release is a policy intended to limit the
59
+ number of active base branches that must be managed.
60
+
61
+ Security patches are handled as a special case. Security patches may be
62
+ applied to earlier minor releases of a major release.
63
+
64
+ How to commit a change set to multiple base branches
65
+ ---
66
+
67
+ A change set may apply to multiple releases. In this situation the change set
68
+ needs to be committed to multiple base branches. This section provides a guide
69
+ for how to merge patches across releases, e.g. 2.7 is patched, how should the
70
+ changes be applied to 3.0?
71
+
72
+ First, merge the change set into the lowest numbered base branch, e.g. 2.7.
73
+ Next, merge the changed base branch up through all later base branches by using
74
+ the `--no-ff --log` git merge options. We commonly refer to this as our "merge
75
+ up process" because we merge in once, then merge up multiple times.
76
+
77
+ When a new minor release branch is created (e.g. 3.1.x) then the previous one
78
+ is deleted (e.g. 3.0.x). Any security or urgent fixes that might have to be
79
+ applied to the older code line is done by creating an ad-hoc branch from the
80
+ tag of the last patch release of the old minor line.
81
+
82
+ Code review checklist
83
+ ---
84
+
85
+ This section aims to provide a checklist of things to look for when reviewing a
86
+ pull request and determining if the change set should be merged into a base
87
+ branch:
88
+
89
+ * All tests pass
90
+ * Are there any platform gotchas? (Does a change make an assumption about
91
+ platform specific behavior that is incompatible with other platforms? e.g.
92
+ Windows paths vs. POSIX paths.)
93
+ * Is the change backwards compatible? (It should be)
94
+ * Are there YARD docs for API changes?
95
+ * Does the change set also require documentation changes? If so is the
96
+ documentation being kept up to date?
97
+ * Does the change set include clean code? (software code that is formatted
98
+ correctly and in an organized manner so that another coder can easily read
99
+ or modify it.) HINT: `git diff --check`
100
+ * Does the change set conform to the contributing guide?
101
+
102
+
103
+ Commit citizen guidelines:
104
+ ---
105
+
106
+ This section aims to provide guidelines for being a good commit citizen by
107
+ paying attention to our automated build tools.
108
+
109
+ * Don’t push on a broken build. (A broken build is defined as a failing job
110
+ in the [Facter](https://jenkins.puppetlabs.com/view/Facter/)
111
+ page.)
112
+ * Watch the build until your changes have gone through green
113
+ * Update the ticket status and target version. The target version field in
114
+ our issue tracker should be updated to be the next release of facter. For
115
+ example, if the most recent release of facter is 2.0.1 and you merge a
116
+ backwards compatible change set into facter-2, then the target version should
117
+ be 2.1.0 in the issue tracker.)
118
+ * Ensure the pull request is closed (Hint: amend your merge commit to contain
119
+ the string `closes #123` where 123 is the pull request number.
120
+
121
+ Example Procedure
122
+ ====
123
+
124
+ This section helps a committer rebase a contribution onto an earlier base
125
+ branch, then merge into the base branch and up through all active base
126
+ branches.
127
+
128
+ Suppose a contributor submits a pull request based on facter-2. The change set
129
+ fixes a bug reported against facter 2.0.1 which is the most recently released
130
+ version of facter.
131
+
132
+ In this example the committer should rebase the change set onto the stable
133
+ branch since this is a bug rather than new functionality.
134
+
135
+ First, the committer pulls down the branch using the `hub` gem. This tool
136
+ automates the process of adding the remote repository and creating a local
137
+ branch to track the remote branch.
138
+
139
+ $ hub checkout https://github.com/puppetlabs/facter/pull/1234
140
+ Branch jeffmccune-fix_foo_error set up to track remote branch fix_foo_error from jeffmccune.
141
+ Switched to a new branch 'jeffmccune-fix_foo_error'
142
+
143
+ At this point the topic branch is a descendant of facter-2, but we want it to
144
+ descend from stable. The committer creates a new branch then re-bases the
145
+ change set:
146
+
147
+ $ git branch bug/stable/fix_foo_error
148
+ $ git rebase --onto stable master bug/stable/fix_foo_error
149
+ First, rewinding head to replay your work on top of it...
150
+ Applying: (#23456) Fix FooError that always bites users in 2.0.1
151
+
152
+ The `git rebase` command may be interpreted as, "First, check out the branch
153
+ named `bug/stable/fix_foo_error`, then take the changes that were previously
154
+ based on `facter-2` and re-base them onto `stable`.
155
+
156
+ Now that we have a topic branch containing the change set based on the correct
157
+ release branch, the committer merges in:
158
+
159
+ $ git checkout stable
160
+ Switched to branch 'stable'
161
+ $ git merge --no-ff --log bug/stable/fix_foo_error
162
+ Merge made by the 'recursive' strategy.
163
+ foo | 0
164
+ 1 file changed, 0 insertions(+), 0 deletions(-)
165
+ create mode 100644 foo
166
+
167
+ Once merged into the first base branch, the committer merges up to facter-2:
168
+
169
+ $ git checkout facter-2
170
+ Switched to branch 'facter-2'
171
+ $ git merge --no-ff --log stable
172
+ Merge made by the 'recursive' strategy.
173
+ foo | 0
174
+ 1 file changed, 0 insertions(+), 0 deletions(-)
175
+ create mode 100644 foo
176
+
177
+ And then merges up to master:
178
+
179
+ $ git checkout master
180
+ Switched to branch 'master'
181
+ $ git merge --no-ff --log stable
182
+ Merge made by the 'recursive' strategy.
183
+ foo | 0
184
+ 1 file changed, 0 insertions(+), 0 deletions(-)
185
+ create mode 100644 foo
186
+
187
+ Once the change set has been merged "in and up." the committer pushes. (Note,
188
+ the checklist should be complete at this point.) Note that the stable,
189
+ facter-2 and master branches are being pushed at the same time.
190
+
191
+ $ git push puppetlabs master:master facter-2:facter-2 stable:stable
192
+
193
+ That's it! The committer then updates the pull request, updates the issue in
194
+ our issue tracker, and keeps an eye on the build status.
@@ -1,237 +1,65 @@
1
- Checklist/Outline (The short version)
2
- =================================================
3
-
4
- * Getting Started:
5
- - Make sure you have a [Redmine account](http://projects.puppetlabs.com)
6
- - Submit a ticket for your issue, assuming one does not already exist.
7
- - Decide what to base your work off of
8
- * `1.6.x`: bug fixes only
9
- * `2.x`: new features that are not breaking changes
10
- * `master`: new features that are breaking changes
11
-
12
- * Making Changes:
13
- - Make sure you have a [GitHub account](https://github.com/signup/free)
14
- - Fork the repository on GitHub
15
- - Make commits of logical units.
16
- - Check for unnecessary whitespace with "git diff --check" before committing.
17
- - Make sure your commit messages are in the proper format
18
- - Make sure you have added the necessary tests for your changes
19
- - Run _all_ the tests to assure nothing else was accidentally broken
20
-
21
- * Submitting Changes:
22
- - Sign the [Contributor License Agreement](https://projects.puppetlabs.com/contributor_licenses/sign)
23
- - Push your changes to a topic branch in your fork of the repository.
24
- - Submit a pull request to the repository in the puppetlabs organization.
25
- - Update your Redmine ticket
26
-
27
- The long version
28
- ================
29
-
30
- 0. Create a Redmine ticket for the change you'd like to make.
31
-
32
- It's very important that there be a Redmine ticket for the change
33
- you are making. Considering the number of contributions which are
34
- submitted, it is crucial that we know we can find the ticket on Redmine.
35
-
36
- Before making a ticket however, be sure that one does not already exist.
37
- You can do this by searching Redmine or by trying a Google search which
38
- includes `sites:projects.puppetlabs.com` in addition to some of the keywords
39
- related to your issue.
40
-
41
- If you do not find a ticket that that accurately describes the work
42
- you're going to be doing, go ahead and create one. But be sure to
43
- look for related tickets and add them to the 'related tickets' section.
44
-
45
- 1. Decide what to base your work on.
46
-
47
- In general, you should always base your work on the oldest
48
- branch that your change is relevant to, and it will be
49
- eventually merged up. Currently, branches will be merged up as
50
- follows:
51
- 1.6.x => 2.x => master
52
-
53
- Currently, this is how you should decide where to target your changes:
54
-
55
- A bug fix should be based off the the earliest place where it is
56
- relevant. If it first appears in `1.6.x`, then it should be
57
- targeted here and eventually merged up to `2.x` and master.
58
-
59
- New features which are _backwards compatible_ should be targeted
60
- at the next release, which currently is `2.x`.
61
-
62
- New features that are _breaking changes_ should be targeted at
63
- `master`.
64
-
65
- Part of deciding what to what your work should be based off of includes naming
66
- your topic branch to reflect this. Your branch name should have the following
67
- format:
68
- `ticket/target_branch/ticket_number_short_description_of_issuee`
69
-
70
- For example, if you are fixing a bug relating to a hostname problem on aix,
71
- which has Redmine ticket number 12345, then your branch should be named:
72
- `ticket/2.x/12345_fix_hostname_on_aix`
73
-
74
- There is a good chance that if you submit a pull request _from_ master _to_ master,
75
- Puppet Labs developers will suspect that you're not sure about the process. This is
76
- why clear naming of branches and basing your work off the right place will be
77
- extremely helpful in ensuring that your submission is reviewed and merged. Often times
78
- if your change is targeted at the wrong place, we will bounce it back to you and wait
79
- to review it until it has been retargeted.
80
-
81
- 2. Make separate commits for logically separate changes.
82
-
83
- Please break your commits down into logically consistent units
84
- which include new or changed tests relevent to the rest of the
85
- change. The goal of doing this is to make the diff easier to
86
- read for whoever is reviewing your code. In general, the easier
87
- your diff is to read, the more likely someone will be happy to
88
- review it and get it into the code base.
89
-
90
- If you're going to refactor a piece of code, please do so as a
91
- separate commit from your feature or bug fix changes.
92
-
93
- It's crucial that your changes include tests to make
94
- sure the bug isn't re-introduced, and that the feature isn't
95
- accidentally broken.
96
-
97
- Describe the technical detail of the change(s). If your
98
- description starts to get too long, that's a good sign that you
99
- probably need to split up your commit into more finely grained
100
- pieces.
101
-
102
- Commits which plainly describe the the things which help
103
- reviewers check the patch and future developers understand the
104
- code are much more likely to be merged in with a minimum of
105
- bike-shedding or requested changes. Ideally, the commit message
106
- would include information, and be in a form suitable for
107
- inclusion in the release notes for the version of Facter that
108
- includes them.
109
-
110
- Please also check that you are not introducing any trailing
111
- whitespaces or other "whitespace errors". You can do this by
112
- running "git diff --check" on your changes before you commit.
113
-
114
- When writing commit messages, please be sure they meet
115
- [these standards](https://github.com/erlang/otp/wiki/Writing-good-commit-messages), and please include the ticket number in your
116
- short summary. It should look something like this: `(#12345) Fix this issue in Facter`
117
-
118
- 3. Sign the Contributor License Agreement
119
-
120
- Before we can accept your changes, we do need a signed Puppet
121
- Labs Contributor License Agreement (CLA).
122
-
123
- You can access the CLA via the
124
- [Contributor License Agreement link](https://projects.puppetlabs.com/contributor_licenses/sign)
125
- in the top menu bar of our Redmine instance. Once you've signed
126
- the CLA, a badge will show up next to your name on the
127
- [Puppet Project Overview Page](http://projects.puppetlabs.com/projects/puppet?jump=welcome),
128
- and your name will be listed under "Contributor License Signers"
129
- section.
130
-
131
- If you have any questions about the CLA, please feel free to
132
- contact Puppet Labs via email at cla-submissions@puppetlabs.com.
133
-
134
- 4. Sending your patches
135
-
136
- To submit your changes via a GitHub pull request, you must
137
- have them on a topic branch, instead of directly on "master"
138
- or one of the release, or RC branches. It makes things much easier
139
- to keep track of, especially if you decide to work on another thing
140
- before your first change is merged in.
141
-
142
- GitHub has some pretty good
143
- [general documentation](http://help.github.com/) on using
144
- their site. They also have documentation on
145
- [creating pull requests](http://help.github.com/send-pull-requests/).
146
-
147
- In general, after pushing your topic branch up to your
148
- repository on GitHub, you'll switch to the branch in the
149
- GitHub UI and click "Pull Request" towards the top of the page
150
- in order to open a pull request.
151
-
152
- You'll want to make sure that you have the appropriate
153
- destination branch in the repository under the puppetlabs
154
- organization. This should be the same branch that you based
155
- your changes off of.
156
-
157
- 5. Update the related Redmine ticket.
158
-
159
- You should update the Redmine ticket associated
160
- with the change you submitted to include the location of your branch
161
- on the `branch` field of the ticket, and change the status to
162
- "In Topic Branch Pending Review", along with any other commentary
163
- you may wish to make.
164
-
165
- How to track the status of your change after it's been submitted
166
- ================================================================
167
-
168
- Shortly after opening a pull request, there should be an automatic
169
- email sent via GitHub. This notification is used to let the Puppet
170
- development community know about your requested change to give them a
171
- chance to review, test, and comment on the change(s).
172
-
173
- We do our best to comment on or merge submitted changes within a about week.
174
- However, if there hasn't been any commentary on the pull request or
175
- mailed patches, and it hasn't been merged in after a week, then feel
176
- free to ask for an update by replying on the mailing list to the
177
- automatic notification or mailed patches. It probably wasn't
178
- intentional, and probably just slipped through the cracks.
179
-
180
- Additional Resources
181
- ====================
182
-
183
- * [Getting additional help](http://projects.puppetlabs.com/projects/puppet/wiki/Getting_Help)
184
-
185
- * [Writing tests](http://projects.puppetlabs.com/projects/puppet/wiki/Development_Writing_Tests)
186
-
187
- * [Bug tracker (Redmine)](http://projects.puppetlabs.com)
188
-
189
- * [Contributor License Agreement](https://projects.puppetlabs.com/contributor_licenses/sign)
190
-
1
+ # How to contribute
2
+
3
+ Third-party patches are essential for keeping facter great. We simply can't
4
+ access the huge number of platforms and myriad configurations for running
5
+ facter. We want to keep it as easy as possible to contribute changes that
6
+ get things working in your environment. There are a few guidelines that we
7
+ need contributors to follow so that we can have a chance of keeping on
8
+ top of things.
9
+
10
+ ## Getting Started
11
+
12
+ * Make sure you have a [Jira account](http://tickets.puppetlabs.com)
13
+ * Make sure you have a [GitHub account](https://github.com/signup/free)
14
+ * Submit a ticket for your issue, assuming one does not already exist.
15
+ * Clearly describe the issue including steps to reproduce when it is a bug.
16
+ * Make sure you fill in the earliest version that you know has the issue.
17
+ * Fork the repository on GitHub
18
+
19
+ ## Making Changes
20
+
21
+ * Create a topic branch from where you want to base your work.
22
+ * This is usually the facter-2 branch.
23
+ * Only target release branches if you are certain your fix must be on that
24
+ branch.
25
+ * To quickly create a topic branch based on facter-2; `git branch
26
+ fix/facter-2/my_contribution facter-2` then checkout the new branch with `git
27
+ checkout fix/facter-2/my_contribution`. Please avoid working directly on the
28
+ `facter-2` branch.
29
+ * Make commits of logical units.
30
+ * Check for unnecessary whitespace with `git diff --check` before committing.
31
+ * Make sure your commit messages are in the proper format.
32
+
33
+ ````
34
+ (#99999) Make the example in CONTRIBUTING imperative and concrete
35
+
36
+ Without this patch applied the example commit message in the CONTRIBUTING
37
+ document is not a concrete example. This is a problem because the
38
+ contributor is left to imagine what the commit message should look like
39
+ based on a description rather than an example. This patch fixes the
40
+ problem by making the example concrete and imperative.
41
+
42
+ The first line is a real life imperative statement with a ticket number
43
+ from our issue tracker. The body describes the behavior without the patch,
44
+ why this is a problem, and how the patch fixes the problem when applied.
45
+ ````
46
+
47
+ * Make sure you have added the necessary tests for your changes.
48
+ * Run _all_ the tests to assure nothing else was accidentally broken.
49
+
50
+ ## Submitting Changes
51
+
52
+ * Sign the [Contributor License Agreement](http://links.puppetlabs.com/cla).
53
+ * Push your changes to a topic branch in your fork of the repository.
54
+ * Submit a pull request to the repository in the puppetlabs organization.
55
+ * Update your ticket to mark that you have submitted code and are ready for it to be reviewed.
56
+ * Include a link to the pull request in the ticket
57
+
58
+ # Additional Resources
59
+
60
+ * [More information on contributing](http://links.puppetlabs.com/contribute-to-puppet)
61
+ * [Bug tracker (Jira)](http://tickets.puppetlabs.com)
62
+ * [Contributor License Agreement](http://links.puppetlabs.com/cla)
191
63
  * [General GitHub documentation](http://help.github.com/)
192
-
193
64
  * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
194
-
195
- If you have commit access to the repository
196
- ===========================================
197
-
198
- Even if you have commit access to the repository, you'll still need to
199
- go through the process above, and have someone else review and merge
200
- in your changes. The rule is that all changes must be reviewed by a
201
- developer on the project (that didn't write the code) to ensure that
202
- all changes go through a code review process.
203
-
204
- Having someone other than the author of the topic branch recorded as
205
- performing the merge is the record that they performed the code
206
- review.
207
-
208
- * Merging topic branches
209
-
210
- When merging code from a topic branch into the integration branch
211
- (Ex: master, 2.7.x, 1.6.x, etc.), there should always be a merge
212
- commit. You can accomplish this by always providing the `--no-ff`
213
- flag to `git merge`.
214
-
215
- git merge --no-ff --log tickets/master/1234-fix-something-broken
216
-
217
- The reason for always forcing this merge commit is that it
218
- provides a consistent way to look up what changes & commits were
219
- in a topic branch, whether that topic branch had one, or 500
220
- commits. For example, if the merge commit had an abbreviated
221
- SHA-1 of `coffeebad`, then you could use the following `git log`
222
- invocation to show you which commits it brought in:
223
-
224
- git log coffeebad^1..coffeebad^2
225
-
226
- The following would show you which changes were made on the topic
227
- branch:
228
-
229
- git diff coffeebad^1...coffeebad^2
230
-
231
- Because we _always_ merge the topic branch into the integration
232
- branch the first parent (`^1`) of a merge commit will be the most
233
- recent commit on the integration branch from just before we merged
234
- in the topic, and the second parent (`^2`) will always be the most
235
- recent commit that was made in the topic branch. This also serves
236
- as the record of who performed the code review, as mentioned
237
- above.
65
+ * #puppet-dev IRC channel on freenode.org