selective-ruby-core 0.3.2-arm64-darwin → 0.3.4-arm64-darwin

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98c7b0ecd1f938b62c5c83ed9cff0c3cc5b199029dba5cb5dd045783cba9b9a8
4
- data.tar.gz: cc1e6cb4a1871231ba349abc3c51effe288632bef05e0f31915f0a6792244180
3
+ metadata.gz: d59f87a1c276f3b58851c9277dc5d62dc176c9d07464056131c3ceeae1f976f0
4
+ data.tar.gz: fc8117b5f2e1c63aae71a2c214d304e371615f54f8aca18f96bad78eb3388961
5
5
  SHA512:
6
- metadata.gz: ab414625fec5abd7e4398dc7b3c40babdfc2fad4b878c9a9290925049e63b39da725e64d363599b518d098341e59b63b94c12c1e56d6b1aec8c584caccf926c8
7
- data.tar.gz: d662c2731d999918d0d6351bcd778642874e93e9f552ed719e670fbd856d765f1e4004be517f59e0248dcb8a177d55be74875f0d10e5cc77136c528fb4e2868f
6
+ metadata.gz: 3f7fa329a3fcdac8f0ba56429bd4acb1988fc6d3e7722d607b6563c4654b2c6528ac90a8246e9a3f5a018d1447b70e8da0a253cb4bab72fe1c993b127425554f
7
+ data.tar.gz: bca9d0b2c7840033d149dc07bc5c9fe1d4b852d95ae7b9de0b78776366e5b299265cacfed090d2329aef50bf7df02f387912c5440ac4c3ca6de5a9504539af6b
data/lib/bin/build_env.sh CHANGED
@@ -11,6 +11,18 @@ parse_github_slug() {
11
11
  esac
12
12
  }
13
13
 
14
+ # Parse a "group/subgroup/project" path out of a gitlab.com remote URL (SSH or
15
+ # HTTPS). GitLab nests groups, so everything after the host is the path.
16
+ # Self-managed hosts can't be recognized from the URL; GitLab CI says so itself.
17
+ parse_gitlab_path() {
18
+ local url="$1"
19
+ case "$url" in
20
+ git@gitlab.com:*|https://gitlab.com/*|http://gitlab.com/*|ssh://git@gitlab.com/*|https://*@gitlab.com/*)
21
+ echo "$url" | sed -E 's#^(git@|(https?|ssh)://([^@/]+@)?)gitlab\.com[:/]##; s#\.git/?$##; s#/$##'
22
+ ;;
23
+ esac
24
+ }
25
+
14
26
  # Given a git remote URL, classify the provider as github|gitlab|bitbucket or
15
27
  # empty when unrecognized. Used for the git_provider hint.
16
28
  detect_git_provider_from_url() {
@@ -55,6 +67,30 @@ if [ -n "$GITHUB_ACTIONS" ]; then
55
67
  base_sha=""
56
68
  fi
57
69
  fi
70
+ elif [ -n "$GITLAB_CI" ]; then
71
+ platform=gitlab_ci
72
+ branch=${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-${CI_COMMIT_BRANCH:-$CI_COMMIT_REF_NAME}}
73
+ target_branch=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
74
+ actor=$GITLAB_USER_LOGIN
75
+ sha=$CI_COMMIT_SHA
76
+ # Merged results pipelines run GitLab's merge commit; this is the branch's own commit.
77
+ head_sha=$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
78
+ run_id=$CI_PIPELINE_ID
79
+ run_attempt=1
80
+ runner_id=$CI_NODE_INDEX
81
+ pr_title=$CI_MERGE_REQUEST_TITLE
82
+ commit_message=$CI_COMMIT_TITLE
83
+ # CI_COMMIT_AUTHOR is "Name <email>".
84
+ committer_name=$(echo "$CI_COMMIT_AUTHOR" | sed -E 's/ *<[^>]*>$//')
85
+ committer_email=$(echo "$CI_COMMIT_AUTHOR" | sed -nE 's/.*<([^>]*)>$/\1/p')
86
+ git_repo_full_name=$CI_PROJECT_PATH
87
+ git_provider=gitlab
88
+ # Merge request pipelines give the merge base directly; branch pipelines
89
+ # give the commit the push started from.
90
+ base_sha=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}
91
+ if [ "$base_sha" = "0000000000000000000000000000000000000000" ]; then
92
+ base_sha=""
93
+ fi
58
94
  elif [ -n "$CIRCLECI" ]; then
59
95
  platform=circleci
60
96
  branch=$CIRCLE_BRANCH
@@ -66,12 +102,14 @@ elif [ -n "$CIRCLECI" ]; then
66
102
  committer_name=$(git show -s --format='%an' -n 1 $sha)
67
103
  committer_email=$(git show -s --format='%ae' -n 1 $sha)
68
104
  # CircleCI has no single "slug" env var. Compose from username + reponame.
69
- # These work for both GitHub OAuth and GitHub App pipelines. For non-GitHub
70
- # pipelines (GitLab, Bitbucket) the same vars exist but we gate on the repo
71
- # URL to avoid emitting a non-GitHub slug.
105
+ # These work for both GitHub OAuth and GitHub App pipelines. GitLab nests
106
+ # groups, so its path comes from the repo URL instead; other providers
107
+ # (Bitbucket) get no slug.
72
108
  if [ -n "$CIRCLE_PROJECT_USERNAME" ] && [ -n "$CIRCLE_PROJECT_REPONAME" ]; then
73
109
  git_provider=$(detect_git_provider_from_url "$CIRCLE_REPOSITORY_URL")
74
- if [ "$git_provider" = "github" ] || [ -z "$CIRCLE_REPOSITORY_URL" ]; then
110
+ if [ "$git_provider" = "gitlab" ]; then
111
+ git_repo_full_name=$(parse_gitlab_path "$CIRCLE_REPOSITORY_URL")
112
+ elif [ "$git_provider" = "github" ] || [ -z "$CIRCLE_REPOSITORY_URL" ]; then
75
113
  git_repo_full_name="${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"
76
114
  # If we fell through the "no repo URL" path, default provider to github
77
115
  # since the slug composition path is specific to GitHub-style owner/repo.
@@ -94,7 +132,7 @@ elif [ -n "$SEMAPHORE" ]; then
94
132
  committer_name=$(git show -s --format='%an' -n 1 $sha)
95
133
  committer_email=$(git show -s --format='%ae' -n 1 $sha)
96
134
  git_provider=$SEMAPHORE_GIT_PROVIDER
97
- if [ "$git_provider" = "github" ]; then
135
+ if [ "$git_provider" = "github" ] || [ "$git_provider" = "gitlab" ]; then
98
136
  git_repo_full_name=$SEMAPHORE_GIT_REPO_SLUG
99
137
  fi
100
138
  # SEMAPHORE_GIT_COMMIT_RANGE is "<base>...<head>" on push/PR events; take the
@@ -119,6 +157,9 @@ elif [ -n "$BUILDKITE" ]; then
119
157
  if [ "$BUILDKITE_PIPELINE_PROVIDER" = "github" ]; then
120
158
  git_provider=github
121
159
  git_repo_full_name=$(parse_github_slug "$BUILDKITE_REPO")
160
+ elif [ "$BUILDKITE_PIPELINE_PROVIDER" = "gitlab" ]; then
161
+ git_provider=gitlab
162
+ git_repo_full_name=$(parse_gitlab_path "$BUILDKITE_REPO")
122
163
  else
123
164
  git_provider=$BUILDKITE_PIPELINE_PROVIDER
124
165
  fi
@@ -142,6 +183,8 @@ elif [ -n "$RWX" ]; then
142
183
  git_provider=$(detect_git_provider_from_url "$RWX_GIT_REPOSITORY_URL")
143
184
  if [ "$git_provider" = "github" ]; then
144
185
  git_repo_full_name="${RWX_GIT_REPOSITORY_NAME}"
186
+ elif [ "$git_provider" = "gitlab" ]; then
187
+ git_repo_full_name=$(parse_gitlab_path "$RWX_GIT_REPOSITORY_URL")
145
188
  fi
146
189
  elif [ -n "$MINT" ]; then
147
190
  platform=rwx
@@ -160,6 +203,8 @@ elif [ -n "$MINT" ]; then
160
203
  git_provider=$(detect_git_provider_from_url "$MINT_GIT_REPOSITORY_URL")
161
204
  if [ "$git_provider" = "github" ]; then
162
205
  git_repo_full_name="${MINT_GIT_REPOSITORY_NAME}"
206
+ elif [ "$git_provider" = "gitlab" ]; then
207
+ git_repo_full_name=$(parse_gitlab_path "$MINT_GIT_REPOSITORY_URL")
163
208
  fi
164
209
  fi
165
210
 
@@ -171,9 +216,13 @@ if [ -z "$git_repo_full_name" ] && command -v git >/dev/null 2>&1; then
171
216
  origin_url=$(git config --get remote.origin.url 2>/dev/null || true)
172
217
  if [ -n "$origin_url" ]; then
173
218
  parsed_slug=$(parse_github_slug "$origin_url")
219
+ parsed_gitlab=$(parse_gitlab_path "$origin_url")
174
220
  if [ -n "$parsed_slug" ]; then
175
221
  git_repo_full_name="$parsed_slug"
176
222
  [ -z "$git_provider" ] && git_provider=github
223
+ elif [ -n "$parsed_gitlab" ]; then
224
+ git_repo_full_name="$parsed_gitlab"
225
+ [ -z "$git_provider" ] && git_provider=gitlab
177
226
  elif [ -z "$git_provider" ]; then
178
227
  git_provider=$(detect_git_provider_from_url "$origin_url")
179
228
  fi
data/lib/bin/transport CHANGED
Binary file
@@ -3,7 +3,7 @@
3
3
  module Selective
4
4
  module Ruby
5
5
  module Core
6
- VERSION = "0.3.2"
6
+ VERSION = "0.3.4"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selective-ruby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Benjamin Wood
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2026-11-18 00:00:00.000000000 Z
12
+ date: 2026-11-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: logger
@@ -77,7 +77,6 @@ files:
77
77
  - lib/selective/ruby/core/test_map/tree.rb
78
78
  - lib/selective/ruby/core/test_map/uploader.rb
79
79
  - lib/selective/ruby/core/version.rb
80
- - selective-ruby-core.gemspec
81
80
  homepage: https://www.selective.ci
82
81
  licenses:
83
82
  - MIT
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/selective/ruby/core/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "selective-ruby-core"
7
- spec.version = Selective::Ruby::Core::VERSION
8
- spec.authors = ["Benjamin Wood", "Nate Vick"]
9
- spec.email = ["ben@hint.io", "nate@hint.io"]
10
- spec.license = "MIT"
11
-
12
- # Currently supported release platforms are:
13
- # Linux: x86_64-linux, aarch64-linux
14
- # MacOS: x86_64-darwin, arm64-darwin
15
- if (platform = ENV["RELEASE_PLATFORM"])
16
- spec.platform = platform
17
- end
18
-
19
- spec.summary = "Selective Ruby Client Core"
20
- spec.description = "Selective is an intelligent test runner for your current CI provider. Get real-time test results, intelligent ordering based on code changes, shorter run times, automatic flake detection, the ability to re-enqueue failed tests, and more."
21
- spec.homepage = "https://www.selective.ci"
22
- spec.required_ruby_version = ">= 2.7.0"
23
-
24
- spec.metadata["homepage_uri"] = spec.homepage
25
- spec.metadata["source_code_uri"] = "http://github.com/selectiveci/selective-ruby-core"
26
- spec.metadata["changelog_uri"] = "https://github.com/selectiveci/selective-ruby-core/blob/main/CHANGELOG.md"
27
-
28
- # Specify which files should be added to the gem when it is released.
29
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
- spec.files = Dir.chdir(__dir__) do
31
- `git ls-files -z`.split("\x0").reject do |f|
32
- (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ docs/ rubocop/ simplicity/ test/ spec/ features/ log/ .git .circleci appveyor .rspec .ruby-version .standard.yml .rubocop-simplicity.yml README.md CHANGELOG.md CODE_OF_CONDUCT.md AGENTS.md Gemfile])
33
- end
34
- end
35
-
36
- # Add the transport binary
37
- unless ENV["RELEASE_PLATFORM"].nil?
38
- spec.files << "lib/bin/transport"
39
- end
40
-
41
- # The optional test map tracer. extconf.rb writes a no-op Makefile when it
42
- # can't build (no compiler, unsupported Ruby), so installation never fails
43
- # because of it; the runner then reports it can't record.
44
- spec.extensions = ["ext/selective_tracer/extconf.rb"]
45
-
46
- spec.bindir = "exe"
47
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
48
- spec.require_paths = ["lib"]
49
-
50
- # Uncomment to register a new dependency of your gem
51
- spec.add_dependency("logger", "~> 1.6")
52
- spec.add_dependency("zeitwerk", ">= 2.6.12", "< 3")
53
- end