julewire-gcp 1.0.0 → 1.0.1
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/julewire-gcp.gemspec +1 -1
- data/lib/julewire/gcp/source_location.rb +42 -7
- data/lib/julewire/gcp/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c289a7e7d55450660b7a900745156701baccfecf3d615ec94cefc8ee681a370
|
|
4
|
+
data.tar.gz: 7e6913a9f78df504c928fceae2ba2fbbb908ec71bc113cf0582777e26d1b565e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ceca94f1f5e7f31ae72d8e3a2133237a8ee1e0a22605322cf9695c52dc21dceb5a113d3d08ff980bf441399d74d65bff0665a79e8ff94122799c7edb4e71341
|
|
7
|
+
data.tar.gz: d11cd422b67aa507195eeacd997b1a36db57a13a95ba570b10cf7c21678d525c81e214388032fa4d7382a76a4af4d0e3528aac858905fea99943e9aa96eeb30c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## Unreleased
|
|
2
2
|
|
|
3
|
+
## 1.0.1 - 2026-06-25
|
|
4
|
+
|
|
5
|
+
- Replace the fallback backtrace regex with deterministic parsing so GCP source
|
|
6
|
+
location inference stays boring under CodeQL.
|
|
7
|
+
- Require julewire-core 1.0.1.
|
|
8
|
+
|
|
3
9
|
## 1.0.0 - 2026-06-21
|
|
4
10
|
|
|
5
11
|
- Initial release: Google Cloud Logging formatter, trace fields, source
|
data/julewire-gcp.gemspec
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
module Julewire
|
|
4
4
|
module GCP
|
|
5
5
|
module SourceLocation
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
FUNCTION_SEPARATOR = ":in "
|
|
7
|
+
QUOTE_BYTES = [39, 96].freeze
|
|
8
|
+
private_constant :FUNCTION_SEPARATOR, :QUOTE_BYTES
|
|
8
9
|
|
|
9
10
|
class << self
|
|
10
11
|
def call(options)
|
|
@@ -27,13 +28,22 @@ module Julewire
|
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
def from_backtrace_line(line)
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
line = line.to_s
|
|
32
|
+
index = line.rindex(FUNCTION_SEPARATOR)
|
|
33
|
+
if index
|
|
34
|
+
location = line[0, index]
|
|
35
|
+
function = line[(index + FUNCTION_SEPARATOR.length)..]
|
|
36
|
+
else
|
|
37
|
+
location = line
|
|
38
|
+
function = nil
|
|
39
|
+
end
|
|
40
|
+
file, line_number = split_file_and_line(location)
|
|
41
|
+
return unless line_number
|
|
32
42
|
|
|
33
43
|
call(
|
|
34
|
-
file:
|
|
35
|
-
line:
|
|
36
|
-
function:
|
|
44
|
+
file: file,
|
|
45
|
+
line: line_number,
|
|
46
|
+
function: normalize_function(function)
|
|
37
47
|
)
|
|
38
48
|
end
|
|
39
49
|
|
|
@@ -47,6 +57,31 @@ module Julewire
|
|
|
47
57
|
string = value.to_s
|
|
48
58
|
string if string.match?(/\A\d+\z/)
|
|
49
59
|
end
|
|
60
|
+
|
|
61
|
+
def split_file_and_line(location)
|
|
62
|
+
index = location.rindex(":")
|
|
63
|
+
return unless index
|
|
64
|
+
|
|
65
|
+
file = location[0, index]
|
|
66
|
+
line = location[(index + 1)..]
|
|
67
|
+
return if file.empty? || !line.match?(/\A\d+\z/)
|
|
68
|
+
|
|
69
|
+
[file, line]
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def normalize_function(function)
|
|
73
|
+
return unless function
|
|
74
|
+
|
|
75
|
+
if function.length >= 2 && quoted?(function.getbyte(0)) && quoted?(function.getbyte(-1))
|
|
76
|
+
function[1...-1]
|
|
77
|
+
else
|
|
78
|
+
function
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def quoted?(byte)
|
|
83
|
+
QUOTE_BYTES.include?(byte)
|
|
84
|
+
end
|
|
50
85
|
end
|
|
51
86
|
end
|
|
52
87
|
end
|
data/lib/julewire/gcp/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: julewire-gcp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Grebennik
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 1.0.1
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 1.0.1
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: zeitwerk
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|