Skip to content

Commit 8d63a8d

Browse files
authored
Merge branch 'main' into allow-ignoring-expirations
2 parents 6dd13e2 + d77a37e commit 8d63a8d

226 files changed

Lines changed: 16951 additions & 54 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/workflows/acceptance.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
4646
# If the diff file is not empty, it has changes.
4747
[ -s diff.txt ] && echo "::set-output name=has_change::true" || echo "::set-output name=has_change::false"
48-
48+
4949
- name: set has_change to true for push to main/master
5050
if: github.event_name == 'push'
5151
run: echo "::set-output name=has_change::true"
@@ -54,10 +54,16 @@ jobs:
5454
needs: changes
5555
runs-on: ubuntu-latest
5656
name: runner / acceptance-tests
57+
strategy:
58+
matrix:
59+
ruby: [ '2.7.5', '3.1.2' ]
5760
permissions:
5861
contents: read
5962

6063
steps:
64+
- uses: ruby/setup-ruby@v1
65+
with:
66+
ruby-version: ${{ matrix.ruby }}
6167

6268
# If source files were not changed, we don't need the acceptance test suite
6369
- name: bypass

.github/workflows/lint.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ jobs:
1010
rubocop:
1111
name: runner / rubocop
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
ruby: [ '2.7.5', '3.1.2' ]
1316
permissions:
1417
contents: read
1518

1619
steps:
1720
- name: Check out code
1821
uses: actions/checkout@v2
1922

20-
# https://github.com/ruby/setup-ruby/releases/tag/v1.87.0
21-
- uses: ruby/setup-ruby@cf1a6dd2d8563b59c7007e381836fd252ab2ac5b
23+
- uses: ruby/setup-ruby@v1
2224
with:
23-
ruby-version: 2.7.5
25+
ruby-version: ${{ matrix.ruby }}
2426
bundler-cache: true
25-
26-
- name: rubocop
27-
run: bundle exec rubocop -c .rubocop.yml lib/ spec/
27+
- run: bundle exec rubocop -c .rubocop.yml lib/ spec/

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ jobs:
1010
rubocop:
1111
name: runner / rspec
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
ruby: [ '2.7.5', '3.1.2' ]
1316
permissions:
1417
contents: read
1518

1619
steps:
1720
- name: Check out code
1821
uses: actions/checkout@v2
1922

20-
# https://github.com/ruby/setup-ruby/releases/tag/v1.87.0
21-
- uses: ruby/setup-ruby@cf1a6dd2d8563b59c7007e381836fd252ab2ac5b
23+
- uses: ruby/setup-ruby@v1
2224
with:
23-
ruby-version: 2.7.5
25+
ruby-version: ${{ matrix.ruby }}
2426
bundler-cache: true
25-
26-
- name: rspec tests
27-
run: script/test -d
27+
- run: script/test -d

.rubocop.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ inherit_gem:
44

55
AllCops:
66
DisplayCopNames: true
7-
TargetRubyVersion: 2.7.5
7+
TargetRubyVersion: 3.1.2
88
Exclude:
99
- 'bin/*'
1010
- 'spec/acceptance/fixtures/**/*'
1111
- 'spec/unit/fixtures/**/*'
1212
- 'vendor/gems/**/*'
13+
- 'lib/contracts-ruby2/**/*'
14+
- 'lib/contracts-ruby3/**/*'
15+
16+
Style/HashSyntax:
17+
EnforcedShorthandSyntax: either

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.5
1+
3.1.2

Gemfile.lock

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,59 @@
11
PATH
22
remote: .
33
specs:
4-
entitlements-app (0.1.8)
4+
entitlements-app (0.2.0)
55
concurrent-ruby (= 1.1.9)
6-
contracts (= 0.16.0)
7-
net-ldap (~> 0.17.0)
6+
faraday (~> 2.0)
7+
net-ldap (~> 0.17)
8+
octokit (~> 4.18)
89
optimist (= 3.0.0)
910

1011
GEM
1112
remote: https://rubygems.org/
1213
specs:
13-
activesupport (7.0.3)
14+
activesupport (7.0.3.1)
1415
concurrent-ruby (~> 1.0, >= 1.0.2)
1516
i18n (>= 1.6, < 2)
1617
minitest (>= 5.1)
1718
tzinfo (~> 2.0)
18-
addressable (2.8.0)
19-
public_suffix (>= 2.0.2, < 5.0)
19+
addressable (2.8.1)
20+
public_suffix (>= 2.0.2, < 6.0)
2021
ast (2.4.2)
2122
concurrent-ruby (1.1.9)
22-
contracts (0.16.0)
2323
crack (0.4.5)
2424
rexml
25+
debug (1.6.2)
26+
irb (>= 1.3.6)
27+
reline (>= 0.3.1)
2528
diff-lcs (1.5.0)
2629
docile (1.4.0)
30+
faraday (2.5.2)
31+
faraday-net_http (>= 2.0, < 3.1)
32+
ruby2_keywords (>= 0.0.4)
33+
faraday-net_http (3.0.0)
2734
hashdiff (1.0.1)
28-
i18n (1.10.0)
35+
i18n (1.12.0)
2936
concurrent-ruby (~> 1.0)
37+
io-console (0.5.11)
38+
irb (1.4.1)
39+
reline (>= 0.3.0)
3040
json (2.6.2)
31-
minitest (5.15.0)
41+
minitest (5.16.3)
3242
net-ldap (0.17.1)
43+
octokit (4.25.1)
44+
faraday (>= 1, < 3)
45+
sawyer (~> 0.9)
3346
optimist (3.0.0)
3447
parallel (1.22.1)
35-
parser (3.1.2.0)
48+
parser (3.1.2.1)
3649
ast (~> 2.4.1)
37-
public_suffix (4.0.7)
38-
rack (2.2.3.1)
50+
public_suffix (5.0.0)
51+
rack (2.2.4)
3952
rainbow (3.1.1)
4053
rake (13.0.6)
4154
regexp_parser (2.5.0)
55+
reline (0.3.1)
56+
io-console (~> 0.5)
4257
rexml (3.2.5)
4358
rspec (3.8.0)
4459
rspec-core (~> 3.8.0)
@@ -62,7 +77,7 @@ GEM
6277
rubocop-ast (>= 1.17.0, < 2.0)
6378
ruby-progressbar (~> 1.7)
6479
unicode-display_width (>= 1.4.0, < 3.0)
65-
rubocop-ast (1.18.0)
80+
rubocop-ast (1.21.0)
6681
parser (>= 3.1.1.0)
6782
rubocop-github (0.17.0)
6883
rubocop
@@ -71,22 +86,26 @@ GEM
7186
rubocop-performance (1.13.3)
7287
rubocop (>= 1.7.0, < 2.0)
7388
rubocop-ast (>= 0.4.0)
74-
rubocop-rails (2.14.2)
89+
rubocop-rails (2.15.2)
7590
activesupport (>= 4.2.0)
7691
rack (>= 1.1)
7792
rubocop (>= 1.7.0, < 2.0)
7893
ruby-progressbar (1.11.0)
94+
ruby2_keywords (0.0.5)
7995
rugged (0.27.5)
96+
sawyer (0.9.2)
97+
addressable (>= 2.3.5)
98+
faraday (>= 0.17.3, < 3)
8099
simplecov (0.16.1)
81100
docile (~> 1.1)
82101
json (>= 1.8, < 3)
83102
simplecov-html (~> 0.10.0)
84-
simplecov-erb (0.1.1)
85-
simplecov
103+
simplecov-erb (1.0.1)
104+
simplecov (< 1.0)
86105
simplecov-html (0.10.2)
87-
tzinfo (2.0.4)
106+
tzinfo (2.0.5)
88107
concurrent-ruby (~> 1.0)
89-
unicode-display_width (2.1.0)
108+
unicode-display_width (2.2.0)
90109
vcr (4.0.0)
91110
webmock (3.4.2)
92111
addressable (>= 2.3.6)
@@ -97,6 +116,7 @@ PLATFORMS
97116
ruby
98117

99118
DEPENDENCIES
119+
debug (> 1.0.0)
100120
entitlements-app!
101121
rake (= 13.0.6)
102122
rspec (= 3.8.0)
@@ -106,9 +126,9 @@ DEPENDENCIES
106126
rubocop-performance (= 1.13.3)
107127
rugged (= 0.27.5)
108128
simplecov (= 0.16.1)
109-
simplecov-erb (= 0.1.1)
129+
simplecov-erb (= 1.0.1)
110130
vcr (= 4.0.0)
111131
webmock (= 3.4.2)
112132

113133
BUNDLED WITH
114-
2.3.15
134+
2.3.19

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.8
1+
0.2.0

bin/deploy-entitlements

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22

33
ENV["BUNDLE_GEMFILE"] = File.expand_path("../Gemfile", File.dirname(__FILE__))
44
require "bundler/setup"
5+
require "ruby_version_check"
6+
7+
# Note that contracts.ruby has two specific ruby-version specific libraries, which we have vendored into lib/
8+
if RubyVersionCheck.ruby_version2?
9+
$LOAD_PATH.unshift(File.expand_path(File.join(__dir__, "../lib/contracts-ruby2/lib")))
10+
else
11+
$LOAD_PATH.unshift(File.expand_path(File.join(__dir__, "../lib/contracts-ruby3/lib")))
12+
end
13+
514
require "contracts"
615

716
# We don't need Contract outside of normal development
817
VALID = [true, nil]
9-
class Contract
18+
class Contract < Contracts::Decorator
1019
def self.valid?(arg, contract)
1120
VALID
1221
end

entitlements-app.gemspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ Gem::Specification.new do |s|
1111
s.files = Dir.glob("lib/**/*") + %w[bin/deploy-entitlements VERSION]
1212
s.homepage = "https://github.com/github/entitlements-app"
1313
s.executables = %w[deploy-entitlements]
14-
s.required_ruby_version = '~> 2.0'
1514

1615
s.add_dependency "concurrent-ruby", "= 1.1.9"
17-
s.add_dependency "contracts", "= 0.16.0"
18-
s.add_dependency "net-ldap", "~> 0.17.0"
16+
s.add_dependency "faraday", "~> 2.0"
17+
s.add_dependency "net-ldap", "~> 0.17"
18+
s.add_dependency "octokit", "~> 4.18"
1919
s.add_dependency "optimist", "= 3.0.0"
2020

21+
s.add_development_dependency "debug", "> 1.0.0"
2122
s.add_development_dependency "rake", "= 13.0.6"
2223
s.add_development_dependency "rspec", "= 3.8.0"
2324
s.add_development_dependency "rspec-core", "= 3.8.0"
@@ -26,7 +27,7 @@ Gem::Specification.new do |s|
2627
s.add_development_dependency "rubocop-performance", "= 1.13.3"
2728
s.add_development_dependency "rugged", "= 0.27.5"
2829
s.add_development_dependency "simplecov", "= 0.16.1"
29-
s.add_development_dependency "simplecov-erb", "= 0.1.1"
30+
s.add_development_dependency "simplecov-erb", "= 1.0.1"
3031
s.add_development_dependency "vcr", "= 4.0.0"
3132
s.add_development_dependency "webmock", "3.4.2"
3233
end
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Code Style Checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'README.md'
9+
push:
10+
branches:
11+
- master
12+
paths-ignore:
13+
- 'README.md'
14+
15+
jobs:
16+
rubocop:
17+
name: Rubocop
18+
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os:
23+
- ubuntu
24+
ruby:
25+
- "2.7"
26+
runs-on: ${{ matrix.os }}-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
- name: Setup Ruby
31+
uses: ruby/setup-ruby@v1
32+
with:
33+
ruby-version: ${{ matrix.ruby }}
34+
bundler-cache: true
35+
- name: Run Rubocop
36+
run: bundle exec rubocop

0 commit comments

Comments
 (0)