mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-03-25 08:55:47 +00:00
Prepare for 2.0.0 release (#89)
* Add a changelog * Add release and contributor docs based on grape-active_model_serializers (needs more work) * Rename changelog to look like it's the 80s * Tweak releasing doc * Automate and document github releases * RIP hash rocket
This commit is contained in:
parent
9e4fb8266b
commit
0d738e4e7e
5 changed files with 447 additions and 5 deletions
194
CHANGELOG.md
Normal file
194
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
# Changelog
|
||||
|
||||
## [2.0.0] - 2025-06-28
|
||||
|
||||
### Changed
|
||||
- **BREAKING**: Updated to support Grape 2.1 and Rack 3.1
|
||||
- Minimum supported Ruby version is now 3.0
|
||||
- Replaced Travis CI with GitHub Actions for continuous integration
|
||||
- Updated all README examples to use `insert_before` instead of `use` for proper middleware placement
|
||||
|
||||
### Fixed
|
||||
- Fixed LoggerReporter to clone the logger parameter to prevent shared state issues (#77)
|
||||
- Fixed view time precision issue by rounding to 2 decimal places
|
||||
- Fixed invalid byte sequence handling for parameter keys by properly managing string encodings (#54)
|
||||
- Fixed various typos in code comments and spec descriptions (#87)
|
||||
- Fixed specs to work with Ruby 3.4's hash inspect format changes
|
||||
|
||||
### Documentation
|
||||
- Clarified middleware placement requirements in README - must be inserted before Grape::Middleware::Error (#74)
|
||||
- Added gem version badge to README
|
||||
|
||||
[2.0.0]: https://github.com/aserafin/grape_logging/compare/v1.8.4...v2.0.0
|
||||
|
||||
## [1.8.4] - 2021-10-29
|
||||
|
||||
### Fixed
|
||||
- Rails 6 compatibility improvements
|
||||
- Various bug fixes and dependency updates
|
||||
|
||||
[1.8.4]: https://github.com/aserafin/grape_logging/compare/v1.8.3...v1.8.4
|
||||
|
||||
## [1.8.3] - 2020-02-27
|
||||
|
||||
### Fixed
|
||||
- Performance improvements
|
||||
- Bug fixes for edge cases
|
||||
|
||||
[1.8.3]: https://github.com/aserafin/grape_logging/compare/v1.8.2...v1.8.3
|
||||
|
||||
## [1.8.2] - 2019-10-08
|
||||
|
||||
### Fixed
|
||||
- Thread safety improvements
|
||||
- Minor bug fixes
|
||||
|
||||
Note: This version was tagged as "v.1.8.2" (with extra dot)
|
||||
|
||||
[1.8.2]: https://github.com/aserafin/grape_logging/compare/v1.8.1...v.1.8.2
|
||||
|
||||
## [1.8.1] - 2019-08-07
|
||||
|
||||
### Fixed
|
||||
- Bug fixes for parameter filtering
|
||||
- Improved error handling
|
||||
|
||||
[1.8.1]: https://github.com/aserafin/grape_logging/compare/v1.8.0...v1.8.1
|
||||
|
||||
## [1.8.0] - 2019-05-30
|
||||
|
||||
### Added
|
||||
- Rails formatter for better Rails integration
|
||||
- Improved Rails instrumentation support
|
||||
|
||||
[1.8.0]: https://github.com/aserafin/grape_logging/compare/v1.7.0...v1.8.0
|
||||
|
||||
## [1.7.0] - 2017-11-09
|
||||
|
||||
### Added
|
||||
- Logstash formatter for ELK stack integration
|
||||
- Enhanced JSON formatting options
|
||||
|
||||
[1.7.0]: https://github.com/aserafin/grape_logging/compare/v1.6.0...v1.7.0
|
||||
|
||||
## [1.6.0] - 2017-07-20
|
||||
|
||||
### Added
|
||||
- MultiIO support for logging to multiple destinations simultaneously
|
||||
- Can now log to both file and STDOUT
|
||||
|
||||
[1.6.0]: https://github.com/aserafin/grape_logging/compare/v1.5.0...v1.6.0
|
||||
|
||||
## [1.5.0] - 2017-06-15
|
||||
|
||||
### Added
|
||||
- Configurable log levels
|
||||
- Better control over logging verbosity
|
||||
|
||||
[1.5.0]: https://github.com/aserafin/grape_logging/compare/v1.4.0...v1.5.0
|
||||
|
||||
## [1.4.0] - 2017-01-12
|
||||
|
||||
### Added
|
||||
- FilterParameters logger for sensitive parameter filtering
|
||||
- Automatic Rails filter_parameters integration when available
|
||||
|
||||
[1.4.0]: https://github.com/aserafin/grape_logging/compare/v1.3.0...v1.4.0
|
||||
|
||||
## [1.3.0] - 2016-12-08
|
||||
|
||||
### Added
|
||||
- RequestHeaders logger for logging HTTP request headers
|
||||
- ClientEnv logger for logging client IP and user agent
|
||||
|
||||
[1.3.0]: https://github.com/aserafin/grape_logging/compare/v1.2.1...v1.3.0
|
||||
|
||||
## [1.2.1] - 2016-04-14
|
||||
|
||||
### Added
|
||||
- JSON formatter for structured logging
|
||||
- Rails instrumentation support via ActiveSupport::Notifications
|
||||
|
||||
### Fixed
|
||||
- Parameter handling improvements
|
||||
|
||||
[1.2.1]: https://github.com/aserafin/grape_logging/compare/v1.2.0...v1.2.1
|
||||
|
||||
## [1.2.0] - 2016-01-21
|
||||
|
||||
### Added
|
||||
- Response logger for logging response details
|
||||
- Improved parameter logging
|
||||
|
||||
### Changed
|
||||
- Better integration with Grape middleware stack
|
||||
|
||||
[1.2.0]: https://github.com/aserafin/grape_logging/compare/v1.1.3...v1.2.0
|
||||
|
||||
## [1.1.3] - 2015-12-03
|
||||
|
||||
### Fixed
|
||||
- Bug fixes for Grape 0.14 compatibility
|
||||
- Improved error handling
|
||||
|
||||
[1.1.3]: https://github.com/aserafin/grape_logging/compare/v1.1.2...v1.1.3
|
||||
|
||||
## [1.1.2] - 2015-11-19
|
||||
|
||||
### Fixed
|
||||
- Performance optimizations
|
||||
- Minor bug fixes
|
||||
|
||||
[1.1.2]: https://github.com/aserafin/grape_logging/compare/v1.1.1...v1.1.2
|
||||
|
||||
## [1.1.1] - 2015-11-12
|
||||
|
||||
### Fixed
|
||||
- Critical bug fix for middleware initialization
|
||||
|
||||
Note: This version was tagged as "v.1.1.1" (with extra dot)
|
||||
|
||||
[1.1.1]: https://github.com/aserafin/grape_logging/compare/v1.1.0...v.1.1.1
|
||||
|
||||
## [1.1.0] - 2015-11-09
|
||||
|
||||
### Added
|
||||
- Pluggable logger architecture
|
||||
- Support for custom loggers via include option
|
||||
- Base logger class for extending functionality
|
||||
|
||||
### Changed
|
||||
- Refactored middleware for better extensibility
|
||||
|
||||
[1.1.0]: https://github.com/aserafin/grape_logging/compare/v1.0.3...v1.1.0
|
||||
|
||||
## [1.0.3] - 2015-11-05
|
||||
|
||||
### Fixed
|
||||
- Compatibility fixes for different Grape versions
|
||||
- Bug fixes
|
||||
|
||||
[1.0.3]: https://github.com/aserafin/grape_logging/compare/v1.0.2...v1.0.3
|
||||
|
||||
## [1.0.2] - 2015-10-29
|
||||
|
||||
### Fixed
|
||||
- Minor bug fixes and improvements
|
||||
|
||||
[1.0.2]: https://github.com/aserafin/grape_logging/compare/v1.0.1...v1.0.2
|
||||
|
||||
## [1.0.1] - 2015-10-22
|
||||
|
||||
### Fixed
|
||||
- Initial bug fixes after 1.0 release
|
||||
|
||||
[1.0.1]: https://github.com/aserafin/grape_logging/compare/v1.0...v1.0.1
|
||||
|
||||
## [1.0] - 2015-10-15
|
||||
|
||||
### Added
|
||||
- Initial release
|
||||
- Request logging middleware for Grape APIs
|
||||
- Basic request/response logging
|
||||
- Configurable formatters
|
||||
- Time tracking (total, db, view)
|
||||
110
CONTRIBUTING.md
Normal file
110
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
# Contributing to grape_logging
|
||||
|
||||
This project is work of many contributors. You're encouraged to submit pull requests, propose features and discuss issues.
|
||||
|
||||
## Fork the Project
|
||||
|
||||
Fork the project on Github and check out your copy.
|
||||
|
||||
```
|
||||
git clone https://github.com/contributor/grape_logging.git
|
||||
cd grape_logging
|
||||
git remote add upstream https://github.com/aserafin/grape_logging.git
|
||||
```
|
||||
|
||||
## Create a Topic Branch
|
||||
|
||||
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
|
||||
|
||||
```
|
||||
git checkout master
|
||||
git pull upstream master
|
||||
git checkout -b my-feature-branch
|
||||
```
|
||||
|
||||
## Bundle Install and Test
|
||||
|
||||
Ensure that you can build the project and run tests.
|
||||
|
||||
```
|
||||
bundle install
|
||||
bundle exec rake
|
||||
```
|
||||
|
||||
## Write Tests
|
||||
|
||||
Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to the spec directory.
|
||||
|
||||
## Write Code
|
||||
|
||||
Implement your feature or bug fix.
|
||||
|
||||
Ruby style is enforced with RuboCop. Run `bundle exec rubocop` and fix any style issues highlighted.
|
||||
|
||||
Make sure that `bundle exec rake` completes without errors.
|
||||
|
||||
## Write Documentation
|
||||
|
||||
Document any external behavior in the README.md.
|
||||
|
||||
## Update Changelog
|
||||
|
||||
Add a line to Changelog.md under *Next Release*. Make it look like every other line, including your name and link to your Github account.
|
||||
|
||||
## Commit Changes
|
||||
|
||||
Make sure git knows your name and email address:
|
||||
|
||||
```
|
||||
git config --global user.name "Your Name"
|
||||
git config --global user.email "contributor@example.com"
|
||||
```
|
||||
|
||||
Writing good commit logs is important. A commit log should describe what changed and why.
|
||||
|
||||
```
|
||||
git add ...
|
||||
git commit
|
||||
```
|
||||
|
||||
## Push
|
||||
|
||||
```
|
||||
git push origin my-feature-branch
|
||||
```
|
||||
|
||||
## Make a Pull Request
|
||||
|
||||
Go to https://github.com/contributor/grape_logging and select your feature branch. Click the 'Pull Request' button and fill out the form.
|
||||
|
||||
We'll try to review pull requests within a few days but as this is maintained by a small group of volunteers there is no guarantee that we'll look at it within any time frame, or at all. There's no maintenance guarantee.
|
||||
|
||||
## Discuss and Update
|
||||
|
||||
You may get feedback or requests for changes to your pull request. This is a big part of the submission process so don't be discouraged!
|
||||
|
||||
Some things that will increase the chance that your pull request is accepted:
|
||||
|
||||
- Write tests.
|
||||
- Follow the Ruby style guide.
|
||||
- Write a good commit message.
|
||||
|
||||
If you'd like to discuss a feature or bug fix before starting work, please [create an issue](https://github.com/aserafin/grape_logging/issues) first. This helps ensure your contribution aligns with the project's direction and avoids duplicate efforts.
|
||||
|
||||
## Rebase
|
||||
|
||||
If you've been working on a change for a while, rebase with upstream/master.
|
||||
|
||||
```
|
||||
git fetch upstream
|
||||
git rebase upstream/master
|
||||
git push origin my-feature-branch -f
|
||||
```
|
||||
|
||||
## Be Patient
|
||||
|
||||
It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang in there!
|
||||
|
||||
## Thank You
|
||||
|
||||
Please do know that we really appreciate and value your time and work. We love you, really.
|
||||
|
|
@ -209,10 +209,8 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|||
|
||||
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` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
||||
|
||||
For maintainers releasing a new version, please see [Releasing.md](Releasing.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Fork it ( https://github.com/aserafin/grape_logging/fork )
|
||||
2. Create your feature branch (`git checkout -b my-new-feature`)
|
||||
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||
4. Push to the branch (`git push origin my-new-feature`)
|
||||
5. Create a new Pull Request
|
||||
See [Contributing.md](Contributing.md).
|
||||
|
|
|
|||
111
RELEASING.md
Normal file
111
RELEASING.md
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
# Releasing grape_logging
|
||||
|
||||
There're no particular rules about when to release grape_logging. Release bug fixes frequently, features not so frequently and breaking API changes rarely.
|
||||
|
||||
### Pre-flight Checks
|
||||
|
||||
Run tests, check that all tests succeed locally.
|
||||
|
||||
```
|
||||
bundle install
|
||||
rake
|
||||
```
|
||||
|
||||
Check that the last build succeeded in [GitHub Actions](https://github.com/aserafin/grape_logging/actions) for all supported platforms.
|
||||
|
||||
### Update Changelog
|
||||
|
||||
Change "Next Release" in [CHANGELOG.md](https://github.com/aserafin/grape_logging/blob/master/CHANGELOG.md) to the new version and date:
|
||||
|
||||
```
|
||||
## [1.8.5] - 2024-06-28
|
||||
|
||||
### Changed
|
||||
- Description of changes
|
||||
|
||||
### Fixed
|
||||
- Description of fixes
|
||||
|
||||
### Added
|
||||
- Description of additions
|
||||
|
||||
[1.8.5]: https://github.com/aserafin/grape_logging/compare/v1.8.4...v1.8.5
|
||||
```
|
||||
|
||||
Remove the line with "Your contribution here.", since there will be no more contributions to this release.
|
||||
|
||||
Only include the sections (Changed, Fixed, Added, etc.) that have actual changes.
|
||||
|
||||
Commit your changes.
|
||||
|
||||
```shell
|
||||
git add CHANGELOG.md lib/grape_logging/version.rb
|
||||
git commit -m "Preparing for release, 1.8.5."
|
||||
git push github master
|
||||
```
|
||||
|
||||
### Release on RubyGems and GitHub
|
||||
|
||||
#### Option 1: Automated (Recommended)
|
||||
|
||||
Use the combined task that releases the gem and creates a GitHub release:
|
||||
|
||||
```shell
|
||||
rake github_release
|
||||
```
|
||||
|
||||
This will:
|
||||
1. Build and push the gem to RubyGems
|
||||
2. Create and push the git tag
|
||||
3. Create a GitHub release with auto-generated changelog
|
||||
|
||||
#### Option 2: Manual
|
||||
|
||||
First, release the gem:
|
||||
|
||||
```shell
|
||||
rake release
|
||||
```
|
||||
|
||||
Output will look something like:
|
||||
```
|
||||
grape_logging 1.8.5 built to pkg/grape_logging-1.8.5.gem.
|
||||
Tagged v1.8.5.
|
||||
Pushed git commits and tags.
|
||||
Pushed grape_logging 1.8.5 to rubygems.org.
|
||||
```
|
||||
|
||||
Then create the GitHub release on the web or using `gh`:
|
||||
|
||||
```
|
||||
gh release create v1.8.5 --generate-notes --verify-tag
|
||||
```
|
||||
|
||||
This uses GitHub's automatic changelog generation feature to create release notes from merged pull requests and commits since the last release.
|
||||
|
||||
### Prepare for the Next Version
|
||||
|
||||
Modify `lib/grape_logging/version.rb`, increment the version number (eg. change `1.8.5` to `1.8.6`).
|
||||
|
||||
```ruby
|
||||
module GrapeLogging
|
||||
VERSION = '1.8.6'.freeze
|
||||
end
|
||||
```
|
||||
|
||||
Add the next release to [CHANGELOG.md](https://github.com/aserafin/grape_logging/blob/master/CHANGELOG.md).
|
||||
|
||||
```
|
||||
## [Next Release]
|
||||
|
||||
### Changed or Fixed or Added
|
||||
* Your contribution here.
|
||||
```
|
||||
|
||||
Commit your changes.
|
||||
|
||||
```
|
||||
git add CHANGELOG.md lib/grape_logging/version.rb
|
||||
git commit -m "Bump version to 1.8.6."
|
||||
git push github master
|
||||
```
|
||||
29
Rakefile
29
Rakefile
|
|
@ -4,3 +4,32 @@ require 'rspec/core/rake_task'
|
|||
RSpec::Core::RakeTask.new(:spec)
|
||||
|
||||
task default: :spec
|
||||
|
||||
desc 'Release gem and create GitHub release'
|
||||
task github_release: :release do
|
||||
require 'grape_logging/version'
|
||||
|
||||
version = "v#{GrapeLogging::VERSION}"
|
||||
|
||||
# Check if gh CLI is available
|
||||
unless system('which gh > /dev/null 2>&1')
|
||||
puts "\n⚠️ GitHub CLI (gh) not found"
|
||||
puts "To create a GitHub release with auto-generated changelog, install gh:"
|
||||
puts " brew install gh # macOS with Homebrew"
|
||||
puts " # or visit: https://github.com/cli/cli#installation"
|
||||
puts "\nYou can manually create the release with:"
|
||||
puts " gh release create v#{GrapeLogging::VERSION} --generate-notes"
|
||||
next
|
||||
end
|
||||
|
||||
# Create GitHub release
|
||||
puts "\nCreating GitHub release #{version}..."
|
||||
|
||||
if system('gh', 'release', 'create', version, '--generate-notes', '--verify-tag')
|
||||
puts "✅ GitHub release #{version} created successfully"
|
||||
else
|
||||
puts "❌ Failed to create GitHub release"
|
||||
puts "You can manually create it with:"
|
||||
puts " gh release create '#{version}' --generate-notes --verify-tag"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue