Skip to content

Commit 6c58504

Browse files
committed
Bump version to v0.10.0.
1 parent 9dc6324 commit 6c58504

File tree

4 files changed

+156
-44
lines changed

4 files changed

+156
-44
lines changed

.github/release.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Release notes template (https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)
2+
3+
changelog:
4+
categories:
5+
- title: Breaking Changes 🚧
6+
labels:
7+
# Semver-Major
8+
- breaking change
9+
- title: New Features ✨
10+
labels:
11+
# Semver-Minor
12+
- enhancement
13+
- title: Bug Fixes 🐛
14+
labels:
15+
# Semver-Patch
16+
- bugfix
17+
- title: Other Changes 📦
18+
labels:
19+
- "*"
20+
exclude:
21+
labels:
22+
- chore
23+
- version bump

.github/workflows/publish-release.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Create release
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
run: |
20+
gh release create "${{ github.ref_name }}" \
21+
--repo="$GITHUB_REPOSITORY" \
22+
--title="${{ github.ref_name }}" \
23+
--generate-notes

README.md

+55-44
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,31 @@
33
# @title README.md
44
# @author Dan Thomas
55
-->
6-
# ResourceRegistry
7-
[![Build Status](https://travis-ci.com/ideacrew/resource_registry.svg?branch=master)](https://travis-ci.com/ideacrew/resource_registry)
6+
# ResourceRegistry
87

9-
ResourceRegistry is a library for system configuration, feature flipping and eventing. It offers an approach to custom configuration for a single codebase, supporting use cases such as:
8+
ResourceRegistry is a library for system configuration, feature flipping and eventing. It offers an approach to custom configuration for a single codebase, supporting use cases such as:
109

1110
* Customer-level preference profiles
1211
* Multitenancy
1312
* Access control based on privilidges and subscriptions
1413

15-
ResourceRegistry is intended to address 'logic sprawl' that can occur with minimally- or un-structured key/value system settings schemes. It offers an
16-
alternative to code obfuscation issues that often pops up when using Rails Concerns.
14+
ResourceRegistry is intended to address 'logic sprawl' that can occur with minimally- or un-structured key/value system settings schemes. It offers an alternative to code obfuscation issues that often pops up when using Rails Concerns.
15+
16+
**Table of Contents**
17+
1. [Gem Features](#gem-features)
18+
2. [Compatibility](#compatibility)
19+
3. [Installing on Rails](#installing-on-rails)
20+
4. [Feature](#feature)
21+
1. [Registering Features](#registering-features)
22+
2. [Detailed Example](#detailed-example)
23+
3. [Namepace](#namepace)
24+
5. [Rails Integration](#rails-integration)
25+
6. [Configuration](#configuration)
26+
7. [Development](#development)
27+
1. [Contributing](#contributing)
28+
2. [Future Features](#future-features)
29+
8. [License](#license)
30+
9. [Credits](#credits)
1731

1832
## Gem Features
1933

@@ -29,31 +43,36 @@
2943
* Ruby 2.6
3044
* Rails 5.2.4
3145

32-
### Installing on Rails
33-
34-
Add this line to your project's Gemfile:
46+
## Installing on Rails
3547

48+
Add this line to your project's Gemfile:
49+
```
3650
gem 'resource_registry'
51+
```
3752

38-
And then execute:
39-
53+
And then execute:
54+
```
4055
$ bundle
56+
```
4157

42-
Or install it yourself as:
43-
58+
Or install it yourself as:
59+
```
4460
$ gem install resource_registry
61+
```
4562

46-
In your project build the directory tree to house configuration files:
47-
63+
In your project build the directory tree to house configuration files:
64+
```
4865
$ mkdir -p ./system/boot && mkdir -p ./system/config
66+
```
4967

50-
Then, create Resource Registry's initializer file:
51-
68+
Then, create Resource Registry's initializer file:
69+
```
5270
$ touch ./config/initializers/resource_registry.rb
71+
```
5372

5473
## Feature
5574

56-
ResourceRegistry uses a Feature to group related system functions and settings. Featurse are composed of the following high level attributes:
75+
ResourceRegistry uses a Feature to group related system functions and settings. Features are composed of the following high level attributes:
5776

5877
* key [Symbol] 'key' of the Feature's key/value pair. This is the Feature's identifier and must be unique
5978
* item [Any] 'value' of the Feature's key/value pair. May be a static value, proc, class instance and may include an options hash
@@ -62,7 +81,7 @@
6281
* settings [Array<Hash>] a list of key/item pairs associated with the Feature
6382
* meta [Hash] a set of attributes to store configuration values and drive their presentation in User Interface
6483

65-
Here is an example Feature definition in YAML format. Note the settings ```effective_period``` value is an expression:
84+
Here is an example Feature definition in YAML format. Note the settings ```effective_period``` value is an expression:
6685

6786
``` ruby
6887
- namespace:
@@ -90,9 +109,9 @@
90109
item: :initial_sponsor_jan_default
91110
```
92111
93-
### Registering Features
112+
### Registering Features
94113
95-
Features are most useful when they're loaded into a registry for runtime access. For example:
114+
Features are most useful when they're loaded into a registry for runtime access. For example:
96115
97116
``` ruby
98117
require 'resource_registry'
@@ -150,9 +169,9 @@ my_registry[:greeter] {"Dolly"} # => "Hello Dolly"
150169

151170
### Namepace
152171

153-
Use the optional Feature#namespace attribute to organize Features. Namespaces support enable you to define a structure to group Features into a logical structure or taxonomy that can help with code clarity. For example:
172+
Use the optional Feature#namespace attribute to organize Features. Namespaces support enable you to define a structure to group Features into a logical structure or taxonomy that can help with code clarity. For example:
154173

155-
``` ruby
174+
```ruby
156175
my_species = ResourceRegistry::Feature.new( key: :species,
157176
item: :Operations::Species::Create.new,
158177
is_enabled: true,
@@ -164,7 +183,7 @@ Namespaced Features respect their anscesters with regard to code access. For in
164183

165184
For instance, extending the ```species``` Feature example above:
166185

167-
``` ruby
186+
```ruby
168187
my_phylum = ResourceRegistry::Feature.new(key: :phylum,
169188
item: :Operations::Phylum::Create.new,
170189
is_enabled: false,
@@ -178,43 +197,35 @@ Namespaces serve another purpose: enabling auto-generation of Admin UI configura
178197

179198
## Rails Integration
180199

181-
A registry is configured and loaded when your application starts.
200+
A registry is configured and loaded when your application starts.
182201

183202
## Configuration
184203

185-
The initializer and configuration files manage the setup and loading process.
204+
The initializer and configuration files manage the setup and loading process.
186205

187-
Configuration files are located in your project's ```system/config``` directory. All Yaml files in and below this directory are autoloaded during the boot process. Configuration settings may be organized into directories and files in any manner. Values will properly load into the container hierarchy provided the file begins with a reference to an identifiable parent key.
206+
Configuration files are located in your project's ```system/config``` directory. All Yaml files in and below this directory are autoloaded during the boot process. Configuration settings may be organized into directories and files in any manner. Values will properly load into the container hierarchy provided the file begins with a reference to an identifiable parent key.
188207

189-
An example of a simple configuration file:
190-
```ruby
191-
# ./system/config/enterprise.yml
208+
## Development
192209

193-
```
210+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
194211

195-
## Defining Configuration Settings
212+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
196213

197-
### UI-ready configuration settings
214+
### Contributing
198215

199-
## Credits
200-
Based on [dry-system](https://dry-rb.org/gems/dry-system/) and [dry-validation](https://dry-rb.org/gems/dry-validation/1.0/) ```
216+
Bug reports and pull requests are welcome on GitHub at https://github.com/ideacrew/resource_registry.
201217

202-
## Future Features
218+
### Future Features
203219

204220
* Taxonomy: support namespace structures and validations
205221
* Subscription
206222
* Bootable infrastructure components
207223

208-
## Development
209-
210-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
211-
212-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
224+
## License
213225

214-
## Contributing
226+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
215227

216-
Bug reports and pull requests are welcome on GitHub at https://github.com/ideacrew/resource_registry.
217228

218-
## License
229+
## Credits
219230

220-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
231+
Based on [dry-system](https://dry-rb.org/gems/dry-system/) and [dry-validation](https://dry-rb.org/gems/dry-validation/1.0/)

RELEASING.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Release
2+
3+
This file describes the process for publishing a new version of the gem as a GitHub release.
4+
5+
Releases are managed through the [GitHub Releases](https://github.com/dchbx/resource_registry/releases) page.
6+
7+
Release names follow the [Semantic Versioning](https://semver.org/) standard.
8+
9+
Follow the steps below to package and release a new version of the gem.
10+
11+
## Major/Minor release
12+
### Prepare the release
13+
1. Checkout the main branch and pull the latest changes.
14+
2. Create and checkout a branch - avoid naming the branch solely after proposed release number - something like 'rm12313453_v1.0.0._update_gemspec' might be ideal.
15+
3. Update the version number in the `lib/<project>/version.rb` file. Note the [correct format](https://guides.rubygems.org/specification-reference/#version); only digits and dots are allowed. Do not include a `v` prefix.
16+
4. Update the `Gemfile.lock` file:
17+
- `bundle update --patch --conservative resource_registry` will generally reduce dependency bumps. Typically, other effects in the lockfile beyond the gem itself being bumped should be discarded.
18+
- See bundler documentation for detailed information on how this [command](https://bundler.io/v2.5/man/bundle-update.1.html) behaves.
19+
5. Commit the changes with a message like `bump version to v1.0.0`.
20+
6. Push the branch and raise a pull request against the main branch. The pull request title should follow the format: `bump version to v1.0.0`. Be sure to label the pull request with the `version-bump` label.
21+
22+
### Publishing the Release
23+
1. Once the pull request is approved and merged, checkout the main branch and pull the latest changes.
24+
2. Create a new release branch in the pattern of `1.0.x-release`.
25+
- Note: `x` is literal, to aid reuse of same branch for minor bugfixes.
26+
3. Create a new annotated tag with the version number, e.g., `git tag -as v1.0.0 -m "v1.0.0"`.
27+
- IMPORTANT: make sure the tag abides by the format `vX.Y.Z` where `X`, `Y`, and `Z` are integers. It is important that the tag name has a different format than any branch name to avoid confusion with Bundler.
28+
4. Push the tag to the remote repository, e.g., `git push origin refs/tags/v1.0.0`.
29+
- Avoid `git push --tags`, to not accidentally push random assorted local tags.
30+
5. GitHub Actions will automatically create a new release on the [GitHub Releases](https://github.com/dchbx/resource_registry/releases) page with release notes. Confirm that the release was successfully published there and that all intended commits are included in the release.
31+
32+
## Patch/Bugfix release
33+
### Prepare the release
34+
1. Fix bug in the main branch, via normal PR process.
35+
36+
For any release that has the bug:
37+
2. Create a temp branch off any live release branch that has the bug - pick a name that won't conflict with another branch or tag, as with Major/Minor step 2.
38+
- Using a branch, which is then PR’d, ensures traceability and inclusion of an item in the generated release notes.
39+
3. Cherry-pick the fix commits to the temp branch.
40+
4. Update the gem `version.rb` file and `Gemfile.lock` as in Major/Minor release steps 3 and 4.
41+
5. `git push` the temp branch.
42+
6. Issue a PR to merge to the release branch.
43+
44+
### Publishing the Release
45+
1. Once the pull request is approved and merged, checkout the release branch and pull the latest changes.
46+
2. Create a new annotated tag with the version number, at the point of the release branch with the fix, e.g., `git tag -as v1.0.1 -m "v1.0.1"`.
47+
3. Push the tag to the remote repository, e.g., `git push origin refs/tags/v1.0.1`.
48+
- Again, better to avoid `git push --tags`.
49+
4. Github Actions will create the release and pull in the fix PR's to the changelog.
50+
51+
## Using a Tagged Release in Another Project
52+
To use the new release in another project, update the project's `Gemfile` to reference the release's tag, e.g., `gem 'resource_registry', git: 'https://github.com/dchbx/resource_registry.git', tag: 'v1.0.0'`.
53+
54+
## Git Process diagram
55+
![Git Process Diagram - Gem](docs_assets/release_branching_gem.png)

0 commit comments

Comments
 (0)