Skip to content

Commit 8421f46

Browse files
authored
Merge pull request #1 from codeur/copilot/fix-612be0fe-5797-40b7-8fa4-54bd7fa8760b
Implement CSP reports collection Rails engine with Slack notifications
2 parents bc2fccd + 83dee91 commit 8421f46

84 files changed

Lines changed: 1930 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v5
14+
15+
- name: Set up Ruby
16+
uses: ruby/setup-ruby@v1
17+
with:
18+
bundler-cache: true
19+
20+
- name: Lint code for consistent style
21+
run: bin/rubocop -f github
22+
23+
test:
24+
runs-on: ubuntu-latest
25+
26+
# services:
27+
# redis:
28+
# image: redis
29+
# ports:
30+
# - 6379:6379
31+
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
32+
steps:
33+
# - name: Install packages
34+
# run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config
35+
36+
- name: Checkout code
37+
uses: actions/checkout@v5
38+
39+
- name: Set up Ruby
40+
uses: ruby/setup-ruby@v1
41+
with:
42+
bundler-cache: true
43+
44+
- name: Run tests
45+
env:
46+
RAILS_ENV: test
47+
# REDIS_URL: redis://localhost:6379/0
48+
run: bin/rails db:test:prepare && bin/rails test
49+
50+
- name: Keep screenshots from failed system tests
51+
uses: actions/upload-artifact@v4
52+
if: failure()
53+
with:
54+
name: screenshots
55+
path: ${{ github.workspace }}/tmp/screenshots
56+
if-no-files-found: ignore

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/.bundle/
2+
/doc/
3+
/log/*.log
4+
/pkg/
5+
/tmp/
6+
/test/dummy/db/*.sqlite3
7+
/test/dummy/db/*.sqlite3-*
8+
/test/dummy/log/*.log
9+
/test/dummy/storage/
10+
/test/dummy/tmp/
11+
*.gem
12+
.byebug_history

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
inherit_gem:
2+
rubocop-codeur:
3+
- default.yml

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 3.4.2

Gemfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
5+
# Specify your gem's dependencies in reported.gemspec
6+
gemspec
7+
8+
gem 'puma'
9+
10+
gem 'sqlite3'
11+
12+
gem 'propshaft'
13+
14+
# Codeur Ruby styling [https://github.com/codeur/rubocop-codeur/]
15+
gem 'rubocop-codeur', require: false
16+
17+
# Start debugger with binding.b [https://github.com/ruby/debug]
18+
# gem "debug", ">= 1.0.0"
19+
20+
gem 'webmock', group: 'test'

Gemfile.lock

Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
PATH
2+
remote: .
3+
specs:
4+
reported (0.1.0)
5+
rails (>= 7.1, < 8)
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
actioncable (7.2.2.2)
11+
actionpack (= 7.2.2.2)
12+
activesupport (= 7.2.2.2)
13+
nio4r (~> 2.0)
14+
websocket-driver (>= 0.6.1)
15+
zeitwerk (~> 2.6)
16+
actionmailbox (7.2.2.2)
17+
actionpack (= 7.2.2.2)
18+
activejob (= 7.2.2.2)
19+
activerecord (= 7.2.2.2)
20+
activestorage (= 7.2.2.2)
21+
activesupport (= 7.2.2.2)
22+
mail (>= 2.8.0)
23+
actionmailer (7.2.2.2)
24+
actionpack (= 7.2.2.2)
25+
actionview (= 7.2.2.2)
26+
activejob (= 7.2.2.2)
27+
activesupport (= 7.2.2.2)
28+
mail (>= 2.8.0)
29+
rails-dom-testing (~> 2.2)
30+
actionpack (7.2.2.2)
31+
actionview (= 7.2.2.2)
32+
activesupport (= 7.2.2.2)
33+
nokogiri (>= 1.8.5)
34+
racc
35+
rack (>= 2.2.4, < 3.2)
36+
rack-session (>= 1.0.1)
37+
rack-test (>= 0.6.3)
38+
rails-dom-testing (~> 2.2)
39+
rails-html-sanitizer (~> 1.6)
40+
useragent (~> 0.16)
41+
actiontext (7.2.2.2)
42+
actionpack (= 7.2.2.2)
43+
activerecord (= 7.2.2.2)
44+
activestorage (= 7.2.2.2)
45+
activesupport (= 7.2.2.2)
46+
globalid (>= 0.6.0)
47+
nokogiri (>= 1.8.5)
48+
actionview (7.2.2.2)
49+
activesupport (= 7.2.2.2)
50+
builder (~> 3.1)
51+
erubi (~> 1.11)
52+
rails-dom-testing (~> 2.2)
53+
rails-html-sanitizer (~> 1.6)
54+
activejob (7.2.2.2)
55+
activesupport (= 7.2.2.2)
56+
globalid (>= 0.3.6)
57+
activemodel (7.2.2.2)
58+
activesupport (= 7.2.2.2)
59+
activerecord (7.2.2.2)
60+
activemodel (= 7.2.2.2)
61+
activesupport (= 7.2.2.2)
62+
timeout (>= 0.4.0)
63+
activestorage (7.2.2.2)
64+
actionpack (= 7.2.2.2)
65+
activejob (= 7.2.2.2)
66+
activerecord (= 7.2.2.2)
67+
activesupport (= 7.2.2.2)
68+
marcel (~> 1.0)
69+
activesupport (7.2.2.2)
70+
base64
71+
benchmark (>= 0.3)
72+
bigdecimal
73+
concurrent-ruby (~> 1.0, >= 1.3.1)
74+
connection_pool (>= 2.2.5)
75+
drb
76+
i18n (>= 1.6, < 2)
77+
logger (>= 1.4.2)
78+
minitest (>= 5.1)
79+
securerandom (>= 0.3)
80+
tzinfo (~> 2.0, >= 2.0.5)
81+
addressable (2.8.7)
82+
public_suffix (>= 2.0.2, < 7.0)
83+
ast (2.4.3)
84+
base64 (0.3.0)
85+
benchmark (0.4.1)
86+
bigdecimal (3.2.3)
87+
builder (3.3.0)
88+
concurrent-ruby (1.3.5)
89+
connection_pool (2.5.4)
90+
crack (1.0.0)
91+
bigdecimal
92+
rexml
93+
crass (1.0.6)
94+
date (3.4.1)
95+
drb (2.2.3)
96+
erb (5.0.2)
97+
erubi (1.13.1)
98+
globalid (1.3.0)
99+
activesupport (>= 6.1)
100+
hashdiff (1.2.1)
101+
i18n (1.14.7)
102+
concurrent-ruby (~> 1.0)
103+
io-console (0.8.1)
104+
irb (1.15.2)
105+
pp (>= 0.6.0)
106+
rdoc (>= 4.0.0)
107+
reline (>= 0.4.2)
108+
json (2.15.0)
109+
language_server-protocol (3.17.0.5)
110+
lint_roller (1.1.0)
111+
logger (1.7.0)
112+
loofah (2.24.1)
113+
crass (~> 1.0.2)
114+
nokogiri (>= 1.12.0)
115+
mail (2.8.1)
116+
mini_mime (>= 0.1.1)
117+
net-imap
118+
net-pop
119+
net-smtp
120+
marcel (1.1.0)
121+
mini_mime (1.1.5)
122+
mini_portile2 (2.8.9)
123+
minitest (5.25.5)
124+
net-imap (0.5.11)
125+
date
126+
net-protocol
127+
net-pop (0.1.2)
128+
net-protocol
129+
net-protocol (0.2.2)
130+
timeout
131+
net-smtp (0.5.1)
132+
net-protocol
133+
nio4r (2.7.4)
134+
nokogiri (1.18.10)
135+
mini_portile2 (~> 2.8.2)
136+
racc (~> 1.4)
137+
parallel (1.27.0)
138+
parser (3.3.9.0)
139+
ast (~> 2.4.1)
140+
racc
141+
pp (0.6.2)
142+
prettyprint
143+
prettyprint (0.2.0)
144+
prism (1.5.1)
145+
propshaft (1.3.1)
146+
actionpack (>= 7.0.0)
147+
activesupport (>= 7.0.0)
148+
rack
149+
psych (5.2.6)
150+
date
151+
stringio
152+
public_suffix (6.0.2)
153+
puma (7.0.4)
154+
nio4r (~> 2.0)
155+
racc (1.8.1)
156+
rack (3.1.16)
157+
rack-session (2.1.1)
158+
base64 (>= 0.1.0)
159+
rack (>= 3.0.0)
160+
rack-test (2.2.0)
161+
rack (>= 1.3)
162+
rackup (2.2.1)
163+
rack (>= 3)
164+
rails (7.2.2.2)
165+
actioncable (= 7.2.2.2)
166+
actionmailbox (= 7.2.2.2)
167+
actionmailer (= 7.2.2.2)
168+
actionpack (= 7.2.2.2)
169+
actiontext (= 7.2.2.2)
170+
actionview (= 7.2.2.2)
171+
activejob (= 7.2.2.2)
172+
activemodel (= 7.2.2.2)
173+
activerecord (= 7.2.2.2)
174+
activestorage (= 7.2.2.2)
175+
activesupport (= 7.2.2.2)
176+
bundler (>= 1.15.0)
177+
railties (= 7.2.2.2)
178+
rails-dom-testing (2.3.0)
179+
activesupport (>= 5.0.0)
180+
minitest
181+
nokogiri (>= 1.6)
182+
rails-html-sanitizer (1.6.2)
183+
loofah (~> 2.21)
184+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
185+
railties (7.2.2.2)
186+
actionpack (= 7.2.2.2)
187+
activesupport (= 7.2.2.2)
188+
irb (~> 1.13)
189+
rackup (>= 1.0.0)
190+
rake (>= 12.2)
191+
thor (~> 1.0, >= 1.2.2)
192+
zeitwerk (~> 2.6)
193+
rainbow (3.1.1)
194+
rake (13.3.0)
195+
rdoc (6.14.2)
196+
erb
197+
psych (>= 4.0.0)
198+
regexp_parser (2.11.3)
199+
reline (0.6.2)
200+
io-console (~> 0.5)
201+
rexml (3.4.4)
202+
rubocop (1.81.1)
203+
json (~> 2.3)
204+
language_server-protocol (~> 3.17.0.2)
205+
lint_roller (~> 1.1.0)
206+
parallel (~> 1.10)
207+
parser (>= 3.3.0.2)
208+
rainbow (>= 2.2.2, < 4.0)
209+
regexp_parser (>= 2.9.3, < 3.0)
210+
rubocop-ast (>= 1.47.1, < 2.0)
211+
ruby-progressbar (~> 1.7)
212+
unicode-display_width (>= 2.4.0, < 4.0)
213+
rubocop-ast (1.47.1)
214+
parser (>= 3.3.7.2)
215+
prism (~> 1.4)
216+
rubocop-capybara (2.22.1)
217+
lint_roller (~> 1.1)
218+
rubocop (~> 1.72, >= 1.72.1)
219+
rubocop-codeur (0.11.6)
220+
lint_roller (~> 1.1)
221+
rubocop (>= 1.72.0, < 2.0)
222+
rubocop-capybara (~> 2.21)
223+
rubocop-factory_bot (~> 2.26)
224+
rubocop-minitest (~> 0.37)
225+
rubocop-performance (~> 1.24)
226+
rubocop-rails (~> 2.30)
227+
rubocop-factory_bot (2.27.1)
228+
lint_roller (~> 1.1)
229+
rubocop (~> 1.72, >= 1.72.1)
230+
rubocop-minitest (0.38.2)
231+
lint_roller (~> 1.1)
232+
rubocop (>= 1.75.0, < 2.0)
233+
rubocop-ast (>= 1.38.0, < 2.0)
234+
rubocop-performance (1.26.0)
235+
lint_roller (~> 1.1)
236+
rubocop (>= 1.75.0, < 2.0)
237+
rubocop-ast (>= 1.44.0, < 2.0)
238+
rubocop-rails (2.33.4)
239+
activesupport (>= 4.2.0)
240+
lint_roller (~> 1.1)
241+
rack (>= 1.1)
242+
rubocop (>= 1.75.0, < 2.0)
243+
rubocop-ast (>= 1.44.0, < 2.0)
244+
ruby-progressbar (1.13.0)
245+
securerandom (0.4.1)
246+
sqlite3 (2.7.4)
247+
mini_portile2 (~> 2.8.0)
248+
stringio (3.1.7)
249+
thor (1.4.0)
250+
timeout (0.4.3)
251+
tzinfo (2.0.6)
252+
concurrent-ruby (~> 1.0)
253+
unicode-display_width (3.2.0)
254+
unicode-emoji (~> 4.1)
255+
unicode-emoji (4.1.0)
256+
useragent (0.16.11)
257+
webmock (3.25.1)
258+
addressable (>= 2.8.0)
259+
crack (>= 0.3.2)
260+
hashdiff (>= 0.4.0, < 2.0.0)
261+
websocket-driver (0.8.0)
262+
base64
263+
websocket-extensions (>= 0.1.0)
264+
websocket-extensions (0.1.5)
265+
zeitwerk (2.7.3)
266+
267+
PLATFORMS
268+
ruby
269+
270+
DEPENDENCIES
271+
propshaft
272+
puma
273+
reported!
274+
rubocop-codeur
275+
sqlite3
276+
webmock
277+
278+
BUNDLED WITH
279+
2.7.1

0 commit comments

Comments
 (0)