@@ -265,15 +265,25 @@ function autotune_setup(;
265
265
end
266
266
267
267
"""
268
- share_results(results::AutotuneResults)
268
+ share_results(results::AutotuneResults; auto_login::Bool = true )
269
269
270
270
Share your benchmark results with the LinearSolve.jl community to help improve
271
271
automatic algorithm selection across different hardware configurations.
272
272
273
273
This function will authenticate with GitHub (using gh CLI or token) and post
274
274
your results as a comment to the community benchmark collection issue.
275
275
276
- # Setup Instructions
276
+ If authentication is not found and `auto_login` is true, the function will
277
+ offer to run `gh auth login` interactively to set up authentication.
278
+
279
+ # Arguments
280
+ - `results`: AutotuneResults object from autotune_setup
281
+ - `auto_login`: If true, prompts to authenticate if not already authenticated (default: true)
282
+
283
+ # Authentication Methods
284
+
285
+ ## Automatic (New!)
286
+ If gh is not authenticated, the function will offer to run authentication for you.
277
287
278
288
## Method 1: GitHub CLI (Recommended)
279
289
1. Install GitHub CLI: https://cli.github.com/
@@ -289,19 +299,19 @@ your results as a comment to the community benchmark collection issue.
289
299
5. Set environment variable: `ENV["GITHUB_TOKEN"] = "your_token_here"`
290
300
6. Run this function
291
301
292
- # Arguments
293
- - `results`: AutotuneResults object from autotune_setup
294
-
295
302
# Examples
296
303
```julia
297
304
# Run benchmarks
298
305
results = autotune_setup()
299
306
300
- # Share results with the community
307
+ # Share results with automatic authentication prompt
301
308
share_results(results)
309
+
310
+ # Share results without authentication prompt
311
+ share_results(results; auto_login = false)
302
312
```
303
313
"""
304
- function share_results (results:: AutotuneResults )
314
+ function share_results (results:: AutotuneResults ; auto_login :: Bool = true )
305
315
@info " 📤 Preparing to share benchmark results with the community..."
306
316
307
317
# Extract from AutotuneResults
@@ -314,20 +324,12 @@ function share_results(results::AutotuneResults)
314
324
# Categorize results
315
325
categories = categorize_results (results_df)
316
326
317
- # Set up authentication
318
- @info " 🔗 Setting up GitHub authentication..."
319
- @info " ℹ️ For setup instructions, see the documentation or visit:"
320
- @info " https://cli.github.com/ (for gh CLI)"
321
- @info " https://github.com/settings/tokens/new (for token)"
327
+ # Set up authentication (with auto-login prompt if enabled)
328
+ @info " 🔗 Checking GitHub authentication..."
322
329
323
- github_auth = setup_github_authentication ()
330
+ github_auth = setup_github_authentication (; auto_login = auto_login )
324
331
325
332
if github_auth === nothing || github_auth[1 ] === nothing
326
- @warn " ❌ GitHub authentication not available."
327
- @info " 📝 To share results, please set up authentication:"
328
- @info " Option 1: Install gh CLI and run: gh auth login"
329
- @info " Option 2: Create a GitHub token and set: ENV[\" GITHUB_TOKEN\" ] = \" your_token\" "
330
-
331
333
# Save results locally as fallback
332
334
timestamp = replace (string (Dates. now ()), " :" => " -" )
333
335
fallback_file = " autotune_results_$(timestamp) .md"
@@ -336,7 +338,8 @@ function share_results(results::AutotuneResults)
336
338
write (f, markdown_content)
337
339
end
338
340
@info " 📁 Results saved locally to $fallback_file "
339
- @info " You can manually share this file on the issue tracker."
341
+ @info " You can manually share this file on the issue tracker:"
342
+ @info " https://github.com/SciML/LinearSolve.jl/issues/669"
340
343
return
341
344
end
342
345
0 commit comments