44 setup_github_authentication()
55
66Set up GitHub authentication for telemetry uploads.
7- Returns authentication object if successful, nothing if user cancels .
7+ Returns authentication object if successful, nothing if setup needed .
88"""
99function setup_github_authentication ()
1010 # Check if GITHUB_TOKEN environment variable exists
1111 if haskey (ENV , " GITHUB_TOKEN" ) && ! isempty (ENV [" GITHUB_TOKEN" ])
1212 try
1313 auth = GitHub. authenticate (ENV [" GITHUB_TOKEN" ])
14- @info " ✅ GitHub authentication successful using GITHUB_TOKEN environment variable "
14+ @info " ✅ GitHub authentication successful - ready to share results! "
1515 return auth
1616 catch e
1717 @warn " ❌ GITHUB_TOKEN exists but authentication failed: $e "
@@ -20,65 +20,34 @@ function setup_github_authentication()
2020 end
2121 end
2222
23- # No environment variable - ask user to authenticate
23+ # No environment variable - provide setup instructions
2424 println ()
25- println (" 🔐 GitHub Authentication Required for Telemetry " )
25+ println (" 🚀 Help Improve LinearSolve.jl for Everyone! " )
2626 println (" =" ^ 50 )
27- println (" To share benchmark results with the LinearSolve.jl community, you need to " )
28- println (" authenticate with GitHub. This helps improve algorithm selection for everyone! " )
27+ println (" Your benchmark results help the community by improving automatic " )
28+ println (" algorithm selection. Setting up GitHub authentication takes 30 seconds: " )
2929 println ()
30- println (" Options:" )
31- println (" 1. Set GITHUB_TOKEN environment variable (recommended for automation)" )
32- println (" 2. Authenticate interactively now" )
33- println (" 3. Skip telemetry (disable sharing)" )
30+ println (" 📋 Quick Setup (copy & paste these commands):" )
3431 println ()
32+ println (" 1️⃣ Create a GitHub token:" )
33+ println (" Open: https://github.com/settings/tokens?type=beta" )
34+ println (" • Click 'Generate new token'" )
35+ println (" • Name: 'LinearSolve Autotune'" )
36+ println (" • Expiration: 90 days (or longer)" )
37+ println (" • Repository access: 'Public Repositories (read-only)'" )
38+ println (" • Click 'Generate token' and copy it" )
39+ println ()
40+ println (" 2️⃣ Set the token (paste your token after the =):" )
41+ println (" export GITHUB_TOKEN=paste_your_token_here" )
42+ println ()
43+ println (" 3️⃣ Restart Julia and run autotune again" )
44+ println ()
45+ println (" That's it! Your results will automatically be shared to help everyone." )
46+ println (" =" ^ 50 )
47+ println ()
48+ println (" ⏭️ Continuing without telemetry for now (results saved locally)" )
3549
36- while true
37- print (" Choose option (1/2/3): " )
38- choice = readline ()
39-
40- if choice == " 1"
41- println ()
42- println (" To set up GITHUB_TOKEN:" )
43- println (" 1. Go to https://github.com/settings/tokens" )
44- println (" 2. Generate a Personal Access Token with 'public_repo' scope" )
45- println (" 3. Set environment variable: export GITHUB_TOKEN=your_token_here" )
46- println (" 4. Restart Julia and run autotune again" )
47- println ()
48- println (" ⚠️ Continuing without telemetry for this session..." )
49- return nothing
50-
51- elseif choice == " 2"
52- println ()
53- print (" Enter your GitHub Personal Access Token: " )
54- token = readline ()
55-
56- if isempty (token)
57- println (" ❌ No token provided. Skipping telemetry." )
58- return nothing
59- end
60-
61- try
62- # Set temporarily for this session
63- ENV [" GITHUB_TOKEN" ] = token
64- auth = GitHub. authenticate (token)
65- println (" ✅ Authentication successful! Token set for this session." )
66- return auth
67- catch e
68- println (" ❌ Authentication failed: $e " )
69- println (" Please check that your token is valid and has 'public_repo' scope." )
70- continue
71- end
72-
73- elseif choice == " 3"
74- println (" ⚠️ Skipping telemetry. Results will not be shared with the community." )
75- return nothing
76-
77- else
78- println (" ❌ Invalid choice. Please enter 1, 2, or 3." )
79- continue
80- end
81- end
50+ return nothing
8251end
8352
8453"""
0 commit comments