Skip to content

Commit 20e5774

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/checkout-6
2 parents 6bc7821 + 4782860 commit 20e5774

20 files changed

Lines changed: 319 additions & 17 deletions

File tree

.claude/rules/services.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
paths:
3+
- "lib/services/**/*.rb"
4+
---
5+
6+
# Service Conventions
7+
8+
- All HTTP calls use Ruby's native `Net::HTTP` — do not add external HTTP client gems
9+
- Services are plain Ruby classes initialized with tokens/config, no framework coupling
10+
- Constructor pattern: `initialize(token, debug: false, logger: nil)`
11+
- API clients define a private `api_request` method that handles GET/POST, auth headers, and JSON parsing
12+
- Error handling: check response status/`ok` field, log via `debug_log`, return empty/false on failure rather than raising
13+
- SlackService auto-joins channels on `not_in_channel` errors — preserve this retry pattern

.claude/rules/slack-modals.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
paths:
3+
- "lib/helpers/**/*.rb"
4+
---
5+
6+
# Slack Modal Conventions
7+
8+
- Modals use Slack Block Kit format — return Ruby hashes that serialize to JSON
9+
- Two modal types: `global_shortcut_modal` (needs both thread URL and issue URL inputs) and `message_shortcut_modal` (only needs issue URL, thread context passed via `private_metadata`)
10+
- `private_metadata` carries `channel_id` and `thread_ts` as JSON between shortcut trigger and submission
11+
- Callback IDs follow the pattern `gh_comment_modal_<type>` — these are matched in `app.rb` to route submissions
12+
- Use `plain_text_input` elements with `block_id`/`action_id` pairs for form fields

.claude/rules/testing.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
paths:
3+
- "test/**/*.rb"
4+
---
5+
6+
# Testing Rules
7+
8+
- Use `Minitest::Spec` style (`describe`/`it` blocks)
9+
- All external HTTP calls must be stubbed with WebMock — `WebMock.disable_net_connect!` is enforced globally
10+
- Use the shared fixtures and stub helpers from `test/test_helper.rb`:
11+
- Fixtures: `slack_message`, `slack_thread_response`, `slack_user_response`, `github_comment_response`, `slack_modal_payload`
12+
- Stubs: `stub_slack_conversations_replies`, `stub_slack_users_info`, `stub_slack_chat_post_message`, `stub_github_create_comment`
13+
- Integration tests use `Rack::Test` — call endpoints via `get`, `post` etc. and the `app` method returns `Sinatra::Application`
14+
- `setup` calls `WebMock.reset!` automatically — no need to repeat it
15+
- Test env vars (`SLACK_BOT_TOKEN`, `GITHUB_TOKEN`) are set in `test_helper.rb`

.claude/skills/ci/SKILL.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: ci
3+
description: Run the full CI suite (syntax + rubocop + tests) and report results
4+
allowed-tools: Bash(bundle exec *)
5+
---
6+
7+
Run the full CI check suite:
8+
9+
```bash
10+
bundle exec rake ci
11+
```
12+
13+
Report the results clearly. If any step fails, identify which step failed and show the relevant error output.

.claude/skills/release/SKILL.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: release
3+
description: Walk through the release process - preview changelog, bump version, create PR
4+
disable-model-invocation: true
5+
argument-hint: "[major|minor|patch]"
6+
---
7+
8+
Create a release for this project. The bump type is: $ARGUMENTS (default to what `rake release:preview` suggests if not specified).
9+
10+
Steps:
11+
12+
1. Run `bundle exec rake release:preview` to show the current version, suggested bump type, and changelog preview
13+
2. Confirm the bump type with the user before proceeding
14+
3. Ensure the working directory is clean (`git status`)
15+
4. Run `bundle exec rake ci` to verify all checks pass
16+
5. Run `bundle exec rake release:$ARGUMENTS` to create the release (this bumps version, updates CHANGELOG.md, and creates a git tag)
17+
6. Show the user the final commands to push: `git push origin main && git push origin <tag>`
18+
19+
Do NOT push automatically — let the user decide when to push.

.claude/skills/review-pr/SKILL.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: review-pr
3+
description: Review a pull request for code style, architecture, and correctness
4+
disable-model-invocation: true
5+
context: fork
6+
agent: Explore
7+
argument-hint: "[PR number or URL]"
8+
allowed-tools: Bash(gh *)
9+
---
10+
11+
Review pull request $ARGUMENTS against this project's conventions.
12+
13+
## Gather context
14+
15+
- PR diff: !`gh pr view $ARGUMENTS --json additions,deletions,changedFiles`
16+
- PR details: !`gh pr view $ARGUMENTS`
17+
- Full diff: !`gh pr diff $ARGUMENTS`
18+
19+
## Review checklist
20+
21+
1. **Code style**: RuboCop compliance (120-char lines, 20-line methods, single quotes)
22+
2. **Architecture**: Services stay in `lib/services/`, helpers in `lib/helpers/`. Services use Net::HTTP, not external HTTP gems
23+
3. **Testing**: New functionality has corresponding tests. All HTTP calls are stubbed with WebMock. Tests use shared fixtures from `test_helper.rb`
24+
4. **Commit messages**: Follow conventional commits format (`feat:`, `fix:`, `docs:`, etc.)
25+
5. **Error handling**: API errors handled gracefully, debug logging via `debug_log`
26+
27+
## Output
28+
29+
Provide a structured review with:
30+
- Summary of changes
31+
- Issues found (if any), with file and line references
32+
- Suggestions for improvement
33+
- Overall assessment (approve / request changes)

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CLAUDE.md

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
ruby-version: ['3.1', '3.2', '3.3']
17+
ruby-version: ['3.2', '3.3', '3.4', '4.0']
1818

1919
steps:
2020
- uses: actions/checkout@v6
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Copilot Setup Steps"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
pull_request:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
12+
jobs:
13+
copilot-setup-steps:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: read
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: '3.4'
27+
bundler-cache: true

.github/workflows/release.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010

1111
permissions:
1212
contents: write
13+
packages: write
1314

1415
jobs:
1516
release:
@@ -78,10 +79,47 @@ jobs:
7879
.
7980
8081
- name: Create GitHub Release
81-
uses: softprops/action-gh-release@v1
82+
uses: softprops/action-gh-release@v2
8283
with:
8384
name: Release v${{ steps.version.outputs.VERSION }}
8485
body: ${{ steps.changelog.outputs.BODY }}
8586
files: slack-github-threads-v${{ steps.version.outputs.VERSION }}.tar.gz
8687
draft: false
8788
prerelease: false
89+
90+
docker:
91+
runs-on: ubuntu-latest
92+
needs: release
93+
94+
steps:
95+
- name: Checkout code
96+
uses: actions/checkout@v4
97+
98+
- name: Extract version from tag
99+
id: version
100+
run: |
101+
VERSION=${GITHUB_REF#refs/tags/v}
102+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
103+
104+
- name: Log in to GitHub Container Registry
105+
uses: docker/login-action@v3
106+
with:
107+
registry: ghcr.io
108+
username: ${{ github.actor }}
109+
password: ${{ secrets.GITHUB_TOKEN }}
110+
111+
- name: Set up Docker Buildx
112+
uses: docker/setup-buildx-action@v3
113+
114+
- name: Build and push Docker image
115+
uses: docker/build-push-action@v6
116+
with:
117+
context: .
118+
push: true
119+
tags: |
120+
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.VERSION }}
121+
ghcr.io/${{ github.repository }}:latest
122+
labels: |
123+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
124+
org.opencontainers.image.version=${{ steps.version.outputs.VERSION }}
125+
org.opencontainers.image.revision=${{ github.sha }}

0 commit comments

Comments
 (0)