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.
Files changed (248) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +8 -0
  3. data/.envrc.skeleton +0 -1
  4. data/.github/dependabot.yml +82 -7
  5. data/.github/workflows/ci.yml +334 -0
  6. data/.github/workflows/dependabot-auto-merge.yml +96 -0
  7. data/.github/workflows/release.yml +33 -0
  8. data/.github/workflows/rubocop_challenge.yml +33 -0
  9. data/.gitignore +1 -0
  10. data/.rubocop.yml +1 -1
  11. data/.ruby-version +1 -1
  12. data/AGENTS.md +128 -0
  13. data/CHANGELOG.md +54 -2
  14. data/CLAUDE.md +6 -0
  15. data/Dockerfile +22 -0
  16. data/Gemfile +1 -1
  17. data/Gemfile.lock +67 -59
  18. data/README.md +398 -62
  19. data/docker-compose.yml +29 -0
  20. data/docs/runbooks/dependabot_pr_auto_merge.md +113 -0
  21. data/gemfiles/rails_7.2.gemfile +1 -1
  22. data/gemfiles/{rails_7.1.gemfile → rails_8.0.gemfile} +2 -2
  23. data/gemfiles/{rails_6.1.gemfile → rails_8.1.gemfile} +2 -2
  24. data/lib/my_api_client/default_error_handlers.rb +1 -1
  25. data/lib/my_api_client/errors/client_error.rb +5 -1
  26. data/lib/my_api_client/integrations/bugsnag.rb +1 -1
  27. data/lib/my_api_client/version.rb +1 -1
  28. data/lib/my_api_client.rb +1 -1
  29. data/my_api/.ruby-version +1 -1
  30. data/my_api/AGENTS.md +35 -0
  31. data/my_api/Dockerfile +25 -0
  32. data/my_api/Gemfile +5 -16
  33. data/my_api/Gemfile.lock +263 -228
  34. data/my_api/README.md +36 -25
  35. data/my_api/Rakefile +3 -2
  36. data/my_api/app/controllers/application_controller.rb +1 -2
  37. data/my_api/app/controllers/error_controller.rb +2 -2
  38. data/my_api/app/controllers/header_controller.rb +6 -3
  39. data/my_api/app/controllers/pagination_controller.rb +5 -15
  40. data/my_api/app/controllers/rest_controller.rb +12 -16
  41. data/my_api/app/controllers/status_controller.rb +3 -4
  42. data/my_api/config/application.rb +12 -67
  43. data/{rails_app/rails_6.1 → my_api}/config/boot.rb +1 -1
  44. data/{rails_app/rails_7.1 → my_api}/config/environment.rb +0 -2
  45. data/my_api/config/environments/development.rb +6 -6
  46. data/my_api/config/environments/production.rb +5 -8
  47. data/my_api/config/environments/test.rb +5 -6
  48. data/my_api/config/routes.rb +2 -10
  49. data/my_api/config.ru +2 -4
  50. data/my_api/public/index.html +10 -90
  51. data/{rails_app/rails_7.0 → my_api}/spec/rails_helper.rb +3 -4
  52. data/my_api/spec/requests/error_controller_spec.rb +18 -0
  53. data/my_api/spec/requests/pagination_controller_spec.rb +22 -0
  54. data/my_api/spec/requests/rest_controller_spec.rb +22 -0
  55. data/my_api/spec/requests/status_controller_spec.rb +20 -0
  56. data/my_api/spec/spec_helper.rb +15 -23
  57. data/my_api_client.gemspec +2 -2
  58. data/rails_app/AGENTS.md +13 -0
  59. data/rails_app/rails_7.2/Dockerfile +1 -1
  60. data/rails_app/rails_7.2/Gemfile +2 -0
  61. data/rails_app/rails_7.2/Gemfile.lock +143 -122
  62. data/rails_app/{rails_7.1 → rails_8.0}/.dockerignore +16 -2
  63. data/rails_app/{rails_6.1 → rails_8.0}/.gitattributes +2 -1
  64. data/rails_app/rails_8.0/.github/workflows/ci.yml +39 -0
  65. data/rails_app/{rails_6.1 → rails_8.0}/.gitignore +11 -7
  66. data/rails_app/rails_8.0/.rubocop.yml +8 -0
  67. data/rails_app/rails_8.0/.ruby-version +1 -0
  68. data/rails_app/{rails_7.1 → rails_8.0}/Dockerfile +28 -18
  69. data/rails_app/rails_8.0/Gemfile +15 -0
  70. data/rails_app/rails_8.0/Gemfile.lock +286 -0
  71. data/rails_app/{rails_6.1 → rails_8.0}/Rakefile +1 -3
  72. data/rails_app/{rails_7.1 → rails_8.0}/app/controllers/application_controller.rb +0 -2
  73. data/rails_app/rails_8.0/app/jobs/application_job.rb +7 -0
  74. data/rails_app/rails_8.0/app/mailers/application_mailer.rb +4 -0
  75. data/rails_app/{rails_7.0 → rails_8.0}/app/models/application_record.rb +0 -2
  76. data/rails_app/rails_8.0/app/views/layouts/mailer.html.erb +13 -0
  77. data/rails_app/rails_8.0/app/views/layouts/mailer.text.erb +1 -0
  78. data/rails_app/rails_8.0/bin/brakeman +7 -0
  79. data/rails_app/rails_8.0/bin/dev +2 -0
  80. data/rails_app/rails_8.0/bin/docker-entrypoint +14 -0
  81. data/rails_app/rails_8.0/bin/rails +4 -0
  82. data/rails_app/rails_8.0/bin/rake +4 -0
  83. data/rails_app/rails_8.0/bin/rubocop +8 -0
  84. data/rails_app/{rails_7.1 → rails_8.0}/bin/setup +11 -12
  85. data/rails_app/rails_8.0/bin/thrust +5 -0
  86. data/rails_app/{rails_7.1 → rails_8.0}/config/application.rb +14 -16
  87. data/rails_app/rails_8.0/config/boot.rb +3 -0
  88. data/rails_app/rails_8.0/config/cable.yml +10 -0
  89. data/rails_app/rails_8.0/config/credentials.yml.enc +1 -0
  90. data/rails_app/{rails_7.1 → rails_8.0}/config/database.yml +18 -2
  91. data/rails_app/{rails_6.1 → rails_8.0}/config/environment.rb +1 -3
  92. data/rails_app/rails_8.0/config/environments/development.rb +70 -0
  93. data/rails_app/rails_8.0/config/environments/production.rb +86 -0
  94. data/rails_app/{rails_7.1 → rails_8.0}/config/environments/test.rb +16 -19
  95. data/rails_app/{rails_7.1 → rails_8.0}/config/initializers/cors.rb +0 -1
  96. data/rails_app/{rails_7.1 → rails_8.0}/config/initializers/filter_parameter_logging.rb +2 -4
  97. data/rails_app/{rails_7.0 → rails_8.0}/config/initializers/inflections.rb +0 -1
  98. data/rails_app/rails_8.0/config/puma.rb +41 -0
  99. data/rails_app/{rails_7.1 → rails_8.0}/config/routes.rb +1 -3
  100. data/rails_app/rails_8.0/config/storage.yml +34 -0
  101. data/rails_app/{rails_7.1 → rails_8.0}/config.ru +1 -3
  102. data/rails_app/{rails_7.1 → rails_8.0}/db/seeds.rb +0 -1
  103. data/rails_app/{rails_7.1 → rails_8.0}/spec/rails_helper.rb +1 -1
  104. data/rails_app/rails_8.1/.dockerignore +45 -0
  105. data/rails_app/rails_8.1/.gitattributes +9 -0
  106. data/rails_app/rails_8.1/.github/workflows/ci.yml +52 -0
  107. data/rails_app/rails_8.1/.gitignore +33 -0
  108. data/rails_app/rails_8.1/.rspec +1 -0
  109. data/rails_app/rails_8.1/.rubocop.yml +8 -0
  110. data/rails_app/rails_8.1/.ruby-version +1 -0
  111. data/rails_app/rails_8.1/Dockerfile +68 -0
  112. data/rails_app/rails_8.1/Gemfile +15 -0
  113. data/rails_app/rails_8.1/Gemfile.lock +289 -0
  114. data/rails_app/{rails_7.0 → rails_8.1}/Rakefile +1 -3
  115. data/rails_app/{rails_6.1 → rails_8.1}/app/controllers/application_controller.rb +0 -2
  116. data/rails_app/rails_8.1/app/jobs/application_job.rb +7 -0
  117. data/rails_app/rails_8.1/app/mailers/application_mailer.rb +4 -0
  118. data/rails_app/{rails_7.1 → rails_8.1}/app/models/application_record.rb +0 -2
  119. data/rails_app/rails_8.1/app/views/layouts/mailer.html.erb +13 -0
  120. data/rails_app/rails_8.1/app/views/layouts/mailer.text.erb +1 -0
  121. data/rails_app/rails_8.1/bin/brakeman +7 -0
  122. data/rails_app/rails_8.1/bin/bundler-audit +6 -0
  123. data/rails_app/rails_8.1/bin/ci +6 -0
  124. data/rails_app/rails_8.1/bin/dev +2 -0
  125. data/rails_app/{rails_7.1 → rails_8.1}/bin/docker-entrypoint +1 -1
  126. data/rails_app/rails_8.1/bin/rails +4 -0
  127. data/rails_app/rails_8.1/bin/rake +4 -0
  128. data/rails_app/rails_8.1/bin/rubocop +8 -0
  129. data/rails_app/{rails_7.0 → rails_8.1}/bin/setup +13 -13
  130. data/rails_app/rails_8.1/bin/thrust +5 -0
  131. data/rails_app/{rails_6.1 → rails_8.1}/config/application.rb +19 -17
  132. data/rails_app/rails_8.1/config/boot.rb +3 -0
  133. data/rails_app/rails_8.1/config/bundler-audit.yml +5 -0
  134. data/rails_app/rails_8.1/config/cable.yml +10 -0
  135. data/rails_app/rails_8.1/config/ci.rb +19 -0
  136. data/rails_app/rails_8.1/config/credentials.yml.enc +1 -0
  137. data/rails_app/rails_8.1/config/database.yml +40 -0
  138. data/rails_app/{rails_7.0 → rails_8.1}/config/environment.rb +1 -3
  139. data/rails_app/rails_8.1/config/environments/development.rb +73 -0
  140. data/rails_app/rails_8.1/config/environments/production.rb +86 -0
  141. data/rails_app/rails_8.1/config/environments/test.rb +53 -0
  142. data/rails_app/{rails_7.0 → rails_8.1}/config/initializers/cors.rb +1 -2
  143. data/rails_app/rails_8.1/config/initializers/filter_parameter_logging.rb +8 -0
  144. data/rails_app/{rails_7.1 → rails_8.1}/config/initializers/inflections.rb +0 -1
  145. data/rails_app/rails_8.1/config/locales/en.yml +31 -0
  146. data/rails_app/rails_8.1/config/puma.rb +42 -0
  147. data/rails_app/rails_8.1/config/routes.rb +10 -0
  148. data/rails_app/rails_8.1/config/storage.yml +27 -0
  149. data/rails_app/{rails_7.0 → rails_8.1}/config.ru +1 -3
  150. data/rails_app/rails_8.1/db/seeds.rb +9 -0
  151. data/rails_app/{rails_6.1 → rails_8.1}/spec/rails_helper.rb +1 -2
  152. metadata +139 -136
  153. data/.circleci/config.yml +0 -344
  154. data/README.jp.md +0 -785
  155. data/gemfiles/rails_7.0.gemfile +0 -15
  156. data/my_api/.envrc.skeleton +0 -3
  157. data/my_api/.jetskeep +0 -1
  158. data/my_api/Procfile +0 -7
  159. data/my_api/app/helpers/application_helper.rb +0 -5
  160. data/my_api/app/jobs/application_job.rb +0 -7
  161. data/my_api/app/models/application_item.rb +0 -5
  162. data/my_api/config/dynamodb.yml +0 -22
  163. data/my_api/spec/controllers/error_controller_spec.rb +0 -43
  164. data/my_api/spec/controllers/header_controller_spec.rb +0 -33
  165. data/my_api/spec/controllers/pagination_controller_spec.rb +0 -73
  166. data/my_api/spec/controllers/rest_controller_spec.rb +0 -99
  167. data/my_api/spec/controllers/status_controller_spec.rb +0 -47
  168. data/my_api/spec/fixtures/payloads/posts-index.json +0 -51
  169. data/my_api/spec/fixtures/payloads/posts-show.json +0 -53
  170. data/rails_app/rails_6.1/.rspec +0 -3
  171. data/rails_app/rails_6.1/Gemfile +0 -17
  172. data/rails_app/rails_6.1/Gemfile.lock +0 -195
  173. data/rails_app/rails_6.1/app/models/application_record.rb +0 -5
  174. data/rails_app/rails_6.1/bin/bundle +0 -122
  175. data/rails_app/rails_6.1/bin/rails +0 -6
  176. data/rails_app/rails_6.1/bin/rake +0 -6
  177. data/rails_app/rails_6.1/bin/setup +0 -35
  178. data/rails_app/rails_6.1/config/credentials.yml.enc +0 -1
  179. data/rails_app/rails_6.1/config/database.yml +0 -25
  180. data/rails_app/rails_6.1/config/environments/development.rb +0 -59
  181. data/rails_app/rails_6.1/config/environments/production.rb +0 -97
  182. data/rails_app/rails_6.1/config/environments/test.rb +0 -51
  183. data/rails_app/rails_6.1/config/initializers/application_controller_renderer.rb +0 -9
  184. data/rails_app/rails_6.1/config/initializers/backtrace_silencers.rb +0 -10
  185. data/rails_app/rails_6.1/config/initializers/cors.rb +0 -17
  186. data/rails_app/rails_6.1/config/initializers/filter_parameter_logging.rb +0 -8
  187. data/rails_app/rails_6.1/config/initializers/inflections.rb +0 -17
  188. data/rails_app/rails_6.1/config/initializers/mime_types.rb +0 -5
  189. data/rails_app/rails_6.1/config/initializers/wrap_parameters.rb +0 -16
  190. data/rails_app/rails_6.1/config/locales/en.yml +0 -33
  191. data/rails_app/rails_6.1/config/routes.rb +0 -5
  192. data/rails_app/rails_6.1/config.ru +0 -8
  193. data/rails_app/rails_6.1/db/seeds.rb +0 -8
  194. data/rails_app/rails_7.0/Gemfile +0 -13
  195. data/rails_app/rails_7.0/Gemfile.lock +0 -212
  196. data/rails_app/rails_7.0/app/controllers/application_controller.rb +0 -4
  197. data/rails_app/rails_7.0/bin/bundle +0 -122
  198. data/rails_app/rails_7.0/bin/rails +0 -6
  199. data/rails_app/rails_7.0/bin/rake +0 -6
  200. data/rails_app/rails_7.0/config/application.rb +0 -41
  201. data/rails_app/rails_7.0/config/boot.rb +0 -5
  202. data/rails_app/rails_7.0/config/credentials.yml.enc +0 -1
  203. data/rails_app/rails_7.0/config/database.yml +0 -25
  204. data/rails_app/rails_7.0/config/environments/development.rb +0 -58
  205. data/rails_app/rails_7.0/config/environments/production.rb +0 -70
  206. data/rails_app/rails_7.0/config/environments/test.rb +0 -52
  207. data/rails_app/rails_7.0/config/initializers/filter_parameter_logging.rb +0 -8
  208. data/rails_app/rails_7.0/config/locales/en.yml +0 -33
  209. data/rails_app/rails_7.0/config/routes.rb +0 -8
  210. data/rails_app/rails_7.0/db/seeds.rb +0 -8
  211. data/rails_app/rails_7.1/Gemfile +0 -16
  212. data/rails_app/rails_7.1/Gemfile.lock +0 -241
  213. data/rails_app/rails_7.1/README.md +0 -24
  214. data/rails_app/rails_7.1/Rakefile +0 -8
  215. data/rails_app/rails_7.1/bin/bundle +0 -122
  216. data/rails_app/rails_7.1/bin/rails +0 -6
  217. data/rails_app/rails_7.1/bin/rake +0 -6
  218. data/rails_app/rails_7.1/config/boot.rb +0 -5
  219. data/rails_app/rails_7.1/config/credentials.yml.enc +0 -1
  220. data/rails_app/rails_7.1/config/environments/development.rb +0 -58
  221. data/rails_app/rails_7.1/config/environments/production.rb +0 -74
  222. data/rails_app/rails_7.1/config/puma.rb +0 -46
  223. data/rails_app/rails_7.1/public/robots.txt +0 -2
  224. data/rails_app/rails_7.1/spec/spec_helper.rb +0 -13
  225. data/rails_app/rails_7.1/vendor/.keep +0 -0
  226. data/rails_app/rails_7.2/.github/dependabot.yml +0 -12
  227. /data/rails_app/{rails_7.1 → rails_8.0}/.rspec +0 -0
  228. /data/rails_app/{rails_6.1 → rails_8.0}/README.md +0 -0
  229. /data/rails_app/{rails_6.1 → rails_8.0}/app/controllers/concerns/.keep +0 -0
  230. /data/rails_app/{rails_6.1/app/javascript → rails_8.0/app/models/concerns}/.keep +0 -0
  231. /data/rails_app/{rails_7.1 → rails_8.0}/config/locales/en.yml +0 -0
  232. /data/rails_app/{rails_6.1/app/models/concerns → rails_8.0/lib/tasks}/.keep +0 -0
  233. /data/rails_app/{rails_6.1/lib/tasks → rails_8.0/log}/.keep +0 -0
  234. /data/rails_app/{rails_6.1 → rails_8.0}/public/robots.txt +0 -0
  235. /data/rails_app/{rails_6.1/tmp → rails_8.0/script}/.keep +0 -0
  236. /data/rails_app/{rails_6.1 → rails_8.0}/spec/spec_helper.rb +0 -0
  237. /data/rails_app/{rails_6.1/tmp/pids → rails_8.0/storage}/.keep +0 -0
  238. /data/rails_app/{rails_6.1 → rails_8.0}/vendor/.keep +0 -0
  239. /data/rails_app/{rails_7.0 → rails_8.1}/README.md +0 -0
  240. /data/rails_app/{rails_7.1 → rails_8.1}/app/controllers/concerns/.keep +0 -0
  241. /data/rails_app/{rails_7.1 → rails_8.1}/app/models/concerns/.keep +0 -0
  242. /data/rails_app/{rails_7.1 → rails_8.1}/lib/tasks/.keep +0 -0
  243. /data/rails_app/{rails_7.1/storage → rails_8.1/log}/.keep +0 -0
  244. /data/rails_app/{rails_7.0 → rails_8.1}/public/robots.txt +0 -0
  245. /data/rails_app/{rails_7.1/tmp → rails_8.1/script}/.keep +0 -0
  246. /data/rails_app/{rails_7.0 → rails_8.1}/spec/spec_helper.rb +0 -0
  247. /data/rails_app/{rails_7.1/tmp/pids → rails_8.1/storage}/.keep +0 -0
  248. /data/rails_app/{rails_7.1/tmp/storage → rails_8.1/vendor}/.keep +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7d3471ad8b1b1fe955f65dee427f4456055a1608abbd1a6a66159a9971db727
4
- data.tar.gz: 9f3d5aa9a5f84b7b3185b3948e2608f104775fd1a9833e534fea1970dcc99d25
3
+ metadata.gz: f8d67936b7bbacf5cfe58e3c642d532be762848659f1839a920ea40795414931
4
+ data.tar.gz: c290910ca41637527fac5461a280d6ce3a22ba680fccb67f5eff4593a0cbea96
5
5
  SHA512:
6
- metadata.gz: 4b7240277aab4f9299fa362a5a7d60a33c8d0dc7a26f674164fea7ebd914655f18ad553a16d0a1516da9d02261d58248ec71c4596ce37ada569cd60ef7272ea5
7
- data.tar.gz: d0460fffc5ca8d8c30db1b57be78c8e6ad28d4278d4c6cf5e79ef30f3681e9b63fbd2953abebdb80c100adacfcf0bc156643ef4bc03ca5d73f33203fc37a2d66
6
+ metadata.gz: dea3cf5c8b42477b130ea300427be44275c2e040ad167c0ff5052e77c5d8c41fd819d1352c15b7ce2051fe652114fb007e663e580ce08958f1c1a27400e4cdcb
7
+ data.tar.gz: 39d3f36f90c2e3f8c0099e9aa117e76430c9b72a20780edf0ebb21317e435b2f92abb16bbf6abe4b3eb147f6fe333d2e35fa4ad7de919def333993118597b202
data/.dockerignore ADDED
@@ -0,0 +1,8 @@
1
+ .github
2
+ .yardoc
3
+ coverage
4
+ tmp
5
+ log
6
+ vendor/bundle
7
+ .bundle
8
+ .rspec_status
data/.envrc.skeleton CHANGED
@@ -1,2 +1 @@
1
1
  export GITHUB_ACCESS_TOKEN={GITHUB_ACCESS_TOKEN}
2
- export MY_API_ENDPOINT={API gateway endtpoint of "my_api" for integration testing}
@@ -3,12 +3,10 @@ updates:
3
3
  - package-ecosystem: bundler
4
4
  directory: "/"
5
5
  schedule:
6
- interval: daily
6
+ interval: weekly
7
7
  time: "08:00"
8
- timezone: Japan
8
+ timezone: Asia/Tokyo
9
9
  open-pull-requests-limit: 10
10
- reviewers:
11
- - ryz310
12
10
  assignees:
13
11
  - ryz310
14
12
  labels:
@@ -17,15 +15,92 @@ updates:
17
15
  - dependency-name: rubocop
18
16
  versions:
19
17
  - 1.9.0
18
+ - package-ecosystem: github-actions
19
+ directory: "/"
20
+ schedule:
21
+ interval: weekly
22
+ time: "08:00"
23
+ timezone: Asia/Tokyo
24
+ open-pull-requests-limit: 10
25
+ assignees:
26
+ - ryz310
27
+ labels:
28
+ - dependabot
20
29
  - package-ecosystem: bundler
21
30
  directory: "/my_api"
22
31
  schedule:
23
- interval: daily
32
+ interval: weekly
24
33
  time: "08:00"
25
- timezone: Japan
34
+ timezone: Asia/Tokyo
26
35
  open-pull-requests-limit: 10
27
- reviewers:
36
+ assignees:
28
37
  - ryz310
38
+ labels:
39
+ - dependabot
40
+ - package-ecosystem: bundler
41
+ directory: "/rails_app/rails_7.2"
42
+ schedule:
43
+ interval: weekly
44
+ time: "08:00"
45
+ timezone: Asia/Tokyo
46
+ open-pull-requests-limit: 10
47
+ assignees:
48
+ - ryz310
49
+ labels:
50
+ - dependabot
51
+ - package-ecosystem: github-actions
52
+ directory: "/rails_app/rails_7.2"
53
+ schedule:
54
+ interval: weekly
55
+ time: "08:00"
56
+ timezone: Asia/Tokyo
57
+ open-pull-requests-limit: 10
58
+ assignees:
59
+ - ryz310
60
+ labels:
61
+ - dependabot
62
+ - package-ecosystem: bundler
63
+ directory: "/rails_app/rails_8.0"
64
+ schedule:
65
+ interval: weekly
66
+ time: "08:00"
67
+ timezone: Asia/Tokyo
68
+ open-pull-requests-limit: 10
69
+ assignees:
70
+ - ryz310
71
+ labels:
72
+ - dependabot
73
+ - package-ecosystem: github-actions
74
+ directory: "/rails_app/rails_8.0"
75
+ schedule:
76
+ interval: weekly
77
+ time: "08:00"
78
+ timezone: Asia/Tokyo
79
+ open-pull-requests-limit: 10
80
+ assignees:
81
+ - ryz310
82
+ labels:
83
+ - dependabot
84
+ - package-ecosystem: bundler
85
+ directory: "/rails_app/rails_8.1"
86
+ schedule:
87
+ interval: weekly
88
+ day: monday
89
+ time: "08:00"
90
+ timezone: Asia/Tokyo
91
+ open-pull-requests-limit: 10
92
+ assignees:
93
+ - ryz310
94
+ labels:
95
+ - dependabot
96
+ - package-ecosystem: github-actions
97
+ directory: "/rails_app/rails_8.1"
98
+ schedule:
99
+ interval: weekly
100
+ day: monday
101
+ time: "08:00"
102
+ timezone: Asia/Tokyo
103
+ open-pull-requests-limit: 10
29
104
  assignees:
30
105
  - ryz310
31
106
  labels:
@@ -0,0 +1,334 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+
7
+ concurrency:
8
+ group: ci-${{ github.workflow }}-${{ github.ref }}
9
+ cancel-in-progress: true
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ build_gem:
16
+ name: build_on_ruby_${{ matrix.ruby_version }}_and_rails_${{ matrix.rails_version }}_${{ matrix.bundler_option.name }}
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby_version: ['3.2', '3.3', '3.4', '4.0']
22
+ rails_version: ['7.2', '8.0', '8.1']
23
+ bundler_option:
24
+ - name: with_integrations
25
+ with: integrations
26
+ without: ""
27
+ - name: without_integrations
28
+ with: ""
29
+ without: integrations
30
+ steps:
31
+ - uses: actions/checkout@v6
32
+
33
+ - name: Set up Ruby ${{ matrix.ruby_version }}
34
+ uses: ruby/setup-ruby@v1
35
+ with:
36
+ ruby-version: ${{ matrix.ruby_version }}
37
+ bundler-cache: false
38
+
39
+ - name: Install Bundler 2.x
40
+ run: gem install bundler -v "~> 2.0"
41
+
42
+ - name: Configure Bundler options
43
+ env:
44
+ BUNDLE_WITH: ${{ matrix.bundler_option.with }}
45
+ BUNDLE_WITHOUT: ${{ matrix.bundler_option.without }}
46
+ run: |
47
+ if [ -n "${BUNDLE_WITH}" ]; then
48
+ bundle config set --local with "${BUNDLE_WITH}"
49
+ else
50
+ bundle config unset --local with || true
51
+ fi
52
+
53
+ if [ -n "${BUNDLE_WITHOUT}" ]; then
54
+ bundle config set --local without "${BUNDLE_WITHOUT}"
55
+ else
56
+ bundle config unset --local without || true
57
+ fi
58
+
59
+ - name: Use Rails ${{ matrix.rails_version }} appraisal
60
+ run: cp gemfiles/rails_${{ matrix.rails_version }}.gemfile Gemfile
61
+
62
+ - name: Update ActiveSupport
63
+ run: bundle update activesupport
64
+
65
+ - name: Execute RSpec
66
+ env:
67
+ SIMPLECOV_COMMAND_NAME: build_gem_ruby_${{ matrix.ruby_version }}_rails_${{ matrix.rails_version }}_${{ matrix.bundler_option.name }}
68
+ run: |
69
+ bundle exec rspec --format documentation \
70
+ --color \
71
+ --format RspecJunitFormatter
72
+
73
+ - name: Rake build
74
+ run: bundle exec rake build
75
+
76
+ - name: Prepare coverage artifact
77
+ if: ${{ always() && hashFiles('coverage/.resultset.json') != '' }}
78
+ run: cp coverage/.resultset.json coverage/resultset.json
79
+
80
+ - name: Upload coverage artifact
81
+ if: ${{ always() && hashFiles('coverage/resultset.json') != '' }}
82
+ uses: actions/upload-artifact@v7
83
+ with:
84
+ name: simplecov-resultset-ruby_${{ matrix.ruby_version }}-rails_${{ matrix.rails_version }}-${{ matrix.bundler_option.name }}
85
+ path: coverage/resultset.json
86
+
87
+ verify_generator:
88
+ name: verify_generator_on_ruby_${{ matrix.ruby_version }}_and_rails_${{ matrix.rails_version }}
89
+ runs-on: ubuntu-latest
90
+ env:
91
+ BUNDLE_PATH: vendor/bundle
92
+ strategy:
93
+ fail-fast: false
94
+ matrix:
95
+ ruby_version: ['3.2', '3.3', '3.4', '4.0']
96
+ rails_version: ['7.2', '8.0', '8.1']
97
+ defaults:
98
+ run:
99
+ working-directory: rails_app/rails_${{ matrix.rails_version }}
100
+ steps:
101
+ - uses: actions/checkout@v6
102
+
103
+ - name: Set up Ruby ${{ matrix.ruby_version }}
104
+ uses: ruby/setup-ruby@v1
105
+ with:
106
+ ruby-version: ${{ matrix.ruby_version }}
107
+ bundler-cache: false
108
+
109
+ - name: Install Bundler 2.x
110
+ run: gem install bundler -v "~> 2.0"
111
+
112
+ - name: Bundle install
113
+ run: bundle install
114
+
115
+ - name: Add compatibility symlink for libffi
116
+ run: |
117
+ if [ ! -e /usr/lib/x86_64-linux-gnu/libffi.so.6 ]; then
118
+ latest_libffi="$(find /usr/lib/x86_64-linux-gnu -maxdepth 1 -type f -name 'libffi.so.*.*.*' | sort -V | tail -n 1)"
119
+ if [ -n "${latest_libffi}" ]; then
120
+ sudo ln -s "${latest_libffi}" /usr/lib/x86_64-linux-gnu/libffi.so.6
121
+ fi
122
+ fi
123
+
124
+ - name: Generate new API client files
125
+ run: |
126
+ bin/rails g api_client path/to/resource \
127
+ get:path/to/resource \
128
+ post:path/to/resource \
129
+ --endpoint https://example.com/myapi
130
+
131
+ - name: Check generated API client files
132
+ run: |
133
+ test -e "app/api_clients/application_api_client.rb" && \
134
+ test -e "app/api_clients/path/to/resource_api_client.rb" && \
135
+ test -e "spec/api_clients/path/to/resource_api_client_spec.rb"
136
+
137
+ - name: Run rspec with the generated spec file
138
+ run: bundle exec rspec -f d spec/api_clients/path/to
139
+
140
+ integration_api:
141
+ name: integration_api_via_docker_compose
142
+ runs-on: ubuntu-latest
143
+ steps:
144
+ - uses: actions/checkout@v6
145
+
146
+ - name: Build and start my_api
147
+ run: docker compose up -d --build my_api
148
+
149
+ - name: Run integration specs against my_api
150
+ env:
151
+ MY_API_ENDPOINT: http://my_api:3000
152
+ SIMPLECOV_COMMAND_NAME: integration_api
153
+ run: |
154
+ docker compose run --rm test bash -lc "
155
+ bundle config set --local with integrations &&
156
+ bundle install &&
157
+ bundle exec rspec spec/integrations/api_clients
158
+ "
159
+
160
+ - name: Fix coverage directory ownership
161
+ if: ${{ always() && hashFiles('coverage/.resultset.json') != '' }}
162
+ run: sudo chown -R "$(id -u):$(id -g)" coverage
163
+
164
+ - name: Prepare coverage artifact
165
+ if: ${{ always() && hashFiles('coverage/.resultset.json') != '' }}
166
+ run: cp coverage/.resultset.json coverage/resultset.json
167
+
168
+ - name: Upload coverage artifact
169
+ if: ${{ always() && hashFiles('coverage/resultset.json') != '' }}
170
+ uses: actions/upload-artifact@v7
171
+ with:
172
+ name: simplecov-resultset-integration_api
173
+ path: coverage/resultset.json
174
+
175
+ - name: Show my_api logs when failed
176
+ if: ${{ failure() }}
177
+ run: docker compose logs my_api
178
+
179
+ - name: Shutdown compose services
180
+ if: ${{ always() }}
181
+ run: docker compose down --volumes --remove-orphans
182
+
183
+ my_api_request_specs:
184
+ name: my_api_request_specs_via_docker_compose
185
+ runs-on: ubuntu-latest
186
+ steps:
187
+ - uses: actions/checkout@v6
188
+
189
+ - name: Build and start my_api
190
+ run: docker compose up -d --build my_api
191
+
192
+ - name: Run my_api request specs
193
+ env:
194
+ SIMPLECOV_COMMAND_NAME: my_api_request_specs
195
+ run: docker compose run --rm my_api bundle exec rspec spec/requests
196
+
197
+ - name: Fix my_api coverage directory ownership
198
+ if: ${{ always() && hashFiles('my_api/coverage/.resultset.json') != '' }}
199
+ run: sudo chown -R "$(id -u):$(id -g)" my_api/coverage
200
+
201
+ - name: Prepare coverage artifact
202
+ if: ${{ always() && hashFiles('my_api/coverage/.resultset.json') != '' }}
203
+ run: cp my_api/coverage/.resultset.json my_api/coverage/resultset.json
204
+
205
+ - name: Upload coverage artifact
206
+ if: ${{ always() && hashFiles('my_api/coverage/resultset.json') != '' }}
207
+ uses: actions/upload-artifact@v7
208
+ with:
209
+ name: simplecov-resultset-my_api_request_specs
210
+ path: my_api/coverage/resultset.json
211
+
212
+ - name: Show my_api logs when failed
213
+ if: ${{ failure() }}
214
+ run: docker compose logs my_api
215
+
216
+ - name: Shutdown compose services
217
+ if: ${{ always() }}
218
+ run: docker compose down --volumes --remove-orphans
219
+
220
+ rubocop:
221
+ runs-on: ubuntu-latest
222
+ steps:
223
+ - uses: actions/checkout@v6
224
+
225
+ - name: Set up Ruby
226
+ uses: ruby/setup-ruby@v1
227
+ with:
228
+ ruby-version: '4.0'
229
+ bundler-cache: false
230
+
231
+ - name: Install Bundler 2.x
232
+ run: gem install bundler -v "~> 2.0"
233
+
234
+ - name: Bundle install
235
+ run: bundle install
236
+
237
+ - name: Run RuboCop
238
+ run: bundle exec rubocop
239
+
240
+ yardoc:
241
+ runs-on: ubuntu-latest
242
+ steps:
243
+ - uses: actions/checkout@v6
244
+
245
+ - name: Set up Ruby
246
+ uses: ruby/setup-ruby@v1
247
+ with:
248
+ ruby-version: '4.0'
249
+ bundler-cache: false
250
+
251
+ - name: Install Bundler 2.x
252
+ run: gem install bundler -v "~> 2.0"
253
+
254
+ - name: Bundle install
255
+ run: bundle install
256
+
257
+ - name: Generate YARDoc
258
+ run: bundle exec yardoc -o ./yardoc
259
+
260
+ - name: Store YARDoc artifact
261
+ uses: actions/upload-artifact@v7
262
+ with:
263
+ name: yardoc
264
+ path: ./yardoc
265
+
266
+ upload_coverage:
267
+ name: upload-coverage
268
+ environment: coverage
269
+ # This job runs on pull_request as well.
270
+ # On fork-based pull requests, secrets are unavailable, so the Qlty upload
271
+ # step is skipped by its token guard. On same-repository pull requests,
272
+ # QLTY_COVERAGE_TOKEN is available and upload can run.
273
+ needs:
274
+ - build_gem
275
+ - verify_generator
276
+ - integration_api
277
+ - my_api_request_specs
278
+ runs-on: ubuntu-latest
279
+ env:
280
+ QLTY_COVERAGE_TOKEN: ${{ secrets.QLTY_COVERAGE_TOKEN }}
281
+ steps:
282
+ - uses: actions/checkout@v6
283
+
284
+ - name: Set up Ruby
285
+ uses: ruby/setup-ruby@v1
286
+ with:
287
+ ruby-version: '4.0'
288
+ bundler-cache: false
289
+
290
+ - name: Install Bundler 2.x
291
+ run: gem install bundler -v "~> 2.0"
292
+
293
+ - name: Bundle install
294
+ run: bundle install
295
+
296
+ - name: Download coverage artifacts
297
+ uses: actions/download-artifact@v8
298
+ with:
299
+ pattern: simplecov-resultset-*
300
+ path: tmp/simplecov-results
301
+
302
+ - name: Collate SimpleCov coverage
303
+ run: |
304
+ bundle exec ruby -e "
305
+ require 'simplecov'
306
+ require 'simplecov_json_formatter'
307
+
308
+ resultset_files = Dir['tmp/simplecov-results/**/resultset.json'].sort
309
+ abort('No SimpleCov resultset files found') if resultset_files.empty?
310
+
311
+ SimpleCov.collate(resultset_files) do
312
+ formatter SimpleCov::Formatter::JSONFormatter
313
+ coverage_dir('coverage')
314
+ end
315
+ "
316
+
317
+ - name: Upload merged coverage artifact
318
+ if: ${{ hashFiles('coverage/coverage.json') != '' }}
319
+ uses: actions/upload-artifact@v7
320
+ with:
321
+ name: merged-simplecov-coverage
322
+ path: coverage/coverage.json
323
+
324
+ - name: Upload coverage to Qlty
325
+ if: ${{ env.QLTY_COVERAGE_TOKEN != '' && hashFiles('coverage/coverage.json') != '' }}
326
+ uses: qltysh/qlty-action/coverage@v2
327
+ with:
328
+ token: ${{ env.QLTY_COVERAGE_TOKEN }}
329
+ files: coverage/coverage.json
330
+
331
+ - name: Notify when Qlty token is missing
332
+ if: ${{ env.QLTY_COVERAGE_TOKEN == '' }}
333
+ run: |
334
+ echo "QLTY_COVERAGE_TOKEN is not set. Skipping coverage upload."
@@ -0,0 +1,96 @@
1
+ name: Dependabot Auto Merge
2
+
3
+ on:
4
+ pull_request_target:
5
+ types:
6
+ - opened
7
+ - reopened
8
+ - synchronize
9
+
10
+ permissions:
11
+ contents: write
12
+ pull-requests: write
13
+
14
+ jobs:
15
+ enable-automerge-bundler:
16
+ if: ${{ github.actor == 'dependabot[bot]' }}
17
+ runs-on: ubuntu-latest
18
+
19
+ steps:
20
+ - name: Fetch Dependabot metadata
21
+ id: metadata
22
+ uses: dependabot/fetch-metadata@v2
23
+ with:
24
+ github-token: ${{ secrets.GITHUB_TOKEN }}
25
+
26
+ - name: Enable auto-merge for bundler patch/minor updates (rails_app or direct development)
27
+ if: ${{ steps.metadata.outputs.package-ecosystem == 'bundler' && (steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor') && (contains(github.event.pull_request.head.ref, '/rails_app/') || steps.metadata.outputs.dependency-type == 'direct:development') }}
28
+ env:
29
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+ PR_NUMBER: ${{ github.event.pull_request.number }}
31
+ run: gh pr merge --repo "$GITHUB_REPOSITORY" --auto --merge "$PR_NUMBER"
32
+
33
+ enable-automerge-github-actions:
34
+ if: ${{ github.actor == 'dependabot[bot]' }}
35
+ runs-on: ubuntu-latest
36
+
37
+ steps:
38
+ - name: Fetch Dependabot metadata
39
+ id: metadata
40
+ uses: dependabot/fetch-metadata@v2
41
+ with:
42
+ github-token: ${{ secrets.GITHUB_TOKEN }}
43
+
44
+ - name: Validate GitHub Actions update safety
45
+ id: guard
46
+ if: ${{ steps.metadata.outputs.package-ecosystem == 'github-actions' }}
47
+ env:
48
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49
+ PR_NUMBER: ${{ github.event.pull_request.number }}
50
+ UPDATE_TYPE: ${{ steps.metadata.outputs.update-type }}
51
+ DEPENDENCY_NAME: ${{ steps.metadata.outputs.dependency-name }}
52
+ DEPENDENCY_NAMES: ${{ steps.metadata.outputs.dependency-names }}
53
+ run: |
54
+ set -euo pipefail
55
+
56
+ safe=true
57
+
58
+ if [[ "$UPDATE_TYPE" != "version-update:semver-patch" && "$UPDATE_TYPE" != "version-update:semver-minor" ]]; then
59
+ echo "Skip auto-merge: update type is not patch/minor ($UPDATE_TYPE)."
60
+ safe=false
61
+ fi
62
+
63
+ deps="$DEPENDENCY_NAMES"
64
+ if [[ -z "$deps" ]]; then
65
+ deps="$DEPENDENCY_NAME"
66
+ fi
67
+
68
+ if [[ -z "$deps" ]]; then
69
+ echo "Skip auto-merge: dependency name is missing."
70
+ safe=false
71
+ else
72
+ while IFS= read -r dep; do
73
+ dep="$(echo "$dep" | xargs)"
74
+ [[ -z "$dep" ]] && continue
75
+
76
+ if [[ ! "$dep" =~ ^actions/ && ! "$dep" =~ ^github/ ]]; then
77
+ echo "Skip auto-merge: non-GitHub official action detected ($dep)."
78
+ safe=false
79
+ fi
80
+ done < <(echo "$deps" | tr ',' '\n')
81
+ fi
82
+
83
+ files_json="$(gh api -H "Accept: application/vnd.github+json" "/repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/files?per_page=100")"
84
+ if echo "$files_json" | jq -r '.[] | select((.patch // "") | test("(?m)^[+-]\\s*(permissions|pull_request_target)\\s*:")) | .filename' | grep -q .; then
85
+ echo "Skip auto-merge: permissions or pull_request_target changes were detected."
86
+ safe=false
87
+ fi
88
+
89
+ echo "safe=$safe" >> "$GITHUB_OUTPUT"
90
+
91
+ - name: Enable auto-merge for safe GitHub Actions patch/minor updates
92
+ if: ${{ steps.metadata.outputs.package-ecosystem == 'github-actions' && steps.guard.outputs.safe == 'true' }}
93
+ env:
94
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95
+ PR_NUMBER: ${{ github.event.pull_request.number }}
96
+ run: gh pr merge --repo "$GITHUB_REPOSITORY" --auto --merge "$PR_NUMBER"
@@ -0,0 +1,33 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - release
7
+ workflow_dispatch:
8
+
9
+ concurrency:
10
+ group: release-${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ permissions:
14
+ contents: write
15
+ id-token: write
16
+
17
+ jobs:
18
+ release:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v6
22
+ with:
23
+ fetch-depth: 0
24
+ ref: ${{ github.ref_name }}
25
+
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: '4.0'
30
+ bundler-cache: true
31
+
32
+ - name: Release gem via Trusted Publishing
33
+ uses: rubygems/release-gem@v1
@@ -0,0 +1,33 @@
1
+ name: Rubocop Challenge
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "30 23 * * *" # 8:30am every day (JST)
6
+ workflow_dispatch:
7
+
8
+ concurrency:
9
+ group: rubocop-challenge-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ permissions:
13
+ contents: write
14
+ pull-requests: write
15
+
16
+ jobs:
17
+ rubocop_challenge:
18
+ if: ${{ github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' }}
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v6
22
+
23
+ - name: Set up Ruby
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: '4.0'
27
+
28
+ - name: Rubocop Challenge
29
+ env:
30
+ GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31
+ run: |
32
+ gem install rubocop_challenger
33
+ rubocop_challenger go --email=ryz310@gmail.com --name=ryz310
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ .envrc
data/.rubocop.yml CHANGED
@@ -7,7 +7,7 @@ plugins:
7
7
  inherit_from: .rubocop_todo.yml
8
8
 
9
9
  AllCops:
10
- TargetRubyVersion: 3.1
10
+ TargetRubyVersion: 3.2
11
11
  NewCops: enable
12
12
  Exclude:
13
13
  - rails_app/**/*
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.6
1
+ 3.2.9