Skip to content

Commit 3967830

Browse files
Replace GitHub issue comments with gist-based telemetry
- Switch from problematic GitHub issue comments to public gists - Gists are more reliable, easier to create, and perfect for data sharing - Each benchmark run creates a timestamped gist with full results - Users can search GitHub gists for 'LinearSolve autotune' to see community data - Gists support markdown formatting and are easily discoverable - Remove repo/issue_number parameters - no longer needed - Update documentation to reflect gist-based community sharing GitHub gists are much better suited for this use case than issue comments. They're designed for sharing code/data snippets and have better API support. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b0f7155 commit 3967830

File tree

3 files changed

+40
-26
lines changed

3 files changed

+40
-26
lines changed

docs/src/tutorials/autotune.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,14 @@ This is expected - arbitrary precision arithmetic is much slower than hardware f
318318

319319
## Community and Telemetry
320320

321-
By default, autotune results are shared with the LinearSolve.jl community to help improve algorithm selection for everyone. The shared data includes:
321+
By default, autotune results are shared with the LinearSolve.jl community via public GitHub gists to help improve algorithm selection for everyone. The shared data includes:
322322

323323
- System information (OS, CPU, core count, etc.)
324324
- Algorithm performance results
325325
- NO personal information or sensitive data
326326

327+
Results are uploaded as public gists that can be easily searched and viewed by the community.
328+
327329
### GitHub Authentication for Telemetry
328330

329331
When telemetry is enabled, the system will prompt you to set up GitHub authentication if not already configured:
@@ -333,7 +335,7 @@ When telemetry is enabled, the system will prompt you to set up GitHub authentic
333335
results = autotune_setup(telemetry = true)
334336
```
335337

336-
The system will wait for you to create and paste a GitHub token. This helps the community by sharing performance data across different hardware configurations.
338+
The system will wait for you to create and paste a GitHub token. This helps the community by sharing performance data across different hardware configurations via easily discoverable GitHub gists.
337339

338340
**Interactive Setup:**
339341
The autotune process will show step-by-step instructions and wait for you to:

lib/LinearSolveAutotune/src/LinearSolveAutotune.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function autotune_setup(;
181181

182182
# Upload telemetry if requested
183183
if telemetry && nrow(successful_results) > 0
184-
@info "📤 Preparing telemetry data for sharing..."
184+
@info "📤 Preparing telemetry data for community sharing..."
185185
markdown_content = format_results_for_github(results_df, system_info, categories)
186186
upload_to_github(markdown_content, plot_files, github_auth)
187187
end

lib/LinearSolveAutotune/src/telemetry.jl

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,12 @@ function format_detailed_results_markdown(df::DataFrame)
325325
end
326326

327327
"""
328-
upload_to_github(content::String, plot_files::Union{Nothing, Tuple, Dict}, auth;
329-
repo="SciML/LinearSolve.jl", issue_number=669)
328+
upload_to_github(content::String, plot_files::Union{Nothing, Tuple, Dict}, auth)
330329
331-
Upload benchmark results to GitHub issue as a comment.
330+
Upload benchmark results to GitHub as a gist for community sharing.
332331
Requires a pre-authenticated GitHub.jl auth object.
333332
"""
334-
function upload_to_github(content::String, plot_files::Union{Nothing, Tuple, Dict}, auth;
335-
repo = "SciML/LinearSolve.jl", issue_number = 669)
333+
function upload_to_github(content::String, plot_files::Union{Nothing, Tuple, Dict}, auth)
336334

337335
if auth === nothing
338336
@info "⚠️ No GitHub authentication available. Saving results locally instead of uploading."
@@ -345,39 +343,53 @@ function upload_to_github(content::String, plot_files::Union{Nothing, Tuple, Dic
345343
return
346344
end
347345

348-
@info "📤 Uploading results to GitHub issue #$issue_number in $repo"
346+
@info "📤 Creating GitHub gist with benchmark results..."
349347

350348
try
351-
352-
# Get the repository
353-
repo_obj = GitHub.repo(repo)
354-
355-
# Create the comment content
356-
comment_body = content
357-
358-
# Handle different plot file formats
349+
# Create gist content
350+
gist_content = content
351+
352+
# Add plot file information to the gist
359353
if plot_files !== nothing
360354
if isa(plot_files, Tuple)
361355
# Backward compatibility: single plot
362356
png_file, pdf_file = plot_files
363-
comment_body *= "\n\n**Note**: Benchmark plots have been generated locally as `$png_file` and `$pdf_file`."
357+
gist_content *= "\n\n**Note**: Benchmark plots have been generated locally as `$png_file` and `$pdf_file`."
364358
elseif isa(plot_files, Dict)
365359
# Multiple plots by element type
366-
comment_body *= "\n\n**Note**: Benchmark plots have been generated locally:"
360+
gist_content *= "\n\n**Note**: Benchmark plots have been generated locally:"
367361
for (eltype, files) in plot_files
368362
png_file, pdf_file = files
369-
comment_body *= "\n- $eltype: `$png_file` and `$pdf_file`"
363+
gist_content *= "\n- $eltype: `$png_file` and `$pdf_file`"
370364
end
371365
end
372366
end
373-
374-
# Post the comment using the correct GitHub.jl API
375-
GitHub.create_comment(repo_obj, issue_number; body = comment_body, auth = auth)
376-
377-
@info "✅ Successfully posted benchmark results to GitHub issue #$issue_number"
367+
368+
# Create gist files dictionary
369+
files = Dict{String, Dict{String, String}}()
370+
timestamp = replace(string(Dates.now()), ":" => "-")
371+
filename = "LinearSolve_autotune_$(timestamp).md"
372+
files[filename] = Dict("content" => gist_content)
373+
374+
# Create the gist
375+
gist_data = Dict(
376+
"description" => "LinearSolve.jl Autotune Benchmark Results - $(Dates.format(Dates.now(), "yyyy-mm-dd HH:MM"))",
377+
"public" => true,
378+
"files" => files
379+
)
380+
381+
# Use GitHub.jl to create gist
382+
gist_result = GitHub.create_gist(gist_data; auth = auth)
383+
384+
gist_url = gist_result.html_url
385+
@info "✅ Successfully created GitHub gist: $gist_url"
386+
@info "🔗 Your benchmark results are now available to help the LinearSolve.jl community!"
387+
388+
# Also mention where to find community gists
389+
@info "💡 To see other community benchmarks, search GitHub gists for 'LinearSolve autotune'"
378390

379391
catch e
380-
@warn "❌ Failed to upload to GitHub: $e"
392+
@warn "❌ Failed to create GitHub gist: $e"
381393
@info "💡 This could be due to network issues, repository permissions, or API limits."
382394

383395
# Save locally as fallback

0 commit comments

Comments
 (0)