Skip to content

Commit 8f0932c

Browse files
Fix telemetry: GitHub no longer allows anonymous gists
- Replace failed anonymous gist creation with local file save - GitHub API now requires authentication for all gist creation - Provide clear instructions for manual sharing via multiple channels - Generate descriptive filenames with system information - Remove HTTP/JSON dependencies (no longer needed) - Clean user experience with helpful sharing guidance - Ensures benchmark data is always saved and shareable 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 0d5cc0e commit 8f0932c

File tree

3 files changed

+27
-77
lines changed

3 files changed

+27
-77
lines changed

lib/LinearSolveAutotune/Project.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
99
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
1010
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
1111
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
12-
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
13-
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1412
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1513
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
1614
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
@@ -36,8 +34,6 @@ BenchmarkTools = "1"
3634
Base64 = "1"
3735
CSV = "0.10"
3836
DataFrames = "1"
39-
HTTP = "1"
40-
JSON = "0.21"
4137
Plots = "1"
4238
PrettyTables = "2"
4339
Preferences = "1"

lib/LinearSolveAutotune/src/LinearSolveAutotune.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ using Dates
1414
using Base64
1515
using RecursiveFactorization # Hard dependency to ensure RFLUFactorization is available
1616

17-
# Optional dependencies for telemetry and plotting
18-
using HTTP
19-
using JSON
17+
# Optional dependencies for plotting
2018
using Plots
2119

2220
# Load JLL packages when available for better library access
@@ -133,9 +131,9 @@ function autotune_setup(;
133131
@info "Configuration: large_matrices=$large_matrices, telemetry=$telemetry, make_plot=$make_plot, set_preferences=$set_preferences"
134132
@info "Element types to benchmark: $(join(eltypes, ", "))"
135133

136-
# Note: Using anonymous gists for telemetry - no authentication needed
134+
# Note: Telemetry saves results locally with sharing instructions
137135
if telemetry
138-
@info "🌐 Telemetry enabled - will share results via anonymous GitHub gist"
136+
@info "📁 Telemetry enabled - will save results with sharing instructions"
139137
end
140138

141139
# Get system information

lib/LinearSolveAutotune/src/telemetry.jl

Lines changed: 24 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -153,81 +153,37 @@ end
153153
upload_to_github(content::String, plot_files::Union{Nothing, Tuple, Dict}, auth,
154154
results_df::DataFrame, system_info::Dict, categories::Dict)
155155
156-
Share benchmark results via anonymous GitHub gist (no authentication required).
156+
Save benchmark results locally with instructions for community sharing.
157157
"""
158158
function upload_to_github(content::String, plot_files::Union{Nothing, Tuple, Dict}, auth,
159159
results_df::DataFrame, system_info::Dict, categories::Dict)
160160

161-
@info "🌐 Sharing benchmark results via anonymous GitHub gist..."
161+
@info "📁 Saving benchmark results for community sharing..."
162162

163-
try
164-
# Create anonymous gist with benchmark results
165-
gist_url = create_anonymous_gist(content, system_info)
166-
167-
if gist_url !== nothing
168-
@info "✅ Anonymous gist created successfully!"
169-
@info "🔗 Share this URL with the LinearSolve.jl community: $gist_url"
170-
@info "🤝 Your benchmark data helps improve LinearSolve.jl for everyone!"
171-
return
172-
else
173-
@warn "Failed to create anonymous gist"
174-
end
175-
catch e
176-
@warn "❌ Failed to create anonymous gist: $e"
177-
end
178-
179-
# Fallback to local save
180-
@info "📁 Saving results locally as backup..."
163+
# Create timestamp and system identifier for filename
181164
timestamp = replace(string(Dates.now()), ":" => "-")
182-
fallback_file = "autotune_results_$(timestamp).md"
183-
open(fallback_file, "w") do f
165+
cpu_name = get(system_info, "cpu_name", "unknown")
166+
os_name = get(system_info, "os", "unknown")
167+
168+
# Create a descriptive filename
169+
cpu_short = replace(lowercase(cpu_name), r"[^a-zA-Z0-9]" => "_")[1:min(10, end)]
170+
os_short = replace(lowercase(os_name), r"[^a-zA-Z0-9]" => "_")[1:min(6, end)]
171+
filename = "linearsolve_benchmark_$(cpu_short)_$(os_short)_$(timestamp).md"
172+
173+
# Save the results
174+
open(filename, "w") do f
184175
write(f, content)
185176
end
186-
@info "📁 Results saved locally to $fallback_file"
187-
@info "💡 You can manually share this file with the LinearSolve.jl community"
177+
178+
@info "✅ Benchmark results saved to: $filename"
179+
@info ""
180+
@info "🤝 Help improve LinearSolve.jl by sharing your results!"
181+
@info "📋 Easy sharing options:"
182+
@info " 1. Create a GitHub gist: https://gist.github.com (paste file contents)"
183+
@info " 2. Share in Julia Discourse: https://discourse.julialang.org"
184+
@info " 3. Open an issue: https://github.com/SciML/LinearSolve.jl/issues"
185+
@info " 4. Post in Julia Slack/Discord communities"
186+
@info ""
187+
@info "🎯 Your hardware's performance data helps the entire Julia community!"
188188
end
189189

190-
"""
191-
create_anonymous_gist(content, system_info)
192-
193-
Create an anonymous GitHub gist with benchmark results (no auth required).
194-
"""
195-
function create_anonymous_gist(content, system_info)
196-
try
197-
# Create gist payload
198-
cpu_name = get(system_info, "cpu_name", "Unknown CPU")
199-
os_name = get(system_info, "os", "Unknown OS")
200-
timestamp = Dates.format(Dates.now(), "yyyy-mm-dd")
201-
202-
filename = "linearsolve_benchmark_$(cpu_name)_$(os_name)_$(timestamp).md"
203-
# Sanitize filename
204-
filename = replace(filename, r"[^a-zA-Z0-9._-]" => "_")
205-
206-
gist_data = Dict(
207-
"description" => "LinearSolve.jl Autotune Benchmark Results - $cpu_name on $os_name",
208-
"public" => true,
209-
"files" => Dict(
210-
filename => Dict(
211-
"content" => content
212-
)
213-
)
214-
)
215-
216-
# Post to GitHub gist API (no auth required for anonymous gists)
217-
response = HTTP.post(
218-
"https://api.github.com/gists",
219-
["Content-Type" => "application/json"],
220-
JSON.json(gist_data)
221-
)
222-
223-
if response.status == 201
224-
result = JSON.parse(String(response.body))
225-
return result["html_url"]
226-
else
227-
return nothing
228-
end
229-
catch e
230-
@debug "Anonymous gist creation failed: $e"
231-
return nothing
232-
end
233-
end

0 commit comments

Comments
 (0)