Skip to content

Commit c3cf388

Browse files
authored
Merge pull request #38 from github/general-updates
General Updates
2 parents 4b76a33 + 4978eeb commit c3cf388

17 files changed

+95
-54
lines changed

.github/workflows/acceptance.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ jobs:
5757
name: runner / acceptance-tests
5858
strategy:
5959
matrix:
60-
ruby: [ '2.7.5', '3.1.2', '3.2.2', '3.3.0' ]
60+
ruby: [ '2.7.5', '3.1.2', '3.2.2', '3.3.0', '3.3.1' ]
6161

6262
steps:
63-
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # pin@v1.152.0
63+
- uses: ruby/setup-ruby@1198b074305f9356bd56dd4b311757cc0dab2f1c # pin@v1.175.1
6464
with:
6565
bundler-cache: true
6666
ruby-version: ${{ matrix.ruby }}

.github/workflows/codeql-analysis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ jobs:
3030

3131
# Initializes the CodeQL tools for scanning.
3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@v2
33+
uses: github/codeql-action/init@v3
3434
with:
3535
languages: ${{ matrix.language }}
3636

3737
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
3838
# If this step fails, then you should remove it and run the build manually (see below)
3939
- name: Autobuild
40-
uses: github/codeql-action/autobuild@v2
40+
uses: github/codeql-action/autobuild@v3
4141
#- run: |
4242
# make bootstrap
4343
# make release
4444

4545
- name: Perform CodeQL Analysis
46-
uses: github/codeql-action/analyze@v2
46+
uses: github/codeql-action/analyze@v3

.github/workflows/lint.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
ruby: [ '2.7.5', '3.1.2', '3.2.2', '3.3.0' ]
18+
ruby: [ '2.7.5', '3.1.2', '3.2.2', '3.3.0', '3.3.1' ]
1919

2020
steps:
2121
- name: checkout
2222
uses: actions/checkout@v4
2323

24-
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # pin@v1.152.0
24+
- uses: ruby/setup-ruby@1198b074305f9356bd56dd4b311757cc0dab2f1c # pin@v1.175.1
2525
with:
2626
ruby-version: ${{ matrix.ruby }}
2727
bundler-cache: true
2828

29+
- name: bootstrap
30+
run: script/bootstrap
31+
2932
- run: bundle exec rubocop -c .rubocop.yml lib/ spec/

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: checkout
2323
uses: actions/checkout@v4
2424

25-
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # pin@v1.152.0
25+
- uses: ruby/setup-ruby@1198b074305f9356bd56dd4b311757cc0dab2f1c # pin@v1.175.1
2626
with:
2727
bundler-cache: true
2828

.github/workflows/test.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
ruby: [ '2.7.5', '3.1.2', '3.2.2', '3.3.0' ]
18+
ruby: [ '2.7.5', '3.1.2', '3.2.2', '3.3.0', '3.3.1' ]
1919

2020
steps:
2121
- name: checkout
2222
uses: actions/checkout@v4
2323

24-
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # pin@v1.152.0
24+
- uses: ruby/setup-ruby@1198b074305f9356bd56dd4b311757cc0dab2f1c # pin@v1.175.1
2525
with:
2626
ruby-version: ${{ matrix.ruby }}
2727
bundler-cache: true
2828

29-
- run: script/test -d
29+
- name: bootstrap
30+
run: script/bootstrap
31+
32+
- run: script/test -d -k

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inherit_gem:
55
AllCops:
66
SuggestExtensions: false
77
DisplayCopNames: true
8-
TargetRubyVersion: 3.3.0
8+
TargetRubyVersion: 3.3.1
99
Exclude:
1010
- 'bin/*'
1111
- 'vendor/**/*'

.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.0
1+
3.3.1

Gemfile.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
PATH
22
remote: .
33
specs:
4-
entitlements-app (0.3.3)
4+
entitlements-app (0.3.4)
55
concurrent-ruby (= 1.1.9)
6-
faraday (~> 2.0)
7-
net-ldap (~> 0.17)
6+
faraday (> 2.0, <= 2.7.10)
7+
net-ldap (~> 0.19)
88
octokit (~> 4.18)
99
optimist (= 3.0.0)
1010

@@ -39,7 +39,7 @@ GEM
3939
reline (>= 0.3.6)
4040
json (2.6.3)
4141
minitest (5.19.0)
42-
net-ldap (0.18.0)
42+
net-ldap (0.19.0)
4343
octokit (4.25.1)
4444
faraday (>= 1, < 3)
4545
sawyer (~> 0.9)

entitlements-app.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
1515
s.executables = %w[deploy-entitlements]
1616

1717
s.add_dependency "concurrent-ruby", "= 1.1.9"
18-
s.add_dependency "faraday", "~> 2.0"
19-
s.add_dependency "net-ldap", "~> 0.17"
18+
s.add_dependency "faraday", "> 2.0", "<= 2.7.10"
19+
s.add_dependency "net-ldap", "~> 0.19"
2020
s.add_dependency "octokit", "~> 4.18"
2121
s.add_dependency "optimist", "= 3.0.0"
2222

lib/entitlements.rb

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
require "erb"
2020
require "logger"
2121
require "ostruct"
22-
require "set"
2322
require "stringio"
2423
require "uri"
2524
require "yaml"

lib/entitlements/backend/base_provider.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# frozen_string_literal: true
22

3-
require "set"
4-
53
module Entitlements
64
class Backend
75
class BaseProvider

lib/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Entitlements
44
module Version
5-
VERSION = "0.3.3"
5+
VERSION = "0.3.4"
66
end
77
end

script/test

+54-25
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
#!/bin/bash
1+
#! /usr/bin/env bash
22

33
# run script/test -h for help
44

5+
# COLORS
6+
OFF='\033[0m'
7+
RED='\033[0;31m'
8+
GREEN='\033[0;32m'
9+
BLUE='\033[0;34m'
10+
511
set -e
612

713
function usage()
814
{
915
echo -e "\t ================== script/test usage =================="
1016
echo -e "\t-h --help : displays help message"
17+
echo -e "\t-k --no-linter : disables linting tests"
1118
echo -e "\t-d --disable-bootstrap : disables bootstrap"
12-
echo -e "\n\t Suggested flags for development: script/test -d"
19+
echo -e "\n\t Suggested flags for development: script/test -d -s"
1320
}
1421

1522
while [ "$1" != "" ]; do
@@ -35,42 +42,64 @@ while [ "$1" != "" ]; do
3542
shift
3643
done
3744

38-
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
39-
40-
export PATH=/usr/share/rbenv/shims:$PATH
41-
export RBENV_VERSION="$(cat "${DIR}/.ruby-version")"
42-
43-
TRASHDIR=$(mktemp -d /tmp/cibuild.XXXXXXXXXXXXXXXXXX)
44-
cleanup() {
45-
rm -rf "$TRASHDIR"
46-
}
47-
trap cleanup EXIT
48-
49-
cd "$DIR"
50-
. "${DIR}/script/lib/fold.sh"
45+
# setup
46+
export DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
47+
[ -z "$RBENV_VERSION" ] && export RBENV_VERSION=$(cat "$DIR/.ruby-version")
5148

5249
if [[ -z $no_bootstrap ]]; then
5350
# bootstrap
54-
begin_fold "Bootstrapping"
55-
./script/bootstrap
56-
end_fold
51+
echo -e "\n🥾 ${BLUE}Bootstrapping: $(date "+%H:%M:%S")${OFF}\n"
52+
echo "%%%FOLD {bootstrap}%%%"
53+
cd "$DIR"
54+
script/bootstrap
55+
echo "%%%END FOLD%%%"
5756
else
58-
echo -e "\nBypass Bootstrap"
57+
echo -e "\n⏩ ${BLUE}Skipping Bootstrap${OFF}"
5958
fi
6059

61-
bundle exec rspec spec/unit && rspec_exit=$? || rspec_exit=$?
60+
# Run Rubocop
61+
if [[ -z $no_linter ]]; then
62+
echo -e "\n🤖 ${BLUE}Running Rubocop: $(date "+%H:%M:%S")${OFF}\n"
63+
bundle exec rubocop -c .rubocop.yml lib/ spec/
64+
else
65+
echo -e "\n⏩ ${BLUE}Skipping Rubocop${OFF}"
66+
fi
67+
68+
# run tests
69+
echo -e "\n🧪 ${BLUE}Running tests: $(date "+%H:%M:%S")${OFF}\n"
70+
cd "$(dirname $0)/.."
6271

63-
cat "$DIR/coverage/coverage.txt"
64-
grep -q "You're all set, friend" "$DIR/coverage/coverage.txt" && cov_exit=0 || cov_exit=1
72+
bundle exec bin/rspec spec/unit && rspec_exit=$? || rspec_exit=$?
73+
74+
total_coverage=$(cat "$DIR/coverage/total-coverage.txt")
75+
76+
if grep -q "100.0" "$DIR/coverage/total-coverage.txt"; then
77+
cov_exit=0
78+
echo -e "\n✅ Total Coverage: ${GREEN}$total_coverage${OFF}"
79+
else
80+
cov_exit=1
81+
echo -e "\n❌ Total Coverage: ${RED}$total_coverage${OFF}"
82+
fi
6583

6684
echo ""
6785
echo "---------------------------------------"
68-
echo "Summary Results"
86+
echo "📊 Summary Results"
6987
echo "---------------------------------------"
7088
echo ""
71-
echo "rspec: exitcode=${rspec_exit}"
72-
echo "coverage: exitcode=${cov_exit}"
89+
90+
if [[ $rspec_exit == 0 ]]; then
91+
echo -e "${GREEN}rspec: exitcode=${rspec_exit}${OFF}"
92+
else
93+
echo -e "${RED}rspec: exitcode=${rspec_exit}${OFF}"
94+
fi
95+
96+
if [[ $cov_exit == 0 ]]; then
97+
echo -e "✅ \033[0;32mcoverage: exitcode=${cov_exit}\033[0m"
98+
else
99+
echo -e "❌ \033[0;31mcoverage: exitcode=${cov_exit}\033[0m"
100+
fi
73101

74102
[ $rspec_exit -gt 0 ] && exit 1
75103
[ $cov_exit -gt 0 ] && exit 1
104+
76105
exit 0

spec/acceptance/tests/spec_helper.rb

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
require "open3"
99
require "rugged"
1010
require "shellwords"
11-
require "set"
1211
require "stringio"
1312
require "tmpdir"
1413
require "uri"

spec/unit/spec_helper.rb

+15-5
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,26 @@
2121
require "vcr"
2222
require "webmock/rspec"
2323

24+
COV_DIR = File.expand_path("../../coverage", File.dirname(__FILE__))
25+
26+
SimpleCov.root File.expand_path("../../", File.dirname(__FILE__))
27+
SimpleCov.coverage_dir COV_DIR
28+
2429
SimpleCov.formatters = [
2530
SimpleCov::Formatter::HTMLFormatter,
2631
SimpleCov::Formatter::ERBFormatter
2732
]
28-
SimpleCov.start do
29-
# don't show specs as missing coverage for themselves
30-
add_filter "/spec/"
3133

32-
# don't analyze coverage for gems
33-
add_filter "/vendor/gems/"
34+
SimpleCov.minimum_coverage 100
35+
36+
SimpleCov.at_exit do
37+
File.write("#{COV_DIR}/total-coverage.txt", SimpleCov.result.covered_percent)
38+
SimpleCov.result.format!
39+
end
40+
41+
SimpleCov.start do
42+
add_filter "spec/"
43+
add_filter "vendor/gems/"
3444
end
3545

3646
require_relative "../../lib/entitlements"

vendor/cache/net-ldap-0.18.0.gem

-65.5 KB
Binary file not shown.

vendor/cache/net-ldap-0.19.0.gem

66 KB
Binary file not shown.

0 commit comments

Comments
 (0)