Skip to content

Commit 6896c3d

Browse files
Streamline GitHub authentication for telemetry
- Remove interactive prompts and choices - assume users want to contribute - Provide clear, copy-pasteable setup instructions with direct GitHub link - Use new fine-grained token URL with pre-filled settings - Show enthusiastic messaging about helping the community - Remove "skip telemetry" option from authentication flow - Continue without telemetry if token not set (still save locally) - Update tutorial documentation with streamlined 30-second setup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d34189b commit 6896c3d

File tree

2 files changed

+39
-69
lines changed

2 files changed

+39
-69
lines changed

docs/src/tutorials/autotune.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -308,29 +308,30 @@ By default, autotune results are shared with the LinearSolve.jl community to hel
308308

309309
### GitHub Authentication for Telemetry
310310

311-
When telemetry is enabled, you'll be prompted to authenticate with GitHub:
311+
When telemetry is enabled, the system will check for GitHub authentication:
312312

313313
```julia
314-
# This will prompt for GitHub authentication
314+
# This will show setup instructions if GITHUB_TOKEN not found
315315
results = autotune_setup(telemetry = true)
316316
```
317317

318-
You have three options:
318+
**Quick Setup (30 seconds):**
319319

320-
1. **Environment Variable (Recommended)**: Set `GITHUB_TOKEN` before running Julia:
320+
1. **Create GitHub Token**: Open [https://github.com/settings/tokens?type=beta](https://github.com/settings/tokens?type=beta)
321+
- Click "Generate new token"
322+
- Name: "LinearSolve Autotune"
323+
- Expiration: 90 days (or longer)
324+
- Repository access: "Public Repositories (read-only)"
325+
- Generate and copy the token
326+
327+
2. **Set Environment Variable**:
321328
```bash
322-
export GITHUB_TOKEN=your_personal_access_token
323-
julia
329+
export GITHUB_TOKEN=paste_your_token_here
324330
```
325331

326-
2. **Interactive Authentication**: Enter your token when prompted during autotune
327-
328-
3. **Skip Telemetry**: Choose to continue without sharing results
332+
3. **Restart Julia** and run autotune again
329333

330-
To create a GitHub Personal Access Token:
331-
1. Go to [GitHub Settings > Tokens](https://github.com/settings/tokens)
332-
2. Generate a new token with `public_repo` scope
333-
3. Use it with the autotune process
334+
That's it! Your results will automatically be shared to help the community.
334335

335336
### Disabling Telemetry
336337

lib/LinearSolveAutotune/src/telemetry.jl

Lines changed: 25 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
setup_github_authentication()
55
66
Set 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
"""
99
function 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
8251
end
8352

8453
"""

0 commit comments

Comments
 (0)