checkoff 0.212.0 → 0.213.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34132f08545178fb734e53d13dfd7c26beb191e250271f2a93bea9339a85c5e6
4
- data.tar.gz: ab5ac20f30aa186f4d1644b79dd8cc295e90d27add1f92a4bc26546dda9c2d33
3
+ metadata.gz: aeb9d34366fc0ca26614cd8d25941a680ba7fb0fb5fca6e1ffd4c0fc12a2b778
4
+ data.tar.gz: fc51855eabddefea447704e85fdb9f28eda888fd9a1abe7c435f4885dec6c90e
5
5
  SHA512:
6
- metadata.gz: d2b206e0a283c2ecf73b9128d3831190192d356a98dc2bf5fd2df46febf6997667e0bb2f5323d557a53cebf35f304ec9bda971f7bfec51de69634eedb0a734ab
7
- data.tar.gz: 1e86ffd4af0f6ce5e8d5a4be89ee67fdc48fbbcd5600f48ce517ae2931f488c975c0a049df772cd4bbbfdb4396bcc416553da67d76c9bbebde766b46546dbec8
6
+ metadata.gz: a841034f314c778221fa2b614bcdc39bb40f665a998123d58f61a0a80622b2e1ce9caabc2ce5741fcb4f74dae7ff6b96e0607b8f2d64813eb71c2f2e7f670f30
7
+ data.tar.gz: 678ce73f44ac1afdae1361d6e53d71ff688a0b8d0d92ad14a5b5d6f2b1de9d8b315e865194f6b12e5e0676f2c1c3878fdbcc62d38a6aa8efe5f7fde90e3db97e
data/.circleci/config.yml CHANGED
@@ -22,8 +22,12 @@ commands:
22
22
  eval "$(pyenv init --path)"
23
23
  eval "$(pyenv virtualenv-init -)"
24
24
  eval "$(rbenv init -)"
25
+
25
26
  # keep this in a single place for both main and child builds for cachability
26
- export BUNDLE_PATH="$(pwd)/vendor/bundle"
27
+ BUNDLE_PATH="$(pwd)/vendor/bundle"
28
+ export BUNDLE_PATH
29
+ GEM_HOME="${BUNDLE_PATH}"
30
+ export GEM_HOME
27
31
 
28
32
  <<parameters.command>>
29
33
  environment:
@@ -34,23 +38,30 @@ commands:
34
38
  description: "Install source environment"
35
39
  steps:
36
40
  - checkout
41
+ - run:
42
+ name: Update timestamps to original commit time
43
+ command: |
44
+ git ls-tree -r --name-only HEAD | while read filename; do \
45
+ unixtime=$(git log -1 --format="%at" -- "${filename}")
46
+ touchtime=$(date -d @$unixtime +'%Y%m%d%H%M.%S')
47
+ touch -t ${touchtime} "${filename}"
48
+ done
37
49
  - restore_cache:
38
50
  keys:
39
- - gems-v4-{{ checksum "Gemfile.lock" }}-
40
- - gems-v4-
41
- - gems-
51
+ - rbenv-v3-{{ checksum "Gemfile.lock" }}-
52
+ - rbenv-v3-
53
+ - rbenv-
54
+ - ruby-
42
55
  - restore_cache:
43
56
  keys:
44
- - solargraph-v2-{{ checksum "Gemfile.lock" }}-{{ .Branch }}
45
- - solargraph-v2-{{ checksum "Gemfile.lock" }}-
46
- - solargraph-v2-
47
- - solargraph-
57
+ - pyenv-v2-{{ checksum "requirements_dev.txt" }}-
58
+ - pyenv-v2-
59
+ - pyenv-
48
60
  - restore_cache:
49
61
  keys:
50
- - wheels-v1-3.12.7-{{ checksum "requirements_dev.txt" }}
51
- - wheels-v1-3.12.7-
52
- - wheels-v1-
53
- - wheels-
62
+ - solargraph-v1-{{ checksum "Gemfile.lock" }}-
63
+ - solargraph-v1-
64
+ - solargraph-
54
65
  - run:
55
66
  name: Initialize packages
56
67
  command: |
@@ -59,7 +70,11 @@ commands:
59
70
 
60
71
  # export FIX_SH_TIMING_LOG=/tmp/fix_sh_timing.log
61
72
 
62
- export BUNDLE_PATH="$(pwd)/vendor/bundle"
73
+ BUNDLE_PATH="$(pwd)/vendor/bundle"
74
+ export BUNDLE_PATH
75
+ GEM_HOME="${BUNDLE_PATH}"
76
+ export GEM_HOME
77
+
63
78
  './fix.sh'
64
79
  - store_artifacts:
65
80
  path: /tmp/fix_sh_timing.log
@@ -72,17 +87,19 @@ commands:
72
87
  exit 1
73
88
  fi
74
89
  - save_cache:
75
- key: gems-v4-{{ checksum "Gemfile.lock" }}-{{ checksum ".ruby-version" }}
90
+ key: rbenv-v3-{{ checksum "Gemfile.lock" }}-{{ checksum ".ruby-version" }}
76
91
  paths:
92
+ - "Gemfile.lock.installed"
93
+ - "types.installed"
77
94
  - "vendor/bundle"
95
+ - "/home/circleci/.rbenv"
78
96
  - ".yardoc"
79
- - "/home/circleci/.rbenv/versions/3.1.6/lib/ruby/gems/"
80
97
  - save_cache:
81
- key: wheels-v1-3.12.7-{{ checksum "requirements_dev.txt" }}
98
+ key: pyenv-v2-{{ checksum "requirements_dev.txt" }}-{{ checksum ".python-version" }}
82
99
  paths:
100
+ - "requirements_dev.txt.installed"
83
101
  - "/home/circleci/.cache/pip/wheels"
84
- - "/home/circleci/.pyenv/versions/3.12.7/envs/checkoff-3.12.7"
85
- - "/home/circleci/.pyenv/versions/checkoff-3.12.7"
102
+ - "/home/circleci/.pyenv"
86
103
  - run:
87
104
  name: Download new circleci tool
88
105
  command: |
@@ -196,13 +213,13 @@ jobs:
196
213
  quality:
197
214
  working_directory: ~/checkoff
198
215
  docker:
199
- - image: apiology/circleci-ruby:latest
216
+ - image: cimg/base:current
200
217
  steps:
201
218
  - quality
202
219
  build:
203
220
  working_directory: ~/checkoff
204
221
  docker:
205
- - image: apiology/circleci-ruby:latest
222
+ - image: cimg/base:current
206
223
  steps:
207
224
  - set_up_environment
208
225
  - when:
@@ -214,21 +231,20 @@ jobs:
214
231
  # - run_with_languages:
215
232
  # label: Typecheck
216
233
  # command: make citypecheck citypecoverage
234
+ - save_cache:
235
+ key: solargraph-v1-{{ checksum "Gemfile.lock" }}-{{ checksum ".ruby-version" }}
236
+ paths:
237
+ - "/home/circleci/.cache/solargraph"
217
238
  - run_with_languages:
218
239
  label: Test
219
240
  command: |
220
241
  make citest cicoverage
221
- - save_cache:
222
- key: solargraph-v2-{{ checksum "Gemfile.lock" }}-{{ .Branch }}
223
- paths:
224
- - ".yardoc"
225
- - "/home/circleci/.cache/solargraph"
226
242
  # This seemed to shave 5ish% of the build time off when added
227
243
  resource_class: large
228
244
  publish_gem:
229
245
  working_directory: ~/checkoff
230
246
  docker:
231
- - image: apiology/circleci-ruby:latest
247
+ - image: cimg/base:current
232
248
  steps:
233
249
  - set_up_environment
234
250
  - run_with_languages:
data/.envrc CHANGED
@@ -2,3 +2,8 @@
2
2
  PATH_add bin
3
3
 
4
4
  direnv_load op run --cache --env-file=config/env.1p -- direnv dump
5
+
6
+ BUNDLE_PATH="$(pwd)/vendor/bundle"
7
+ export BUNDLE_PATH
8
+ GEM_HOME="${BUNDLE_PATH}"
9
+ export GEM_HOME
data/Gemfile.lock CHANGED
@@ -43,7 +43,7 @@ GIT
43
43
  PATH
44
44
  remote: .
45
45
  specs:
46
- checkoff (0.212.0)
46
+ checkoff (0.213.0)
47
47
  activesupport
48
48
  asana (> 0.10.0)
49
49
  cache_method
@@ -167,16 +167,16 @@ GEM
167
167
  multi_xml (0.6.0)
168
168
  multipart-post (2.3.0)
169
169
  mutex_m (0.3.0)
170
- nokogiri (1.16.7)
170
+ nokogiri (1.16.8)
171
171
  mini_portile2 (~> 2.8.2)
172
172
  racc (~> 1.4)
173
- nokogiri (1.16.7-aarch64-linux)
173
+ nokogiri (1.16.8-aarch64-linux)
174
174
  racc (~> 1.4)
175
- nokogiri (1.16.7-arm64-darwin)
175
+ nokogiri (1.16.8-arm64-darwin)
176
176
  racc (~> 1.4)
177
- nokogiri (1.16.7-x86_64-darwin)
177
+ nokogiri (1.16.8-x86_64-darwin)
178
178
  racc (~> 1.4)
179
- nokogiri (1.16.7-x86_64-linux)
179
+ nokogiri (1.16.8-x86_64-linux)
180
180
  racc (~> 1.4)
181
181
  oauth2 (1.4.11)
182
182
  faraday (>= 0.17.3, < 3.0)
@@ -198,7 +198,7 @@ GEM
198
198
  public_suffix (5.0.4)
199
199
  punchlist (1.3.2)
200
200
  source_finder (>= 2)
201
- racc (1.7.3)
201
+ racc (1.8.1)
202
202
  rack (3.0.8)
203
203
  rainbow (3.1.1)
204
204
  rake (13.1.0)
@@ -263,6 +263,7 @@ PLATFORMS
263
263
  aarch64-linux
264
264
  arm64-darwin-23
265
265
  arm64-linux
266
+ ruby
266
267
  x86_64-darwin-23
267
268
  x86_64-linux
268
269
  x86_64-linux-musl
data/Makefile CHANGED
@@ -17,9 +17,12 @@ help:
17
17
 
18
18
  default: clean-coverage test coverage clean-typecoverage typecheck typecoverage quality ## run default typechecking, tests and quality
19
19
 
20
- build-typecheck: bundle_install ## Fetch information that type checking depends on
20
+ build-typecheck: types.installed ## Fetch information that type checking depends on
21
+
22
+ types.installed: Gemfile.lock Gemfile.lock.installed ## Install Ruby dependencies
21
23
  bundle exec yard gems 2>&1 || bundle exec yard gems --safe 2>&1 || bundle exec yard gems 2>&1
22
24
  # bundle exec solargraph scan 2>&1
25
+ touch types.installed
23
26
 
24
27
  clean-typecheck: ## Refresh information that type checking depends on
25
28
  bundle exec solargraph clear
@@ -100,7 +103,7 @@ update_from_cookiecutter: ## Bring in changes from template project used to crea
100
103
  git merge cookiecutter-template || true
101
104
  git checkout --ours Gemfile.lock || true
102
105
  # update frequently security-flagged gems while we're here
103
- bundle update --conservative rexml || true
106
+ bundle update --conservative rexml nokogiri || true
104
107
  git add Gemfile.lock || true
105
108
  bundle install || true
106
109
  bundle exec overcommit --install || true
data/fix.sh CHANGED
@@ -127,7 +127,7 @@ ensure_binary_library() {
127
127
  ! [ -f /usr/local/lib/"${library_base_name}.so" ] && \
128
128
  ! [ -f /usr/local/opt/"${homebrew_package}/lib/${library_base_name}*.dylib" ]
129
129
  then
130
- if ! compgen -G "/opt/homebrew/Cellar/${homebrew_package}"*/*/"lib/${library_base_name}"*.dylib
130
+ if ! compgen -G "/opt/homebrew/Cellar/${homebrew_package}"*/*/"lib/${library_base_name}"*.dylib >/dev/null 2>&1
131
131
  then
132
132
  install_package "${homebrew_package}" "${apt_package}"
133
133
  fi
@@ -148,10 +148,21 @@ ensure_latest_ruby_build_definitions() {
148
148
  # # if not pulled in last 24 hours
149
149
  # if [ $(( $(date +%s) - last_pulled_unix_epoch )) -gt $(( 24 * 60 * 60 )) ]
150
150
  # then
151
- git -C "$(rbenv root)"/plugins/ruby-build pull
151
+ git -C "$HOME"/.rbenv/plugins/ruby-build pull
152
152
  # fi
153
153
  }
154
154
 
155
+ # https://stackoverflow.com/questions/2829613/how-do-you-tell-if-a-string-contains-another-string-in-posix-sh
156
+ contains() {
157
+ string="$1"
158
+ substring="$2"
159
+ if [ "${string#*"$substring"}" != "$string" ]; then
160
+ return 0 # $substring is in $string
161
+ else
162
+ return 1 # $substring is not in $string
163
+ fi
164
+ }
165
+
155
166
  # You can find out which feature versions are still supported / have
156
167
  # been release here: https://www.ruby-lang.org/en/downloads/
157
168
  ensure_ruby_versions() {
@@ -161,14 +172,21 @@ ensure_ruby_versions() {
161
172
  # been release here: https://www.ruby-lang.org/en/downloads/
162
173
  ruby_versions="$(latest_ruby_version 3.1)"
163
174
 
164
- echo "Latest Ruby versions: ${ruby_versions}"
175
+ installed_ruby_versions="$(rbenv versions --bare --skip-aliases)"
165
176
 
166
- ensure_ruby_build_requirements
177
+ echo "Latest Ruby versions: ${ruby_versions}"
167
178
 
168
179
  for ver in $ruby_versions
169
180
  do
170
- rbenv install -s "${ver}"
171
- hash -r # ensure we are seeing latest bundler etc
181
+ if ! contains "${installed_ruby_versions}"$'\n' "${ver}"$'\n'; then
182
+ echo "Installing Ruby version $ver - existing versions: $installed_ruby_versions"
183
+ ensure_ruby_build_requirements
184
+
185
+ rbenv install -s "${ver}"
186
+ hash -r # ensure we are seeing latest bundler etc
187
+ else
188
+ echo "Found Ruby version $ver already installed"
189
+ fi
172
190
  done
173
191
  }
174
192
 
@@ -178,7 +196,7 @@ ensure_bundle() {
178
196
  # https://app.circleci.com/pipelines/github/apiology/source_finder/21/workflows/88db659f-a4f4-4751-abc0-46f5929d8e58/jobs/107
179
197
  set_rbenv_env_variables
180
198
  type bundle >/dev/null 2>&1 || gem install --no-document bundler
181
- bundler_version=$(bundle --version | cut -d ' ' -f3)
199
+ bundler_version="$(ruby -e 'require "rubygems"; puts Gem::BundlerVersionFinder.bundler_version')"
182
200
  bundler_version_major=$(cut -d. -f1 <<< "${bundler_version}")
183
201
  bundler_version_minor=$(cut -d. -f2 <<< "${bundler_version}")
184
202
  bundler_version_patch=$(cut -d. -f3 <<< "${bundler_version}")
@@ -233,7 +251,14 @@ ensure_bundle() {
233
251
  #
234
252
  # This affects nokogiri, which will try to reinstall itself in
235
253
  # Docker builds where it's already installed if this is not run.
236
- bundle lock --add-platform arm64-darwin-23 x86_64-darwin-23 x86_64-linux x86_64-linux-musl aarch64-linux arm64-linux
254
+ PLATFORMS="ruby arm64-darwin-23 x86_64-darwin-23 x86_64-linux x86_64-linux-musl aarch64-linux arm64-linux"
255
+ for platform in ${PLATFORMS}
256
+ do
257
+ if ! grep -q "^ ${platform}$" Gemfile.lock
258
+ then
259
+ bundle lock --add-platform "${platform}"
260
+ fi
261
+ done
237
262
  make bundle_install
238
263
  }
239
264
 
@@ -364,24 +389,32 @@ ensure_python_versions() {
364
389
 
365
390
  echo "Latest Python versions: ${python_versions}"
366
391
 
367
- ensure_python_build_requirements
392
+ installed_python_versions="$(pyenv versions --skip-envs --skip-aliases --bare)"
368
393
 
369
394
  for ver in $python_versions
370
395
  do
371
- if [ "$(uname)" == Darwin ]
372
- then
373
- if [ -z "${HOMEBREW_OPENSSL_PREFIX:-}" ]
396
+ if ! contains "${installed_python_versions}"$'\n' "${ver}"$'\n'; then
397
+ echo "Installing Python version $ver - existing versions: $installed_python_versions"
398
+ ensure_python_build_requirements
399
+
400
+ if [ "$(uname)" == Darwin ]
374
401
  then
375
- HOMEBREW_OPENSSL_PREFIX="$(brew --prefix openssl)"
402
+ if [ -z "${HOMEBREW_OPENSSL_PREFIX:-}" ]
403
+ then
404
+ HOMEBREW_OPENSSL_PREFIX="$(brew --prefix openssl)"
405
+ fi
406
+ pyenv_install() {
407
+ CFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I${HOMEBREW_OPENSSL_PREFIX}/include" LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib -L${HOMEBREW_OPENSSL_PREFIX}/lib" pyenv install --skip-existing "$@"
408
+ }
409
+
410
+ major_minor="$(cut -d. -f1-2 <<<"${ver}")"
411
+ pyenv_install "${ver}"
412
+ else
413
+ pyenv install -s "${ver}"
376
414
  fi
377
- pyenv_install() {
378
- CFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I${HOMEBREW_OPENSSL_PREFIX}/include" LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib -L${HOMEBREW_OPENSSL_PREFIX}/lib" pyenv install --skip-existing "$@"
379
- }
380
-
381
- major_minor="$(cut -d. -f1-2 <<<"${ver}")"
382
- pyenv_install "${ver}"
415
+ hash -r
383
416
  else
384
- pyenv install -s "${ver}"
417
+ echo "Found Python version $ver already installed"
385
418
  fi
386
419
  done
387
420
  }
@@ -404,7 +437,7 @@ ensure_pyenv_virtualenvs() {
404
437
 
405
438
  ensure_pip_and_wheel() {
406
439
  # https://cve.mitre.org/cgi-bin/cvename.cgi?name=2023-5752
407
- pip_version=$(pip --version | cut -d' ' -f2)
440
+ pip_version=$(python -c "import pip; print(pip.__version__)" | cut -d' ' -f2)
408
441
  major_pip_version=$(cut -d '.' -f 1 <<< "${pip_version}")
409
442
  minor_pip_version=$(cut -d '.' -f 2 <<< "${pip_version}")
410
443
  if [[ major_pip_version -lt 23 ]]
@@ -415,7 +448,7 @@ ensure_pip_and_wheel() {
415
448
  pip install 'pip>=23.3'
416
449
  fi
417
450
  # wheel is helpful for being able to cache long package builds
418
- type wheel || pip install wheel
451
+ type wheel >/dev/null 2>&1 || pip install wheel
419
452
  }
420
453
 
421
454
  ensure_python_requirements() {
@@ -443,9 +476,26 @@ ensure_overcommit() {
443
476
  }
444
477
 
445
478
  ensure_rugged_packages_installed() {
446
- ensure_binary_library libicuio icu4c libicu-dev # needed by rugged, needed by undercover
447
- ensure_package pkg-config # needed by rugged, needed by undercover
448
- ensure_package cmake # needed by rugged, needed by undercover
479
+ # only needed if we don't already have rugged installed
480
+ if ! ls vendor/bundle/ruby/*/gems/rugged-* &>/dev/null
481
+ then
482
+ echo "Current directory"
483
+ pwd
484
+ echo "Vendor dir"
485
+ ls -l vendor
486
+ echo "List of vendor/bundle/gems:"
487
+ ls vendor/bundle/gems
488
+ echo "Did not find rugged gem installed; installing packages needed for rugged"
489
+ echo "Installed gems:"
490
+ gem list
491
+ echo "Gem environment:"
492
+ gem environment
493
+ echo "Bundle list:"
494
+ bundle list
495
+ ensure_binary_library libicuio icu4c libicu-dev # needed by rugged, needed by undercover
496
+ ensure_package pkg-config # needed by rugged, needed by undercover
497
+ ensure_package cmake # needed by rugged, needed by undercover
498
+ fi
449
499
  }
450
500
 
451
501
  ensure_rbenv
@@ -3,5 +3,5 @@
3
3
  # Command-line and gem client for Asana (unofficial)
4
4
  module Checkoff
5
5
  # Version of library
6
- VERSION = '0.212.0'
6
+ VERSION = '0.213.0'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.212.0
4
+ version: 0.213.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz