slack-ruby-bot-server 2.2.0 → 2.2.1
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 +4 -4
- data/.github/workflows/danger-comment.yml +11 -0
- data/.github/workflows/danger.yml +11 -20
- data/.github/workflows/rubocop.yml +9 -3
- data/.github/workflows/test-mongodb.yml +43 -27
- data/.github/workflows/test-postgresql.yml +48 -30
- data/.rubocop_todo.yml +1 -7
- data/AGENTS.md +55 -0
- data/CHANGELOG.md +6 -0
- data/CONTRIBUTING.md +10 -5
- data/Dangerfile +3 -1
- data/Gemfile +27 -28
- data/README.md +1 -1
- data/RELEASING.md +26 -18
- data/lib/slack-ruby-bot-server/api/helpers/error_helpers.rb +21 -21
- data/lib/slack-ruby-bot-server/version.rb +1 -1
- metadata +5 -4
- data/Gemfile.danger +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f7080b4c298a9246ee55a74395a69e185657e7999e7acd19c55792f3a5cc2fd4
|
|
4
|
+
data.tar.gz: 4a5495629509d5b4352d42b0290ead69db7ffd8a157841eb7a85dd7d1053b928
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 769de3df16397c503ed1075acda16a9b6f67a8a6dba7d2acad8a6d28c6a06dade0f7f2046f6f6cd560883dbee849dd17bdf913a0ee6b8eedc5928b9db58f40c1
|
|
7
|
+
data.tar.gz: cabe33848ffe7d6895d1b659e28ff43922740062964d29c6ae7d7f152e33f38820b0849f5fdfe90d28f924904dc0b61496a4da723462aa6c1670688251843f78
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
on:
|
|
1
|
+
name: Danger
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, reopened, edited, synchronize]
|
|
6
|
+
|
|
4
7
|
jobs:
|
|
5
8
|
danger:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
with:
|
|
12
|
-
fetch-depth: 0
|
|
13
|
-
- name: Set up Ruby
|
|
14
|
-
uses: ruby/setup-ruby@v1
|
|
15
|
-
with:
|
|
16
|
-
ruby-version: 2.7
|
|
17
|
-
bundler-cache: true
|
|
18
|
-
- name: Run Danger
|
|
19
|
-
run: |
|
|
20
|
-
# the personal token is public, this is ok, base64 encode to avoid tripping Github
|
|
21
|
-
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
|
|
22
|
-
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
|
|
9
|
+
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0
|
|
10
|
+
secrets: inherit
|
|
11
|
+
with:
|
|
12
|
+
ruby-version: '3.4'
|
|
13
|
+
bundler-cache: true
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lint
|
|
3
3
|
on: [push, pull_request]
|
|
4
|
+
permissions:
|
|
5
|
+
contents: read
|
|
6
|
+
concurrency:
|
|
7
|
+
group: rubocop-${{ github.ref }}
|
|
8
|
+
cancel-in-progress: true
|
|
4
9
|
jobs:
|
|
5
10
|
lint:
|
|
6
11
|
name: RuboCop
|
|
7
|
-
runs-on: ubuntu-
|
|
12
|
+
runs-on: ubuntu-24.04
|
|
13
|
+
timeout-minutes: 10
|
|
8
14
|
steps:
|
|
9
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v7
|
|
10
16
|
- name: Set up Ruby
|
|
11
17
|
uses: ruby/setup-ruby@v1
|
|
12
18
|
with:
|
|
13
|
-
ruby-version:
|
|
19
|
+
ruby-version: '4.0'
|
|
14
20
|
bundler-cache: true
|
|
15
21
|
- name: Run RuboCop
|
|
16
22
|
run: bundle exec rubocop
|
|
@@ -1,40 +1,56 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: MongoDB
|
|
3
3
|
on: [push, pull_request]
|
|
4
|
+
permissions:
|
|
5
|
+
contents: read
|
|
6
|
+
concurrency:
|
|
7
|
+
group: mongodb-${{ github.ref }}
|
|
8
|
+
cancel-in-progress: true
|
|
4
9
|
jobs:
|
|
5
10
|
test:
|
|
6
|
-
runs-on: ubuntu-
|
|
11
|
+
runs-on: ubuntu-24.04
|
|
12
|
+
timeout-minutes: 20
|
|
13
|
+
env:
|
|
14
|
+
DATABASE_ADAPTER: mongoid
|
|
15
|
+
MONGOID_VERSION: ${{ matrix.entry.mongoid }}
|
|
16
|
+
GRAPE_VERSION: ${{ matrix.entry.grape || '>= 0' }}
|
|
17
|
+
JSON_VERSION: ${{ matrix.entry.json }}
|
|
7
18
|
strategy:
|
|
19
|
+
fail-fast: false
|
|
8
20
|
matrix:
|
|
9
21
|
entry:
|
|
10
|
-
|
|
11
|
-
- { ruby: 3.2, mongoid:
|
|
12
|
-
- { ruby: 3.2, mongoid: 7.3
|
|
13
|
-
- { ruby: 3.2, mongoid: 7.3.0, mongodb: 4.4 }
|
|
14
|
-
- { ruby: 3.3, mongoid: 7.3.0, mongodb: 5.0 }
|
|
15
|
-
- { ruby: 3.4, mongoid: 7.5.2, mongodb: 5.0 }
|
|
16
|
-
- { ruby: 3.4, mongoid: 8.1.11, mongodb: 6.0 }
|
|
17
|
-
- { ruby: 3.4, mongoid: 8.1.11, mongodb: 7.0 }
|
|
18
|
-
- { ruby: 3.4, mongoid: 8.1.11, mongodb: 8.0 }
|
|
19
|
-
|
|
22
|
+
# These Active Support versions pass quirks_mode, removed in JSON 3.
|
|
23
|
+
- { ruby: '3.2', mongoid: '6.4.8', mongodb: '4.4', json: '~> 2.0' }
|
|
24
|
+
- { ruby: '3.2', mongoid: '7.2.3', mongodb: '4.4', json: '~> 2.0' }
|
|
25
|
+
- { ruby: '3.2', mongoid: '7.3.0', mongodb: '4.4', json: '~> 2.0' }
|
|
26
|
+
- { ruby: '3.3', mongoid: '7.3.0', mongodb: '5.0', json: '~> 2.0' }
|
|
27
|
+
- { ruby: '3.4', mongoid: '7.5.2', mongodb: '5.0', json: '~> 2.0' }
|
|
28
|
+
- { ruby: '3.4', mongoid: '8.1.11', mongodb: '6.0', json: '~> 2.0' }
|
|
29
|
+
- { ruby: '3.4', mongoid: '8.1.11', mongodb: '7.0', json: '~> 2.0' }
|
|
30
|
+
- { ruby: '3.4', mongoid: '8.1.11', mongodb: '8.0', json: '~> 2.0' }
|
|
31
|
+
- { ruby: '3.3', mongoid: '~> 9.1', mongodb: '8.0', grape: '~> 3.2', json: '~> 3.0' }
|
|
32
|
+
- { ruby: '3.4', mongoid: '~> 9.1', mongodb: '8.0', grape: '~> 4.0', json: '~> 3.0' }
|
|
33
|
+
- { ruby: '4.0', mongoid: '~> 9.1', mongodb: '8.0', grape: '~> 4.0', json: '~> 3.0' }
|
|
34
|
+
name: test (ruby=${{ matrix.entry.ruby }}, mongoid=${{ matrix.entry.mongoid }}, mongodb=${{ matrix.entry.mongodb }}, grape=${{ matrix.entry.grape || 'auto' }}, json=${{ matrix.entry.json }})
|
|
35
|
+
services:
|
|
36
|
+
mongodb:
|
|
37
|
+
image: mongo:${{ matrix.entry.mongodb }}
|
|
38
|
+
ports:
|
|
39
|
+
- 27017:27017
|
|
40
|
+
options: >-
|
|
41
|
+
--health-cmd "mongosh --quiet --eval 'db.adminCommand({ ping: 1 })' || mongo --quiet --eval 'db.adminCommand({ ping: 1 })'"
|
|
42
|
+
--health-interval 10s
|
|
43
|
+
--health-timeout 5s
|
|
44
|
+
--health-retries 10
|
|
20
45
|
steps:
|
|
21
|
-
- uses: actions/checkout@
|
|
46
|
+
- uses: actions/checkout@v7
|
|
22
47
|
- uses: ruby/setup-ruby@v1
|
|
23
48
|
with:
|
|
24
49
|
ruby-version: ${{ matrix.entry.ruby }}
|
|
25
|
-
|
|
50
|
+
bundler-cache: true
|
|
51
|
+
cache-version: mongoid-${{ matrix.entry.mongoid }}-grape-${{ matrix.entry.grape || 'auto' }}-json-${{ matrix.entry.json }}
|
|
52
|
+
- uses: browser-actions/setup-firefox@v1.7.2
|
|
26
53
|
with:
|
|
27
|
-
|
|
28
|
-
- run: geckodriver --version
|
|
29
|
-
- uses: supercharge/mongodb-github-action@1.7.0
|
|
30
|
-
with:
|
|
31
|
-
mongodb-version: ${{ matrix.entry.mongodb }}
|
|
54
|
+
firefox-version: latest
|
|
32
55
|
- name: Test
|
|
33
|
-
|
|
34
|
-
env:
|
|
35
|
-
DATABASE_ADAPTER: mongoid
|
|
36
|
-
MONGOID_VERSION: ${{ matrix.entry.mongoid }}
|
|
37
|
-
with:
|
|
38
|
-
run: |
|
|
39
|
-
bundle install
|
|
40
|
-
bundle exec rake spec
|
|
56
|
+
run: xvfb-run --auto-servernum bundle exec rake spec
|
|
@@ -1,43 +1,61 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: PostgreSQL
|
|
3
3
|
on: [push, pull_request]
|
|
4
|
+
permissions:
|
|
5
|
+
contents: read
|
|
6
|
+
concurrency:
|
|
7
|
+
group: postgresql-${{ github.ref }}
|
|
8
|
+
cancel-in-progress: true
|
|
4
9
|
jobs:
|
|
5
10
|
test:
|
|
6
|
-
runs-on: ubuntu-
|
|
11
|
+
runs-on: ubuntu-24.04
|
|
12
|
+
timeout-minutes: 20
|
|
13
|
+
env:
|
|
14
|
+
DATABASE_ADAPTER: activerecord
|
|
15
|
+
ACTIVERECORD_VERSION: ${{ matrix.entry.active_record }}
|
|
16
|
+
GRAPE_VERSION: ${{ matrix.entry.grape || '>= 0' }}
|
|
17
|
+
JSON_VERSION: ${{ matrix.entry.json }}
|
|
18
|
+
DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_test
|
|
7
19
|
strategy:
|
|
20
|
+
fail-fast: false
|
|
8
21
|
matrix:
|
|
9
22
|
entry:
|
|
10
|
-
|
|
11
|
-
- { ruby: 3.2, postgresql: 11, active_record: '~> 6.
|
|
12
|
-
- { ruby: 3.2, postgresql:
|
|
13
|
-
- { ruby: 3.
|
|
14
|
-
- { ruby: 3.
|
|
15
|
-
- { ruby: 3.4, postgresql:
|
|
16
|
-
- { ruby: 3.4, postgresql:
|
|
17
|
-
- { ruby: 3.4, postgresql:
|
|
18
|
-
|
|
23
|
+
# Active Support 6.x, 7.0, and 8.0 pass quirks_mode, removed in JSON 3.
|
|
24
|
+
- { ruby: '3.2', postgresql: '11', active_record: '~> 6.0.0', json: '~> 2.0' }
|
|
25
|
+
- { ruby: '3.2', postgresql: '11', active_record: '~> 6.1.0', json: '~> 2.0' }
|
|
26
|
+
- { ruby: '3.2', postgresql: '14', active_record: '~> 7.0.0', json: '~> 2.0' }
|
|
27
|
+
- { ruby: '3.3', postgresql: '14', active_record: '~> 7.2.0', json: '~> 3.0' }
|
|
28
|
+
- { ruby: '3.4', postgresql: '14', active_record: '~> 7.2.0', json: '~> 3.0' }
|
|
29
|
+
- { ruby: '3.4', postgresql: '15', active_record: '~> 8.0.2', json: '~> 2.0' }
|
|
30
|
+
- { ruby: '3.4', postgresql: '16', active_record: '~> 8.0.2', json: '~> 2.0' }
|
|
31
|
+
- { ruby: '3.4', postgresql: '17', active_record: '~> 8.0.2', json: '~> 2.0' }
|
|
32
|
+
- { ruby: '3.3', postgresql: '18', active_record: '~> 8.1', grape: '~> 3.2', json: '~> 3.0' }
|
|
33
|
+
- { ruby: '3.4', postgresql: '18', active_record: '~> 8.1', grape: '~> 4.0', json: '~> 3.0' }
|
|
34
|
+
- { ruby: '4.0', postgresql: '18', active_record: '~> 8.1', grape: '~> 4.0', json: '~> 3.0' }
|
|
35
|
+
name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }}, active_record=${{ matrix.entry.active_record }}, grape=${{ matrix.entry.grape || 'auto' }}, json=${{ matrix.entry.json }})
|
|
36
|
+
services:
|
|
37
|
+
postgresql:
|
|
38
|
+
image: postgres:${{ matrix.entry.postgresql }}
|
|
39
|
+
env:
|
|
40
|
+
POSTGRES_DB: slack_ruby_bot_server_test
|
|
41
|
+
POSTGRES_USER: test
|
|
42
|
+
POSTGRES_PASSWORD: password
|
|
43
|
+
ports:
|
|
44
|
+
- 5432:5432
|
|
45
|
+
options: >-
|
|
46
|
+
--health-cmd "pg_isready -U test -d slack_ruby_bot_server_test"
|
|
47
|
+
--health-interval 10s
|
|
48
|
+
--health-timeout 5s
|
|
49
|
+
--health-retries 10
|
|
19
50
|
steps:
|
|
20
|
-
- uses: actions/checkout@
|
|
51
|
+
- uses: actions/checkout@v7
|
|
21
52
|
- uses: ruby/setup-ruby@v1
|
|
22
53
|
with:
|
|
23
54
|
ruby-version: ${{ matrix.entry.ruby }}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- run: geckodriver --version
|
|
28
|
-
- uses: harmon758/postgresql-action@v1
|
|
55
|
+
bundler-cache: true
|
|
56
|
+
cache-version: activerecord-${{ matrix.entry.active_record }}-grape-${{ matrix.entry.grape || 'auto' }}-json-${{ matrix.entry.json }}
|
|
57
|
+
- uses: browser-actions/setup-firefox@v1.7.2
|
|
29
58
|
with:
|
|
30
|
-
|
|
31
|
-
postgresql db: slack_ruby_bot_server_test
|
|
32
|
-
postgresql user: test
|
|
33
|
-
postgresql password: password
|
|
59
|
+
firefox-version: latest
|
|
34
60
|
- name: Test
|
|
35
|
-
|
|
36
|
-
env:
|
|
37
|
-
DATABASE_ADAPTER: activerecord
|
|
38
|
-
ACTIVERECORD_VERSION: ${{ matrix.entry.active_record }}
|
|
39
|
-
DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_test
|
|
40
|
-
with:
|
|
41
|
-
run: |
|
|
42
|
-
bundle install
|
|
43
|
-
bundle exec rake spec
|
|
61
|
+
run: xvfb-run --auto-servernum bundle exec rake spec
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2025-
|
|
3
|
+
# on 2025-10-08 12:27:28 UTC using RuboCop version 1.81.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count: 2
|
|
10
|
-
# Configuration parameters: Severity.
|
|
11
|
-
Bundler/DuplicatedGroup:
|
|
12
|
-
Exclude:
|
|
13
|
-
- 'Gemfile'
|
|
14
|
-
|
|
15
9
|
# Offense count: 1
|
|
16
10
|
# Configuration parameters: Severity.
|
|
17
11
|
Gemspec/RequiredRubyVersion:
|
data/AGENTS.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Agent Instructions
|
|
2
|
+
|
|
3
|
+
## Project
|
|
4
|
+
|
|
5
|
+
Slack Ruby Bot Server is a Ruby gem providing a Grape API and multi-team Slack bot lifecycle management. Read [CONTRIBUTING.md](CONTRIBUTING.md) before making changes.
|
|
6
|
+
|
|
7
|
+
- `lib/slack-ruby-bot-server/api/`: endpoints, presenters, helpers, and middleware.
|
|
8
|
+
- `lib/slack-ruby-bot-server/models/` and `lib/slack-ruby-bot-server/ext/`: models and database-specific behavior.
|
|
9
|
+
- `lib/slack-ruby-bot-server/app.rb` and `service.rb`: application setup and service lifecycle.
|
|
10
|
+
- `public/`: registration UI and static assets.
|
|
11
|
+
- `spec/`: RSpec API, model, service, and browser integration tests.
|
|
12
|
+
- `spec/database_adapters/`: adapter setup, test schemas, and database cleanup.
|
|
13
|
+
- `.github/workflows/`: compatibility matrices, lint, and Danger.
|
|
14
|
+
|
|
15
|
+
## Dependencies and Tests
|
|
16
|
+
|
|
17
|
+
Set the adapter and version selectors before installing dependencies. Use a Ruby version covered by CI; the examples below match the current Ruby 4/Grape 4 jobs.
|
|
18
|
+
|
|
19
|
+
Start MongoDB locally, then run:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
export DATABASE_ADAPTER=mongoid MONGOID_VERSION='~> 9.1' GRAPE_VERSION='~> 4.0' JSON_VERSION='~> 3.0'
|
|
23
|
+
export DATABASE_URL=mongodb://localhost/slack_ruby_bot_server_test
|
|
24
|
+
bundle install
|
|
25
|
+
bundle exec rake
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For PostgreSQL, start the server and adjust local credentials in `DATABASE_URL` as needed:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
export DATABASE_ADAPTER=activerecord ACTIVERECORD_VERSION='~> 8.1' GRAPE_VERSION='~> 4.0' JSON_VERSION='~> 3.0'
|
|
32
|
+
export DATABASE_URL=postgresql://localhost/slack_ruby_bot_server_test
|
|
33
|
+
bundle install
|
|
34
|
+
bundle exec rake
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Use only a dedicated local test database. The suite deletes or truncates records, and the Active Record schema recreates the teams table.
|
|
38
|
+
|
|
39
|
+
`bundle exec rake` runs RuboCop and the full RSpec suite. Use `bundle exec rspec path/to/spec.rb` for focused checks. Validate shared behavior against both adapters before committing; batch final checks rather than repeatedly running full suites during editing.
|
|
40
|
+
|
|
41
|
+
Browser tests require Firefox. Selenium Manager provisions geckodriver when needed. On Linux, install Xvfb and run `xvfb-run --auto-servernum bundle exec rake`. Adapter suites must run sequentially on one host because Capybara uses port 9293.
|
|
42
|
+
|
|
43
|
+
`Gemfile.lock` is intentionally ignored. Re-resolve dependencies when switching adapter/version combinations; do not add the lockfile to the gem repository.
|
|
44
|
+
|
|
45
|
+
## Changes and Compatibility
|
|
46
|
+
|
|
47
|
+
Preserve both database adapters and the existing unique CI matrix combinations, including explicit Grape 3/4 coverage. Quote version strings in workflow YAML and validate workflow changes with `actionlint`.
|
|
48
|
+
|
|
49
|
+
Keep JSON 2 constraints scoped to affected legacy matrix jobs through `JSON_VERSION`; modern jobs explicitly test JSON 3. Do not add a blanket JSON upper bound to the Gemfile or gemspec.
|
|
50
|
+
|
|
51
|
+
Follow existing Ruby conventions and `.rubocop.yml`; do not relax cops or add exclusions just to make checks pass. Add focused regression tests for changed behavior and update directly related documentation. Keep Markdown paragraphs on one line.
|
|
52
|
+
|
|
53
|
+
Add a changelog entry under the next release, with contributor attribution and the linked PR number once available. Danger checks the changelog and table of contents.
|
|
54
|
+
|
|
55
|
+
Keep each PR branch to one logical commit. Include `Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>` for Copilot contributions, and identify AI-authored GitHub descriptions/comments as posted on behalf of the requesting user. Never force-push `master`. Do not publish a release or push a release tag without explicit authorization.
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
### Changelog
|
|
2
2
|
|
|
3
|
+
### 2.2.1 (2026/10/24)
|
|
4
|
+
|
|
5
|
+
* [#182](https://github.com/slack-ruby/slack-ruby-bot-server/pull/182): Modernize CI with current actions, native database services, dependency caching, and explicit Ruby 4, Mongoid 9, Active Record 8.1, PostgreSQL 18, Grape 3/4, and JSON 2/3 coverage while retaining existing compatibility combinations - [@dblock](https://github.com/dblock), [@Copilot](https://github.com/apps/copilot-swe-agent).
|
|
6
|
+
* [#181](https://github.com/slack-ruby/slack-ruby-bot-server/pull/181): Migrated Danger to `danger-pr-comment` workflow - [@dblock](https://github.com/dblock).
|
|
7
|
+
* [#180](https://github.com/slack-ruby/slack-ruby-bot-server/pull/180): Add support for Grape v3 - [@markokajzer](https://github.com/markokajzer).
|
|
8
|
+
|
|
3
9
|
### 2.2.0 (2025/09/22)
|
|
4
10
|
|
|
5
11
|
* [#176](https://github.com/slack-ruby/slack-ruby-bot-server/pull/176): Deps: bump mongoid-scroll to 2.0 - [@markokajzer](https://github.com/markokajzer).
|
data/CONTRIBUTING.md
CHANGED
|
@@ -28,15 +28,20 @@ git checkout -b my-feature-branch
|
|
|
28
28
|
|
|
29
29
|
## Bundle Install and Test
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Select a database adapter before installing dependencies. For example, to match the Ruby 4 MongoDB/Grape 4 job, start MongoDB locally and run:
|
|
32
32
|
|
|
33
|
-
```
|
|
33
|
+
```sh
|
|
34
|
+
export DATABASE_ADAPTER=mongoid MONGOID_VERSION='~> 9.1' GRAPE_VERSION='~> 4.0' JSON_VERSION='~> 3.0'
|
|
35
|
+
export DATABASE_URL=mongodb://localhost/slack_ruby_bot_server_test
|
|
34
36
|
bundle install
|
|
35
37
|
bundle exec rake
|
|
36
38
|
```
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
For PostgreSQL, set `DATABASE_ADAPTER=activerecord`, `ACTIVERECORD_VERSION`, and `DATABASE_URL` instead. `GRAPE_VERSION` optionally constrains the Grape version for either adapter; without it, Bundler selects a compatible version. CI preserves the older compatibility combinations and adds explicit Grape 3 and 4 jobs with current ORM versions, including Ruby 4. Each database runs in a health-checked service container, while Firefox runs under Xvfb. Selenium Manager provisions the matching driver.
|
|
41
|
+
|
|
42
|
+
`JSON_VERSION` optionally constrains the development/test JSON dependency; otherwise it is unrestricted. CI uses JSON 2 for Mongoid 6-8 and Active Record 6.x, 7.0, and 8.0 because their Active Support versions pass `quirks_mode`, removed in JSON 3. Mongoid 9, Active Record 7.2, and Active Record 8.1 jobs explicitly test JSON 3. These selectors do not restrict the published gem's runtime dependencies.
|
|
43
|
+
|
|
44
|
+
On Linux, install [Firefox](https://www.mozilla.org/firefox/) and `Xvfb`, then run:
|
|
40
45
|
|
|
41
46
|
```
|
|
42
47
|
xvfb-run --auto-servernum bundle exec rake
|
|
@@ -121,7 +126,7 @@ git push origin my-feature-branch -f
|
|
|
121
126
|
|
|
122
127
|
## Check on Your Pull Request
|
|
123
128
|
|
|
124
|
-
Go back to your pull request after a few minutes and
|
|
129
|
+
Go back to your pull request after a few minutes and check its GitHub Actions results. Everything should look green, otherwise fix issues and update your commit as described above.
|
|
125
130
|
|
|
126
131
|
## Be Patient
|
|
127
132
|
|
data/Dangerfile
CHANGED
data/Gemfile
CHANGED
|
@@ -2,24 +2,17 @@ source 'https://rubygems.org'
|
|
|
2
2
|
|
|
3
3
|
case ENV.fetch('DATABASE_ADAPTER', nil)
|
|
4
4
|
when 'mongoid' then
|
|
5
|
+
gem 'database_cleaner-mongoid', '~> 2.0.1'
|
|
5
6
|
gem 'kaminari-mongoid'
|
|
6
7
|
gem 'mongoid', ENV['MONGOID_VERSION'] || '~> 7.3.0'
|
|
7
8
|
gem 'mongoid-scroll', '~> 2.0'
|
|
8
9
|
gem 'mongoid-shell'
|
|
9
|
-
gem 'mutex_m'
|
|
10
|
-
|
|
11
|
-
group :development, :test do
|
|
12
|
-
gem 'database_cleaner-mongoid', '~> 2.0.1'
|
|
13
|
-
end
|
|
14
10
|
when 'activerecord' then
|
|
15
11
|
gem 'activerecord', ENV['ACTIVERECORD_VERSION'] || '~> 6.0.0'
|
|
12
|
+
gem 'database_cleaner-active_record', '~> 2.2.0'
|
|
16
13
|
gem 'otr-activerecord'
|
|
17
14
|
gem 'pagy_cursor', '~> 0.6.1'
|
|
18
15
|
gem 'pg'
|
|
19
|
-
|
|
20
|
-
group :development, :test do
|
|
21
|
-
gem 'database_cleaner-active_record', '~> 2.2.0'
|
|
22
|
-
end
|
|
23
16
|
when nil
|
|
24
17
|
warn "Missing ENV['DATABASE_ADAPTER']."
|
|
25
18
|
else
|
|
@@ -28,22 +21,28 @@ end
|
|
|
28
21
|
|
|
29
22
|
gemspec
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
24
|
+
gem 'bundler'
|
|
25
|
+
gem 'byebug'
|
|
26
|
+
gem 'capybara'
|
|
27
|
+
gem 'danger-changelog'
|
|
28
|
+
gem 'danger-pr-comment'
|
|
29
|
+
gem 'danger-toc'
|
|
30
|
+
gem 'fabrication'
|
|
31
|
+
gem 'faker'
|
|
32
|
+
gem 'faraday'
|
|
33
|
+
gem 'faraday-rack'
|
|
34
|
+
gem 'grape', ENV.fetch('GRAPE_VERSION', '>= 0')
|
|
35
|
+
gem 'hyperclient'
|
|
36
|
+
gem 'json', ENV.fetch('JSON_VERSION', '>= 0')
|
|
37
|
+
gem 'mutex_m'
|
|
38
|
+
gem 'rack'
|
|
39
|
+
gem 'rack-server-pages'
|
|
40
|
+
gem 'rack-test'
|
|
41
|
+
gem 'rackup'
|
|
42
|
+
gem 'rake'
|
|
43
|
+
gem 'rspec'
|
|
44
|
+
gem 'rubocop'
|
|
45
|
+
gem 'selenium-webdriver'
|
|
46
|
+
gem 'vcr'
|
|
47
|
+
gem 'webmock'
|
|
48
|
+
gem 'webrick'
|
data/README.md
CHANGED
|
@@ -37,7 +37,7 @@ A library that contains a web server and a RESTful [Grape](http://github.com/rub
|
|
|
37
37
|
|
|
38
38
|
## Stable Release
|
|
39
39
|
|
|
40
|
-
You're reading the documentation for the **stable** release of slack-ruby-bot-server,
|
|
40
|
+
You're reading the documentation for the **stable** release of slack-ruby-bot-server, 2.2.1. See [UPGRADING](UPGRADING.md) when upgrading from an older version. See [MIGRATING](MIGRATING.md) for help with migrating Legacy Slack Apps to Granular Scopes.
|
|
41
41
|
|
|
42
42
|
## Make Your Own
|
|
43
43
|
|
data/RELEASING.md
CHANGED
|
@@ -4,19 +4,25 @@ There're no hard rules about when to release slack-ruby-bot-server. Release bug
|
|
|
4
4
|
|
|
5
5
|
### Release
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Start from a clean, up-to-date canonical checkout on `master`. Confirm that the version in `lib/slack-ruby-bot-server/version.rb` matches the next changelog heading and has not already been published on RubyGems or tagged in Git.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Run the tests against dedicated local test databases as described in [CONTRIBUTING.md](CONTRIBUTING.md). Set the adapter and version selectors before installing dependencies. For example, with Ruby 4 and MongoDB running locally:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
export DATABASE_ADAPTER=mongoid MONGOID_VERSION='~> 9.1' GRAPE_VERSION='~> 4.0' JSON_VERSION='~> 3.0'
|
|
13
|
+
export DATABASE_URL=mongodb://localhost/slack_ruby_bot_server_test
|
|
10
14
|
bundle install
|
|
11
|
-
rake
|
|
15
|
+
bundle exec rake
|
|
12
16
|
```
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
Also validate the Active Record adapter with its own test database. Do not run adapter suites concurrently on one host; browser tests share port 9293. Never use a production database.
|
|
19
|
+
|
|
20
|
+
Check that [GitHub Actions](https://github.com/slack-ruby/slack-ruby-bot-server/actions) succeeded for the release commit across both database matrices and RuboCop. A successful build for a different commit is not sufficient.
|
|
15
21
|
|
|
16
22
|
Change "Next" in [CHANGELOG.md](CHANGELOG.md) to the current date.
|
|
17
23
|
|
|
18
24
|
```
|
|
19
|
-
### 2.
|
|
25
|
+
### 2.2.1 (2026/10/24)
|
|
20
26
|
```
|
|
21
27
|
|
|
22
28
|
Remove the line with "Your contribution here.", since there will be no more contributions to this release.
|
|
@@ -26,34 +32,36 @@ Change `**next**` in the "Stable Release" section in README that warns users tha
|
|
|
26
32
|
```
|
|
27
33
|
## Stable Release
|
|
28
34
|
|
|
29
|
-
You're reading the documentation for the **stable** release of slack-ruby-bot-server, 2.
|
|
35
|
+
You're reading the documentation for the **stable** release of slack-ruby-bot-server, 2.2.1. See [UPGRADING](UPGRADING.md) when upgrading from an older version. See [MIGRATING](MIGRATING.md) for help with migrating Legacy Slack Apps to Granular Scopes.
|
|
30
36
|
```
|
|
31
37
|
|
|
32
38
|
Commit your changes.
|
|
33
39
|
|
|
34
40
|
```
|
|
35
|
-
git add README.md CHANGELOG.md
|
|
36
|
-
git commit -m "Preparing for release, 2.
|
|
41
|
+
git add README.md CHANGELOG.md RELEASING.md
|
|
42
|
+
git commit -m "Preparing for release, 2.2.1."
|
|
37
43
|
git push origin master
|
|
38
44
|
```
|
|
39
45
|
|
|
40
|
-
|
|
46
|
+
Wait for the release commit's GitHub Actions checks to succeed before publishing.
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
RubyGems publishing requires a maintainer's credentials and may require a fresh one-time password (OTP). For an agent-assisted release, ask the maintainer for the OTP immediately before publishing, after tests, commits, and CI are complete. Use it only for the publishing process; never put OTPs or API keys in committed files, release notes, or logs.
|
|
49
|
+
|
|
50
|
+
Pass the temporary code through `GEM_HOST_OTP_CODE`. With `OTP` holding the freshly supplied code:
|
|
44
51
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Pushed slack-ruby-bot-server 2.0.1 to rubygems.org.
|
|
52
|
+
```sh
|
|
53
|
+
GEM_HOST_OTP_CODE="$OTP" bundle exec rake release
|
|
54
|
+
unset OTP
|
|
49
55
|
```
|
|
50
56
|
|
|
57
|
+
The release task builds the gem in `pkg/`, tags the release, pushes commits and the tag, and publishes to RubyGems. Confirm that the remote tag points to the release commit and that RubyGems lists the expected version before proceeding. If publishing fails, inspect which steps completed before retrying; do not move an existing release tag or overwrite a published version.
|
|
58
|
+
|
|
51
59
|
### Prepare for the Next Version
|
|
52
60
|
|
|
53
61
|
Add the next release to [CHANGELOG.md](CHANGELOG.md).
|
|
54
62
|
|
|
55
63
|
```
|
|
56
|
-
### 2.
|
|
64
|
+
### 2.2.2 (Next)
|
|
57
65
|
|
|
58
66
|
* Your contribution here.
|
|
59
67
|
```
|
|
@@ -65,13 +73,13 @@ Undo your change in README about the stable release.
|
|
|
65
73
|
```
|
|
66
74
|
## Stable Release
|
|
67
75
|
|
|
68
|
-
You're reading the documentation for the **next** release of slack-ruby-bot-server. Please see the documentation for the [last stable release, v2.
|
|
76
|
+
You're reading the documentation for the **next** release of slack-ruby-bot-server. Please see the documentation for the [last stable release, v2.2.1](https://github.com/slack-ruby/slack-ruby-bot-server/blob/v2.2.1/README.md) unless you're integrating with HEAD. See [UPGRADING](UPGRADING.md) when upgrading from an older version. See [MIGRATING](MIGRATING.md) for help with migrating Legacy Slack Apps to Granular Scopes.
|
|
69
77
|
```
|
|
70
78
|
|
|
71
79
|
Commit your changes.
|
|
72
80
|
|
|
73
81
|
```
|
|
74
82
|
git add README.md CHANGELOG.md lib/slack-ruby-bot-server/version.rb
|
|
75
|
-
git commit -m "Preparing for next development iteration, 2.
|
|
83
|
+
git commit -m "Preparing for next development iteration, 2.2.2."
|
|
76
84
|
git push origin master
|
|
77
85
|
```
|
|
@@ -10,42 +10,42 @@ module SlackRubyBotServer
|
|
|
10
10
|
Middleware.logger.error "#{e.class.name}: #{e.message}\n #{backtrace}"
|
|
11
11
|
error = { type: 'other_error', message: e.message }
|
|
12
12
|
error[:backtrace] = backtrace
|
|
13
|
-
|
|
13
|
+
error!(error, 400)
|
|
14
14
|
end
|
|
15
15
|
# rescue document validation errors into detail json
|
|
16
16
|
if SlackRubyBotServer::Config.mongoid?
|
|
17
17
|
rescue_from Mongoid::Errors::Validations do |e|
|
|
18
18
|
backtrace = e.backtrace[0..5].join("\n ")
|
|
19
19
|
Middleware.logger.warn "#{e.class.name}: #{e.message}\n #{backtrace}"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
error!({
|
|
21
|
+
type: 'param_error',
|
|
22
|
+
message: e.document.errors.full_messages.uniq.join(', ') + '.',
|
|
23
|
+
detail: e.document.errors.messages.each_with_object({}) do |(k, v), h|
|
|
24
|
+
h[k] = v.uniq
|
|
25
|
+
end
|
|
26
|
+
}, 400)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
rescue_from Grape::Exceptions::Validation do |e|
|
|
30
30
|
backtrace = e.backtrace[0..5].join("\n ")
|
|
31
31
|
Middleware.logger.warn "#{e.class.name}: #{e.message}\n #{backtrace}"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
error!({
|
|
33
|
+
type: 'param_error',
|
|
34
|
+
message: 'Invalid parameters.',
|
|
35
|
+
detail: { e.params.join(', ') => [e.message] }
|
|
36
|
+
}, 400)
|
|
37
37
|
end
|
|
38
38
|
rescue_from Grape::Exceptions::ValidationErrors do |e|
|
|
39
39
|
backtrace = e.backtrace[0..5].join("\n ")
|
|
40
40
|
Middleware.logger.warn "#{e.class.name}: #{e.message}\n #{backtrace}"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
error!({
|
|
42
|
+
type: 'param_error',
|
|
43
|
+
message: 'Invalid parameters.',
|
|
44
|
+
detail: e.errors.each_with_object({}) do |(k, v), h|
|
|
45
|
+
# JSON does not permit having a key of type Array
|
|
46
|
+
h[k.count == 1 ? k.first : k.join(', ')] = v
|
|
47
|
+
end
|
|
48
|
+
}, 400)
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: slack-ruby-bot-server
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Doubrovkine
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: async
|
|
@@ -170,6 +170,7 @@ extensions: []
|
|
|
170
170
|
extra_rdoc_files: []
|
|
171
171
|
files:
|
|
172
172
|
- ".github/FUNDING.yml"
|
|
173
|
+
- ".github/workflows/danger-comment.yml"
|
|
173
174
|
- ".github/workflows/danger.yml"
|
|
174
175
|
- ".github/workflows/rubocop.yml"
|
|
175
176
|
- ".github/workflows/test-mongodb.yml"
|
|
@@ -178,12 +179,12 @@ files:
|
|
|
178
179
|
- ".rspec"
|
|
179
180
|
- ".rubocop.yml"
|
|
180
181
|
- ".rubocop_todo.yml"
|
|
182
|
+
- AGENTS.md
|
|
181
183
|
- CHANGELOG.md
|
|
182
184
|
- CONTRIBUTING.md
|
|
183
185
|
- DEBUGGING.md
|
|
184
186
|
- Dangerfile
|
|
185
187
|
- Gemfile
|
|
186
|
-
- Gemfile.danger
|
|
187
188
|
- Guardfile
|
|
188
189
|
- LICENSE
|
|
189
190
|
- MIGRATING.md
|
|
@@ -257,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
257
258
|
- !ruby/object:Gem::Version
|
|
258
259
|
version: '0'
|
|
259
260
|
requirements: []
|
|
260
|
-
rubygems_version:
|
|
261
|
+
rubygems_version: 4.0.20
|
|
261
262
|
specification_version: 4
|
|
262
263
|
summary: A Grape API serving a Slack bot to multiple teams.
|
|
263
264
|
test_files: []
|