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