Skip to content

Commit b67d49e

Browse files
Merge pull request #20 from OpenVoxProject/openfact
Rename to OpenFact
2 parents fbb9b2e + ae79ca0 commit b67d49e

File tree

11 files changed

+162
-233
lines changed

11 files changed

+162
-233
lines changed

.github/workflows/gem_release.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Gem Release
3+
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
release:
11+
name: Release gem
12+
runs-on: ubuntu-24.04
13+
# Optional but recommended to use a specific environment
14+
environment: release
15+
# Prevent releases from forked repositories
16+
if: github.repository_owner == 'OpenVoxProject'
17+
18+
permissions:
19+
id-token: write
20+
contents: write
21+
packages: write
22+
23+
steps:
24+
- uses: voxpupuli/ruby-release@v0
25+
- name: Setup GitHub packages access
26+
run: |
27+
mkdir -p ~/.gem
28+
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
29+
chmod 0600 ~/.gem/credentials
30+
- name: Publish gem to GitHub packages
31+
run: gem push --key github --host https://rubygems.pkg.github.com/openvoxproject *.gem
32+
- name: Create Release Page
33+
shell: bash
34+
env:
35+
GH_TOKEN: ${{ github.token }}
36+
run: gh release create ${{ github.ref_name }} --generate-notes
37+
- name: Attach gem to GitHub Release
38+
shell: bash
39+
env:
40+
GH_TOKEN: ${{ github.token }}
41+
run: gh release upload ${{ github.ref_name }} *.gem
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: 'Prepare Release'
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to be released.'
8+
required: false
9+
default: ''
10+
type: string
11+
base-branch:
12+
description: 'The branch that will be used as the origin for the release branch.'
13+
required: false
14+
default: ''
15+
type: string
16+
17+
permissions: {}
18+
19+
jobs:
20+
prepare_release:
21+
uses: OpenVoxProject/shared-actions/.github/workflows/prepare_release.yml@main
22+
with:
23+
allowed_owner: 'OpenVoxProject'
24+
base-branch: ${{ github.event.inputs.base-branch }}
25+
version: ${{ github.event.inputs.version }}
26+
secrets:
27+
github_pat: ${{ secrets.OPENVOXBOT_COMMIT_AND_PRS }}
28+
ssh_private_key: ${{ secrets.OPENVOXBOT_SSH_PRIVATE_KEY }}

.github/workflows/release.yml

Lines changed: 23 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,28 @@
1-
---
2-
name: Gem Release
1+
name: 'Release'
32

43
on:
5-
push:
6-
tags:
7-
- '*'
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to be released.'
8+
required: false
9+
default: ''
10+
type: string
11+
base-branch:
12+
description: 'The branch where we do this release.'
13+
required: false
14+
default: ''
15+
type: string
16+
17+
permissions: {}
818

919
jobs:
1020
release:
11-
name: Release gem
12-
runs-on: ubuntu-24.04
13-
# Optional but recommended to use a specific environment
14-
environment: release
15-
# Prevent releases from forked repositories
16-
if: github.repository_owner == 'OpenVoxProject'
17-
18-
permissions:
19-
id-token: write
20-
contents: write
21-
packages: write
22-
23-
steps:
24-
# we cannot publish to rubygems.org until we rename the project
25-
# https://rubygems.org/gems/vanagon owned by Perforce
26-
# - uses: voxpupuli/ruby-release@v0
27-
- uses: actions/checkout@v4
28-
with:
29-
fetch-depth: 0
30-
- name: Install Ruby
31-
uses: ruby/setup-ruby@v1
32-
with:
33-
ruby-version: '3.4'
34-
env:
35-
BUNDLE_WITHOUT: integration:documentation:development:test
36-
- name: Build gem
37-
run: gem build --strict --verbose *.gemspec
38-
- name: Setup GitHub packages access
39-
run: |
40-
mkdir -p ~/.gem
41-
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
42-
chmod 0600 ~/.gem/credentials
43-
- name: Publish gem to GitHub packages
44-
run: gem push --key github --host https://rubygems.pkg.github.com/openvoxproject *.gem
45-
- name: Create Release Page
46-
shell: bash
47-
env:
48-
GH_TOKEN: ${{ github.token }}
49-
run: gh release create ${{ github.ref_name }} --generate-notes
21+
uses: OpenVoxProject/shared-actions/.github/workflows/release.yml@main
22+
with:
23+
allowed_owner: 'OpenVoxProject'
24+
base-branch: ${{ github.event.inputs.base-branch }}
25+
version: ${{ github.event.inputs.version }}
26+
secrets:
27+
github_pat: ${{ secrets.OPENVOXBOT_COMMIT_AND_PRS }}
28+
ssh_private_key: ${{ secrets.OPENVOXBOT_SSH_PRIVATE_KEY }}

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
44

5-
gemspec name: 'facter'
5+
gemspec
66

77
group(:release, optional: true) do
8-
gem 'octokit', '~> 4.18.0'
8+
gem 'github_changelog_generator'
99
end
1010

1111
gem 'packaging', require: false

CHANGELOG.md renamed to HISTORY.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## Facter release notes are now provided as part of the [official Puppet documentation](https://puppet.com/docs/puppet/7/release_notes_facter.html) and are no longer tracked in this file.
1+
## 4.10.0
2+
3+
After 4.0.44, Facter release notes were provided as part of the [official Puppet documentation](https://puppet.com/docs/puppet/7/release_notes_facter.html) and were not tracked in this file.
24

35
# Previous versions
46

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
# facter
1+
# openfact
22

3-
[![Gem Version](https://badge.fury.io/rb/facter.svg)](https://badge.fury.io/rb/facter)
4-
[<img src="https://img.shields.io/badge/slack-puppet--dev-brightgreen?logo=slack">](https://puppetcommunity.slack.com/messages/C0W1X7ZAL)
3+
[![Gem Version](https://badge.fury.io/rb/openfact.svg)](https://badge.fury.io/rb/openfact)
54

6-
[![Modules Status](https://github.com/puppetlabs/facter/workflows/Acceptance%20tests/badge.svg?branch=main)](https://github.com/puppetlabs/facter/actions)
7-
[![Modules Status](https://github.com/puppetlabs/facter/workflows/Unit%20tests/badge.svg?branch=main)](https://github.com/puppetlabs/facter/actions)
8-
[![Modules Status](https://github.com/puppetlabs/facter/workflows/Checks/badge.svg?branch=main)](https://github.com/puppetlabs/facter/actions)
9-
10-
Facter is a command-line tool that gathers basic facts about nodes (systems)
5+
OpenFact is a community implementation of [Facter](https://github.com/puppetlabs/facter/), a command-line tool that gathers basic facts about nodes (systems)
116
such as hardware details, network settings, OS type and version, and more.
127
These facts are made available as variables in your Puppet manifests and can be
138
used to inform conditional expressions in Puppet.
@@ -17,6 +12,10 @@ used to inform conditional expressions in Puppet.
1712
Documentation for the Facter project can be found on the [Puppet Docs
1813
site](https://puppet.com/docs/puppet/latest/facter.html).
1914

15+
At the time of writing, the OpenVoxProject does not have a documentation website.
16+
But your help is very welcome!
17+
Reach out to the [Documentation Special Interest Group](https://github.com/voxpupuli/community-triage/wiki/SIG.Documentation) if you want to help.
18+
2019
## Supported platforms
2120
* Linux
2221
* macOS
@@ -32,7 +31,7 @@ site](https://puppet.com/docs/puppet/latest/facter.html).
3231
The project has three main parts, the framework, facts and resolvers.
3332
In the framework we implement functionality that is agnostic of specific facts like parsing user input, formatting output, etc.
3433

35-
Facts are the nuggets of information that will be provided by facter e.g. `os.name`, `networking.interfaces`, etc.
34+
Facts are the nuggets of information that will be provided by openfact e.g. `os.name`, `networking.interfaces`, etc.
3635

3736
Resolvers have the role of gathering data from the system.
3837
For example a resolver can execute a command on the system, can read a file or any operation that retrieves some data from a single source on the system.
@@ -54,17 +53,14 @@ sequenceDiagram
5453
## Getting started
5554
After cloning the project, run `bundle install` to install all dependencies.
5655
57-
You can run facter by executing `./bin/facter`.
58-
The command will output all the facts that facter detected for the current OS.
56+
You can run openfact by executing `./bin/facter`.
57+
The command will output all the facts that openfact detected for the current OS.
5958
6059
The implementation can be validated locally by running `bundle exec rake check`.
6160
62-
## Goals - fast, easy, compatible
63-
* Gain performance similar to the C++ version of Facter. We plan to achieve this goal by gathering multiple facts with only one call and by using the faster Win32 API rather than WMI for the Windows implementation.
64-
* Facilitate community contribution. At the moment, C++ presents a possible impediment for community contributions.
65-
* Enable native integration with other Ruby-based projects such as Bolt and puppet.
66-
* Enable native integration for custom facts.
67-
* Provide 100% compatibility with C++ Facter (drop-in replacement).
68-
6961
## Licensing
70-
See [LICENSE](https://github.com/puppetlabs/facter/blob/main/LICENSE) file. Puppet is licensed by Puppet, Inc. under the Apache license. Puppet, Inc. can be contacted at: info@puppet.com
62+
See [LICENSE](LICENSE) file.
63+
OpenFact is licensed by the OpenVox Project as a community maintained implementation of Facter.
64+
The OpenVox Project can be contacted at: openvox@voxpupuli.org.
65+
Puppet itself is licensed by Puppet, Inc. under the Apache license.
66+
Puppet, Inc. can be contacted at: info@puppet.com.

Rakefile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,25 @@ Dir.glob(File.join('tasks/**/*.rake')).each { |file| load file }
99

1010
task default: :spec
1111

12-
desc 'Generate changelog'
13-
task :changelog, [:version] do |_t, args|
14-
sh "./scripts/generate_changelog.rb #{args[:version]}"
12+
begin
13+
require 'github_changelog_generator/task'
14+
require_relative 'lib/facter/version'
15+
16+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
17+
config.header = <<~HEADER.chomp
18+
# Changelog
19+
20+
All notable changes to this project will be documented in this file.
21+
HEADER
22+
config.user = 'openvoxproject'
23+
config.project = 'openfact'
24+
config.exclude_labels = %w[dependencies duplicate question invalid wontfix wont-fix modulesync skip-changelog]
25+
config.future_release = Facter::VERSION
26+
end
27+
rescue LoadError
28+
task :changelog do
29+
abort('Run `bundle install --with release` to install the `github_changelog_generator` gem.')
30+
end
1531
end
1632

1733
namespace :pl_ci do

facter.gemspec renamed to openfact.gemspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ lib = File.expand_path('lib', __dir__)
44
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
55

66
Gem::Specification.new do |spec|
7-
spec.name = 'facter'
7+
spec.name = 'openfact'
88
spec.version = '4.11.0'
9-
spec.authors = ['Puppet']
10-
spec.email = ['team-nw@puppet.com']
11-
spec.homepage = 'https://github.com/puppetlabs/facter'
9+
spec.authors = ['OpenVox Project']
10+
spec.email = ['openvox@voxpupuli.org']
11+
spec.homepage = 'https://github.com/OpenVoxProject/openfact/'
1212

13-
spec.summary = 'Facter, a system inventory tool'
13+
spec.summary = 'OpenFact, a system inventory tool'
1414
spec.description = 'You can prove anything with facts!'
1515
spec.license = 'Apache-2.0'
1616

0 commit comments

Comments
 (0)