Skip to content

chore: Use ReuseTokenSource in NewApplicationTokenSource#22

Merged
jferrl merged 2 commits into
mainfrom
dev/jferrl/pat
Aug 30, 2025
Merged

chore: Use ReuseTokenSource in NewApplicationTokenSource#22
jferrl merged 2 commits into
mainfrom
dev/jferrl/pat

Conversation

@jferrl

@jferrl jferrl commented Aug 30, 2025

Copy link
Copy Markdown
Owner

Updated NewApplicationTokenSource to return an oauth2.ReuseTokenSource instead of the raw token source. This change improves token reuse and caching behavior.

Description

Briefly describe the changes in this PR. What problem does it solve or what feature does it add?

Type of Change

Please delete options that are not relevant.

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/refactoring (no functional changes)
  • 🔧 Chore (dependency updates, tooling, etc.)

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this change manually

Documentation

  • I have updated the documentation accordingly
  • I have updated the CHANGELOG.md file
  • I have added/updated code comments where necessary

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings
  • My changes are compatible with the supported Go versions (1.21+)

Screenshots (if applicable)

If your changes include visual elements, please add screenshots here.

Related Issues

Closes #(issue number)

Additional Notes

Add any other context about the pull request here.

Updated NewApplicationTokenSource to return an oauth2.ReuseTokenSource instead of the raw token source. This change improves token reuse and caching behavior.
@codecov

codecov Bot commented Aug 30, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.28%. Comparing base (768df99) to head (87aa7c0).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #22   +/-   ##
=======================================
  Coverage   94.28%   94.28%           
=======================================
  Files           2        2           
  Lines         140      140           
=======================================
  Hits          132      132           
  Misses          6        6           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Added comments to NewApplicationTokenSource and NewInstallationTokenSource explaining that the returned token sources are wrapped in oauth2.ReuseTokenSource to prevent unnecessary token regeneration. This helps users understand the internal behavior and avoid redundant wrapping.
@jferrl
jferrl merged commit 8adec1a into main Aug 30, 2025
7 checks passed
@jferrl
jferrl deleted the dev/jferrl/pat branch August 30, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant