my_api_client 1.3.1 → 2.0.0
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/.dockerignore +8 -0
- data/.envrc.skeleton +0 -1
- data/.github/dependabot.yml +82 -7
- data/.github/workflows/ci.yml +334 -0
- data/.github/workflows/dependabot-auto-merge.yml +96 -0
- data/.github/workflows/release.yml +33 -0
- data/.github/workflows/rubocop_challenge.yml +33 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/AGENTS.md +128 -0
- data/CHANGELOG.md +54 -2
- data/CLAUDE.md +6 -0
- data/Dockerfile +22 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +67 -59
- data/README.md +398 -62
- data/docker-compose.yml +29 -0
- data/docs/runbooks/dependabot_pr_auto_merge.md +113 -0
- data/gemfiles/rails_7.2.gemfile +1 -1
- data/gemfiles/{rails_7.1.gemfile → rails_8.0.gemfile} +2 -2
- data/gemfiles/{rails_6.1.gemfile → rails_8.1.gemfile} +2 -2
- data/lib/my_api_client/default_error_handlers.rb +1 -1
- data/lib/my_api_client/errors/client_error.rb +5 -1
- data/lib/my_api_client/integrations/bugsnag.rb +1 -1
- data/lib/my_api_client/version.rb +1 -1
- data/lib/my_api_client.rb +1 -1
- data/my_api/.ruby-version +1 -1
- data/my_api/AGENTS.md +35 -0
- data/my_api/Dockerfile +25 -0
- data/my_api/Gemfile +5 -16
- data/my_api/Gemfile.lock +263 -228
- data/my_api/README.md +36 -25
- data/my_api/Rakefile +3 -2
- data/my_api/app/controllers/application_controller.rb +1 -2
- data/my_api/app/controllers/error_controller.rb +2 -2
- data/my_api/app/controllers/header_controller.rb +6 -3
- data/my_api/app/controllers/pagination_controller.rb +5 -15
- data/my_api/app/controllers/rest_controller.rb +12 -16
- data/my_api/app/controllers/status_controller.rb +3 -4
- data/my_api/config/application.rb +12 -67
- data/{rails_app/rails_6.1 → my_api}/config/boot.rb +1 -1
- data/{rails_app/rails_7.1 → my_api}/config/environment.rb +0 -2
- data/my_api/config/environments/development.rb +6 -6
- data/my_api/config/environments/production.rb +5 -8
- data/my_api/config/environments/test.rb +5 -6
- data/my_api/config/routes.rb +2 -10
- data/my_api/config.ru +2 -4
- data/my_api/public/index.html +10 -90
- data/{rails_app/rails_7.0 → my_api}/spec/rails_helper.rb +3 -4
- data/my_api/spec/requests/error_controller_spec.rb +18 -0
- data/my_api/spec/requests/pagination_controller_spec.rb +22 -0
- data/my_api/spec/requests/rest_controller_spec.rb +22 -0
- data/my_api/spec/requests/status_controller_spec.rb +20 -0
- data/my_api/spec/spec_helper.rb +15 -23
- data/my_api_client.gemspec +2 -2
- data/rails_app/AGENTS.md +13 -0
- data/rails_app/rails_7.2/Dockerfile +1 -1
- data/rails_app/rails_7.2/Gemfile +2 -0
- data/rails_app/rails_7.2/Gemfile.lock +143 -122
- data/rails_app/{rails_7.1 → rails_8.0}/.dockerignore +16 -2
- data/rails_app/{rails_6.1 → rails_8.0}/.gitattributes +2 -1
- data/rails_app/rails_8.0/.github/workflows/ci.yml +39 -0
- data/rails_app/{rails_6.1 → rails_8.0}/.gitignore +11 -7
- data/rails_app/rails_8.0/.rubocop.yml +8 -0
- data/rails_app/rails_8.0/.ruby-version +1 -0
- data/rails_app/{rails_7.1 → rails_8.0}/Dockerfile +28 -18
- data/rails_app/rails_8.0/Gemfile +15 -0
- data/rails_app/rails_8.0/Gemfile.lock +286 -0
- data/rails_app/{rails_6.1 → rails_8.0}/Rakefile +1 -3
- data/rails_app/{rails_7.1 → rails_8.0}/app/controllers/application_controller.rb +0 -2
- data/rails_app/rails_8.0/app/jobs/application_job.rb +7 -0
- data/rails_app/rails_8.0/app/mailers/application_mailer.rb +4 -0
- data/rails_app/{rails_7.0 → rails_8.0}/app/models/application_record.rb +0 -2
- data/rails_app/rails_8.0/app/views/layouts/mailer.html.erb +13 -0
- data/rails_app/rails_8.0/app/views/layouts/mailer.text.erb +1 -0
- data/rails_app/rails_8.0/bin/brakeman +7 -0
- data/rails_app/rails_8.0/bin/dev +2 -0
- data/rails_app/rails_8.0/bin/docker-entrypoint +14 -0
- data/rails_app/rails_8.0/bin/rails +4 -0
- data/rails_app/rails_8.0/bin/rake +4 -0
- data/rails_app/rails_8.0/bin/rubocop +8 -0
- data/rails_app/{rails_7.1 → rails_8.0}/bin/setup +11 -12
- data/rails_app/rails_8.0/bin/thrust +5 -0
- data/rails_app/{rails_7.1 → rails_8.0}/config/application.rb +14 -16
- data/rails_app/rails_8.0/config/boot.rb +3 -0
- data/rails_app/rails_8.0/config/cable.yml +10 -0
- data/rails_app/rails_8.0/config/credentials.yml.enc +1 -0
- data/rails_app/{rails_7.1 → rails_8.0}/config/database.yml +18 -2
- data/rails_app/{rails_6.1 → rails_8.0}/config/environment.rb +1 -3
- data/rails_app/rails_8.0/config/environments/development.rb +70 -0
- data/rails_app/rails_8.0/config/environments/production.rb +86 -0
- data/rails_app/{rails_7.1 → rails_8.0}/config/environments/test.rb +16 -19
- data/rails_app/{rails_7.1 → rails_8.0}/config/initializers/cors.rb +0 -1
- data/rails_app/{rails_7.1 → rails_8.0}/config/initializers/filter_parameter_logging.rb +2 -4
- data/rails_app/{rails_7.0 → rails_8.0}/config/initializers/inflections.rb +0 -1
- data/rails_app/rails_8.0/config/puma.rb +41 -0
- data/rails_app/{rails_7.1 → rails_8.0}/config/routes.rb +1 -3
- data/rails_app/rails_8.0/config/storage.yml +34 -0
- data/rails_app/{rails_7.1 → rails_8.0}/config.ru +1 -3
- data/rails_app/{rails_7.1 → rails_8.0}/db/seeds.rb +0 -1
- data/rails_app/{rails_7.1 → rails_8.0}/spec/rails_helper.rb +1 -1
- data/rails_app/rails_8.1/.dockerignore +45 -0
- data/rails_app/rails_8.1/.gitattributes +9 -0
- data/rails_app/rails_8.1/.github/workflows/ci.yml +52 -0
- data/rails_app/rails_8.1/.gitignore +33 -0
- data/rails_app/rails_8.1/.rspec +1 -0
- data/rails_app/rails_8.1/.rubocop.yml +8 -0
- data/rails_app/rails_8.1/.ruby-version +1 -0
- data/rails_app/rails_8.1/Dockerfile +68 -0
- data/rails_app/rails_8.1/Gemfile +15 -0
- data/rails_app/rails_8.1/Gemfile.lock +289 -0
- data/rails_app/{rails_7.0 → rails_8.1}/Rakefile +1 -3
- data/rails_app/{rails_6.1 → rails_8.1}/app/controllers/application_controller.rb +0 -2
- data/rails_app/rails_8.1/app/jobs/application_job.rb +7 -0
- data/rails_app/rails_8.1/app/mailers/application_mailer.rb +4 -0
- data/rails_app/{rails_7.1 → rails_8.1}/app/models/application_record.rb +0 -2
- data/rails_app/rails_8.1/app/views/layouts/mailer.html.erb +13 -0
- data/rails_app/rails_8.1/app/views/layouts/mailer.text.erb +1 -0
- data/rails_app/rails_8.1/bin/brakeman +7 -0
- data/rails_app/rails_8.1/bin/bundler-audit +6 -0
- data/rails_app/rails_8.1/bin/ci +6 -0
- data/rails_app/rails_8.1/bin/dev +2 -0
- data/rails_app/{rails_7.1 → rails_8.1}/bin/docker-entrypoint +1 -1
- data/rails_app/rails_8.1/bin/rails +4 -0
- data/rails_app/rails_8.1/bin/rake +4 -0
- data/rails_app/rails_8.1/bin/rubocop +8 -0
- data/rails_app/{rails_7.0 → rails_8.1}/bin/setup +13 -13
- data/rails_app/rails_8.1/bin/thrust +5 -0
- data/rails_app/{rails_6.1 → rails_8.1}/config/application.rb +19 -17
- data/rails_app/rails_8.1/config/boot.rb +3 -0
- data/rails_app/rails_8.1/config/bundler-audit.yml +5 -0
- data/rails_app/rails_8.1/config/cable.yml +10 -0
- data/rails_app/rails_8.1/config/ci.rb +19 -0
- data/rails_app/rails_8.1/config/credentials.yml.enc +1 -0
- data/rails_app/rails_8.1/config/database.yml +40 -0
- data/rails_app/{rails_7.0 → rails_8.1}/config/environment.rb +1 -3
- data/rails_app/rails_8.1/config/environments/development.rb +73 -0
- data/rails_app/rails_8.1/config/environments/production.rb +86 -0
- data/rails_app/rails_8.1/config/environments/test.rb +53 -0
- data/rails_app/{rails_7.0 → rails_8.1}/config/initializers/cors.rb +1 -2
- data/rails_app/rails_8.1/config/initializers/filter_parameter_logging.rb +8 -0
- data/rails_app/{rails_7.1 → rails_8.1}/config/initializers/inflections.rb +0 -1
- data/rails_app/rails_8.1/config/locales/en.yml +31 -0
- data/rails_app/rails_8.1/config/puma.rb +42 -0
- data/rails_app/rails_8.1/config/routes.rb +10 -0
- data/rails_app/rails_8.1/config/storage.yml +27 -0
- data/rails_app/{rails_7.0 → rails_8.1}/config.ru +1 -3
- data/rails_app/rails_8.1/db/seeds.rb +9 -0
- data/rails_app/{rails_6.1 → rails_8.1}/spec/rails_helper.rb +1 -2
- metadata +139 -136
- data/.circleci/config.yml +0 -344
- data/README.jp.md +0 -785
- data/gemfiles/rails_7.0.gemfile +0 -15
- data/my_api/.envrc.skeleton +0 -3
- data/my_api/.jetskeep +0 -1
- data/my_api/Procfile +0 -7
- data/my_api/app/helpers/application_helper.rb +0 -5
- data/my_api/app/jobs/application_job.rb +0 -7
- data/my_api/app/models/application_item.rb +0 -5
- data/my_api/config/dynamodb.yml +0 -22
- data/my_api/spec/controllers/error_controller_spec.rb +0 -43
- data/my_api/spec/controllers/header_controller_spec.rb +0 -33
- data/my_api/spec/controllers/pagination_controller_spec.rb +0 -73
- data/my_api/spec/controllers/rest_controller_spec.rb +0 -99
- data/my_api/spec/controllers/status_controller_spec.rb +0 -47
- data/my_api/spec/fixtures/payloads/posts-index.json +0 -51
- data/my_api/spec/fixtures/payloads/posts-show.json +0 -53
- data/rails_app/rails_6.1/.rspec +0 -3
- data/rails_app/rails_6.1/Gemfile +0 -17
- data/rails_app/rails_6.1/Gemfile.lock +0 -195
- data/rails_app/rails_6.1/app/models/application_record.rb +0 -5
- data/rails_app/rails_6.1/bin/bundle +0 -122
- data/rails_app/rails_6.1/bin/rails +0 -6
- data/rails_app/rails_6.1/bin/rake +0 -6
- data/rails_app/rails_6.1/bin/setup +0 -35
- data/rails_app/rails_6.1/config/credentials.yml.enc +0 -1
- data/rails_app/rails_6.1/config/database.yml +0 -25
- data/rails_app/rails_6.1/config/environments/development.rb +0 -59
- data/rails_app/rails_6.1/config/environments/production.rb +0 -97
- data/rails_app/rails_6.1/config/environments/test.rb +0 -51
- data/rails_app/rails_6.1/config/initializers/application_controller_renderer.rb +0 -9
- data/rails_app/rails_6.1/config/initializers/backtrace_silencers.rb +0 -10
- data/rails_app/rails_6.1/config/initializers/cors.rb +0 -17
- data/rails_app/rails_6.1/config/initializers/filter_parameter_logging.rb +0 -8
- data/rails_app/rails_6.1/config/initializers/inflections.rb +0 -17
- data/rails_app/rails_6.1/config/initializers/mime_types.rb +0 -5
- data/rails_app/rails_6.1/config/initializers/wrap_parameters.rb +0 -16
- data/rails_app/rails_6.1/config/locales/en.yml +0 -33
- data/rails_app/rails_6.1/config/routes.rb +0 -5
- data/rails_app/rails_6.1/config.ru +0 -8
- data/rails_app/rails_6.1/db/seeds.rb +0 -8
- data/rails_app/rails_7.0/Gemfile +0 -13
- data/rails_app/rails_7.0/Gemfile.lock +0 -212
- data/rails_app/rails_7.0/app/controllers/application_controller.rb +0 -4
- data/rails_app/rails_7.0/bin/bundle +0 -122
- data/rails_app/rails_7.0/bin/rails +0 -6
- data/rails_app/rails_7.0/bin/rake +0 -6
- data/rails_app/rails_7.0/config/application.rb +0 -41
- data/rails_app/rails_7.0/config/boot.rb +0 -5
- data/rails_app/rails_7.0/config/credentials.yml.enc +0 -1
- data/rails_app/rails_7.0/config/database.yml +0 -25
- data/rails_app/rails_7.0/config/environments/development.rb +0 -58
- data/rails_app/rails_7.0/config/environments/production.rb +0 -70
- data/rails_app/rails_7.0/config/environments/test.rb +0 -52
- data/rails_app/rails_7.0/config/initializers/filter_parameter_logging.rb +0 -8
- data/rails_app/rails_7.0/config/locales/en.yml +0 -33
- data/rails_app/rails_7.0/config/routes.rb +0 -8
- data/rails_app/rails_7.0/db/seeds.rb +0 -8
- data/rails_app/rails_7.1/Gemfile +0 -16
- data/rails_app/rails_7.1/Gemfile.lock +0 -241
- data/rails_app/rails_7.1/README.md +0 -24
- data/rails_app/rails_7.1/Rakefile +0 -8
- data/rails_app/rails_7.1/bin/bundle +0 -122
- data/rails_app/rails_7.1/bin/rails +0 -6
- data/rails_app/rails_7.1/bin/rake +0 -6
- data/rails_app/rails_7.1/config/boot.rb +0 -5
- data/rails_app/rails_7.1/config/credentials.yml.enc +0 -1
- data/rails_app/rails_7.1/config/environments/development.rb +0 -58
- data/rails_app/rails_7.1/config/environments/production.rb +0 -74
- data/rails_app/rails_7.1/config/puma.rb +0 -46
- data/rails_app/rails_7.1/public/robots.txt +0 -2
- data/rails_app/rails_7.1/spec/spec_helper.rb +0 -13
- data/rails_app/rails_7.1/vendor/.keep +0 -0
- data/rails_app/rails_7.2/.github/dependabot.yml +0 -12
- /data/rails_app/{rails_7.1 → rails_8.0}/.rspec +0 -0
- /data/rails_app/{rails_6.1 → rails_8.0}/README.md +0 -0
- /data/rails_app/{rails_6.1 → rails_8.0}/app/controllers/concerns/.keep +0 -0
- /data/rails_app/{rails_6.1/app/javascript → rails_8.0/app/models/concerns}/.keep +0 -0
- /data/rails_app/{rails_7.1 → rails_8.0}/config/locales/en.yml +0 -0
- /data/rails_app/{rails_6.1/app/models/concerns → rails_8.0/lib/tasks}/.keep +0 -0
- /data/rails_app/{rails_6.1/lib/tasks → rails_8.0/log}/.keep +0 -0
- /data/rails_app/{rails_6.1 → rails_8.0}/public/robots.txt +0 -0
- /data/rails_app/{rails_6.1/tmp → rails_8.0/script}/.keep +0 -0
- /data/rails_app/{rails_6.1 → rails_8.0}/spec/spec_helper.rb +0 -0
- /data/rails_app/{rails_6.1/tmp/pids → rails_8.0/storage}/.keep +0 -0
- /data/rails_app/{rails_6.1 → rails_8.0}/vendor/.keep +0 -0
- /data/rails_app/{rails_7.0 → rails_8.1}/README.md +0 -0
- /data/rails_app/{rails_7.1 → rails_8.1}/app/controllers/concerns/.keep +0 -0
- /data/rails_app/{rails_7.1 → rails_8.1}/app/models/concerns/.keep +0 -0
- /data/rails_app/{rails_7.1 → rails_8.1}/lib/tasks/.keep +0 -0
- /data/rails_app/{rails_7.1/storage → rails_8.1/log}/.keep +0 -0
- /data/rails_app/{rails_7.0 → rails_8.1}/public/robots.txt +0 -0
- /data/rails_app/{rails_7.1/tmp → rails_8.1/script}/.keep +0 -0
- /data/rails_app/{rails_7.0 → rails_8.1}/spec/spec_helper.rb +0 -0
- /data/rails_app/{rails_7.1/tmp/pids → rails_8.1/storage}/.keep +0 -0
- /data/rails_app/{rails_7.1/tmp/storage → rails_8.1/vendor}/.keep +0 -0
data/docker-compose.yml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
services:
|
|
2
|
+
my_api:
|
|
3
|
+
build:
|
|
4
|
+
context: ./my_api
|
|
5
|
+
dockerfile: Dockerfile
|
|
6
|
+
environment:
|
|
7
|
+
RAILS_ENV: development
|
|
8
|
+
volumes:
|
|
9
|
+
- ./my_api:/app
|
|
10
|
+
ports:
|
|
11
|
+
- "38080:3000"
|
|
12
|
+
healthcheck:
|
|
13
|
+
test: ["CMD", "curl", "-fsS", "http://localhost:3000/status/200"]
|
|
14
|
+
interval: 5s
|
|
15
|
+
timeout: 3s
|
|
16
|
+
retries: 20
|
|
17
|
+
|
|
18
|
+
test:
|
|
19
|
+
build:
|
|
20
|
+
context: .
|
|
21
|
+
dockerfile: Dockerfile
|
|
22
|
+
environment:
|
|
23
|
+
MY_API_ENDPOINT: http://my_api:3000
|
|
24
|
+
volumes:
|
|
25
|
+
- .:/app
|
|
26
|
+
depends_on:
|
|
27
|
+
my_api:
|
|
28
|
+
condition: service_healthy
|
|
29
|
+
command: bash
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Dependabot PR Review and Auto-Merge Runbook
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
This runbook standardizes how to review Dependabot pull requests for GitHub Actions updates and safely enable auto-merge.
|
|
5
|
+
|
|
6
|
+
## Scope
|
|
7
|
+
- Target: PRs created by Dependabot that update GitHub Actions versions (for example, `actions/upload-artifact`).
|
|
8
|
+
- Primary workflow file in this repository: `.github/workflows/ci.yml`.
|
|
9
|
+
- This runbook is for PR operation only, so creating a dedicated local work branch is normally unnecessary.
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
- `gh` CLI is authenticated and can access `ryz310/my_api_client`.
|
|
13
|
+
- You have permission to comment on and merge PRs.
|
|
14
|
+
- Branch protection rules and required checks are configured on GitHub.
|
|
15
|
+
- Before starting the runbook, update local `master` and re-read `AGENTS.md`.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git checkout master
|
|
19
|
+
git fetch origin
|
|
20
|
+
git pull --ff-only origin master
|
|
21
|
+
sed -n '1,260p' AGENTS.md
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Auto-merge workflow policy
|
|
25
|
+
- Keep `package-ecosystem` decisions separated in `.github/workflows/dependabot-auto-merge.yml`.
|
|
26
|
+
- Apply independent conditions for each ecosystem to avoid cross-ecosystem condition mixing.
|
|
27
|
+
- For `github-actions` ecosystem auto-merge, require all of the following:
|
|
28
|
+
- GitHub official actions only (`actions/*` or `github/*`)
|
|
29
|
+
- non-major updates only (patch/minor)
|
|
30
|
+
- no changes related to `permissions` or `pull_request_target`
|
|
31
|
+
- CI pass/fail gating is controlled by branch protection and required checks on GitHub.
|
|
32
|
+
|
|
33
|
+
## Step-by-step
|
|
34
|
+
1. Open PR metadata and changed files.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
gh pr view <PR_NUMBER> --json number,title,author,baseRefName,headRefName,files,body
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
2. Validate that the PR is in scope.
|
|
41
|
+
- Confirm `author.login` is `app/dependabot`.
|
|
42
|
+
- Confirm changed files are GitHub Actions workflow/dependabot update files and the update target is GitHub Actions.
|
|
43
|
+
- If either condition is not met, stop this runbook and notify the user that manual review is required.
|
|
44
|
+
|
|
45
|
+
3. Review the exact diff and identify action version changes.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
gh pr diff <PR_NUMBER>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
4. Summarize impact from the diff and release notes.
|
|
52
|
+
- Explain what functional changes are introduced by each action version bump.
|
|
53
|
+
- Explain whether existing workflows are affected (runtime requirements, minimum runner version, breaking changes, behavior changes such as credential handling).
|
|
54
|
+
- For major version updates, verify compatibility notes in the official release notes.
|
|
55
|
+
- Post this summary to the user and ask for explicit approval to proceed.
|
|
56
|
+
|
|
57
|
+
5. Only after user approval, enable auto-merge.
|
|
58
|
+
- Use repository default merge method unless there is an explicit instruction to force squash merge.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
gh pr merge <PR_NUMBER> --auto
|
|
62
|
+
# Optional (only when squash is explicitly required):
|
|
63
|
+
# gh pr merge <PR_NUMBER> --auto --squash
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
6. Check merge state.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
gh pr view <PR_NUMBER> --json state,mergeStateStatus,autoMergeRequest
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
7. If `mergeStateStatus` is `BEHIND`, post a Dependabot rebase comment (also only after user approval from Step 4).
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
gh pr comment <PR_NUMBER> --body "@dependabot rebase"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
8. Re-check status until the branch is up to date and required checks pass.
|
|
79
|
+
- After posting `@dependabot rebase`, wait 1 minute before retrying.
|
|
80
|
+
- If rebase has not started after 1 minute (for example, `mergeStateStatus` is still `BEHIND`), post `@dependabot rebase` again.
|
|
81
|
+
- Retry comment posting up to 2 times in total. If it is still `BEHIND` after the second retry, stop and escalate for manual follow-up.
|
|
82
|
+
- Run each command step-by-step and inspect output after each `gh pr view` call before deciding the next action.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Check current state
|
|
86
|
+
gh pr view <PR_NUMBER> --json state,mergeStateStatus,statusCheckRollup,autoMergeRequest
|
|
87
|
+
|
|
88
|
+
# If mergeStateStatus is BEHIND, wait 1 minute
|
|
89
|
+
sleep 60
|
|
90
|
+
|
|
91
|
+
# Re-check after waiting
|
|
92
|
+
gh pr view <PR_NUMBER> --json state,mergeStateStatus,statusCheckRollup,autoMergeRequest
|
|
93
|
+
|
|
94
|
+
# If still BEHIND, post @dependabot rebase (up to 2 retries total)
|
|
95
|
+
# gh pr comment <PR_NUMBER> --body "@dependabot rebase"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Done criteria
|
|
99
|
+
- `autoMergeRequest` is enabled.
|
|
100
|
+
- `mergeStateStatus` is not `BEHIND`.
|
|
101
|
+
- Required CI checks are green.
|
|
102
|
+
- PR is merged automatically, or clearly waiting only on pending required checks.
|
|
103
|
+
- The user-approved impact summary is recorded in the operation log/comment thread.
|
|
104
|
+
|
|
105
|
+
## Failure handling
|
|
106
|
+
- If rebase does not start, wait 1 minute, confirm `mergeStateStatus` is still `BEHIND`, then re-run comment (up to 2 retries total):
|
|
107
|
+
- `@dependabot rebase`
|
|
108
|
+
- Execute checks and retries sequentially (check -> wait -> re-check -> comment) rather than chaining commands without inspection.
|
|
109
|
+
- If it is still `BEHIND` after 2 retries, stop automated retries and notify the user for manual follow-up.
|
|
110
|
+
- If checks fail, inspect failing jobs and decide:
|
|
111
|
+
- fix in a follow-up PR, or
|
|
112
|
+
- close/ignore that update version with Dependabot commands.
|
|
113
|
+
- If the update introduces breaking changes, disable auto-merge and switch to manual review with explicit test evidence.
|
data/gemfiles/rails_7.2.gemfile
CHANGED
|
@@ -6,10 +6,10 @@ source 'https://rubygems.org'
|
|
|
6
6
|
|
|
7
7
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
8
8
|
|
|
9
|
-
gem 'activesupport', '~>
|
|
9
|
+
gem 'activesupport', '~> 8.0.0'
|
|
10
10
|
|
|
11
11
|
group :integrations, optional: true do
|
|
12
|
-
gem 'bugsnag', '>= 6.
|
|
12
|
+
gem 'bugsnag', '>= 6.19.0'
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
gemspec
|
|
@@ -6,10 +6,10 @@ source 'https://rubygems.org'
|
|
|
6
6
|
|
|
7
7
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
8
8
|
|
|
9
|
-
gem 'activesupport', '~>
|
|
9
|
+
gem 'activesupport', '~> 8.1.0'
|
|
10
10
|
|
|
11
11
|
group :integrations, optional: true do
|
|
12
|
-
gem 'bugsnag', '>= 6.
|
|
12
|
+
gem 'bugsnag', '>= 6.19.0'
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
gemspec
|
|
@@ -31,7 +31,7 @@ module MyApiClient
|
|
|
31
31
|
error_handling status_code: 417, raise: ClientError::ExpectationFailed
|
|
32
32
|
error_handling status_code: 418, raise: ClientError::IamTeapot
|
|
33
33
|
error_handling status_code: 421, raise: ClientError::MisdirectedRequest
|
|
34
|
-
error_handling status_code: 422, raise: ClientError::
|
|
34
|
+
error_handling status_code: 422, raise: ClientError::UnprocessableContent
|
|
35
35
|
error_handling status_code: 423, raise: ClientError::Locked
|
|
36
36
|
error_handling status_code: 424, raise: ClientError::FailedDependency
|
|
37
37
|
error_handling status_code: 425, raise: ClientError::TooEarly
|
|
@@ -63,9 +63,13 @@ module MyApiClient
|
|
|
63
63
|
# 421 Misdirected Request
|
|
64
64
|
class MisdirectedRequest < ClientError; end
|
|
65
65
|
|
|
66
|
-
# 422 Unprocessable Entity
|
|
66
|
+
# 422 Unprocessable Entity (Deprecated)
|
|
67
67
|
class UnprocessableEntity < ClientError; end
|
|
68
68
|
|
|
69
|
+
# 422 Unprocessable Content
|
|
70
|
+
class UnprocessableContent < UnprocessableEntity; end
|
|
71
|
+
deprecate_constant :UnprocessableEntity
|
|
72
|
+
|
|
69
73
|
# 423 Locked
|
|
70
74
|
class Locked < ClientError; end
|
|
71
75
|
|
data/lib/my_api_client.rb
CHANGED
|
@@ -33,7 +33,7 @@ require 'my_api_client/sleeper'
|
|
|
33
33
|
# Loads gems for feature of integrations
|
|
34
34
|
begin
|
|
35
35
|
require 'bugsnag'
|
|
36
|
-
require 'my_api_client/integrations/bugsnag' if defined?(Bugsnag) && Bugsnag::VERSION >= '6.
|
|
36
|
+
require 'my_api_client/integrations/bugsnag' if defined?(Bugsnag) && Bugsnag::VERSION >= '6.19.0'
|
|
37
37
|
rescue LoadError
|
|
38
38
|
nil
|
|
39
39
|
end
|
data/my_api/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0
|
data/my_api/AGENTS.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# my_api AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Current Stack Policy
|
|
4
|
+
|
|
5
|
+
- `my_api/` is a Rails 8.1 API-only application.
|
|
6
|
+
- Use the latest supported Ruby version for `my_api/`.
|
|
7
|
+
- Keep these files aligned when Ruby or runtime settings change:
|
|
8
|
+
- `my_api/.ruby-version`
|
|
9
|
+
- `my_api/Dockerfile`
|
|
10
|
+
- `docker-compose.yml`
|
|
11
|
+
- `.github/workflows/ci.yml` (integration job)
|
|
12
|
+
|
|
13
|
+
## API Compatibility Policy
|
|
14
|
+
|
|
15
|
+
- Keep endpoint behavior compatible with integration specs under `spec/integrations/api_clients/`.
|
|
16
|
+
- If endpoint behavior changes, update both:
|
|
17
|
+
- `my_api/app/controllers/*`
|
|
18
|
+
- related specs in `spec/integrations/api_clients/*_spec.rb`
|
|
19
|
+
- Keep an HTTP mapping comment above each controller action in this format:
|
|
20
|
+
- `# GET /path`
|
|
21
|
+
- `# POST /path`
|
|
22
|
+
- `# PUT/PATCH /path/:id`
|
|
23
|
+
- `# DELETE /path/:id`
|
|
24
|
+
|
|
25
|
+
## Test Execution Policy
|
|
26
|
+
|
|
27
|
+
- Run real HTTP integration tests with Docker Compose:
|
|
28
|
+
1. `docker compose up -d --build my_api`
|
|
29
|
+
2. `docker compose run --rm test`
|
|
30
|
+
3. `docker compose down --volumes --remove-orphans`
|
|
31
|
+
|
|
32
|
+
## Implementation Scope Policy
|
|
33
|
+
|
|
34
|
+
- Do not reintroduce Ruby on Jets specific dependencies or configuration.
|
|
35
|
+
- Keep `my_api/` focused on fixture endpoints for `my_api_client` integration tests.
|
data/my_api/Dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1
|
|
2
|
+
|
|
3
|
+
ARG RUBY_VERSION=4.0
|
|
4
|
+
FROM ruby:${RUBY_VERSION}-slim
|
|
5
|
+
|
|
6
|
+
WORKDIR /app
|
|
7
|
+
|
|
8
|
+
RUN apt-get update -qq && \
|
|
9
|
+
apt-get install --no-install-recommends -y build-essential curl git libyaml-dev pkg-config && \
|
|
10
|
+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
|
11
|
+
|
|
12
|
+
ENV BUNDLE_PATH=/usr/local/bundle \
|
|
13
|
+
BUNDLE_JOBS=4 \
|
|
14
|
+
BUNDLE_RETRY=3
|
|
15
|
+
|
|
16
|
+
RUN gem install bundler -v "~> 2.0"
|
|
17
|
+
|
|
18
|
+
COPY Gemfile Gemfile.lock /app/
|
|
19
|
+
RUN bundle install
|
|
20
|
+
|
|
21
|
+
COPY . /app
|
|
22
|
+
|
|
23
|
+
EXPOSE 3000
|
|
24
|
+
|
|
25
|
+
CMD ["bundle", "exec", "rackup", "-o", "0.0.0.0", "-p", "3000"]
|
data/my_api/Gemfile
CHANGED
|
@@ -2,25 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
|
-
gem '
|
|
5
|
+
gem 'puma', '>= 6.0'
|
|
6
|
+
gem 'rails', '~> 8.1.3'
|
|
6
7
|
|
|
7
|
-
gem 'dynomite'
|
|
8
|
-
|
|
9
|
-
# See: https://github.com/boltops-tools/jets/issues/523
|
|
10
|
-
gem 'nokogiri', '~> 1.17.2'
|
|
11
|
-
|
|
12
|
-
# development and test groups are not bundled as part of the deployment
|
|
13
8
|
group :development, :test do
|
|
14
|
-
|
|
15
|
-
gem 'byebug', platforms: %i[mri mingw x64_mingw]
|
|
16
|
-
gem 'puma'
|
|
17
|
-
gem 'rack'
|
|
18
|
-
gem 'shotgun'
|
|
9
|
+
gem 'rspec-rails'
|
|
19
10
|
end
|
|
20
11
|
|
|
21
12
|
group :test do
|
|
22
|
-
gem '
|
|
23
|
-
gem '
|
|
24
|
-
gem 'rspec'
|
|
25
|
-
gem 'rspec_junit_formatter'
|
|
13
|
+
gem 'simplecov'
|
|
14
|
+
gem 'simplecov_json_formatter'
|
|
26
15
|
end
|