Skip to content

test: Support stateless GitHub App installation tokens - #4577

Open
sundaypaulfz3-cell wants to merge 1 commit into
google:masterfrom
sundaypaulfz3-cell:stateless-installation-tokens
Open

sundaypaulfz3-cell wants to merge 1 commit into
google:masterfrom
sundaypaulfz3-cell:stateless-installation-tokens

Conversation

@sundaypaulfz3-cell

Copy link
Copy Markdown

Summary

Add regression coverage for GitHub App stateless installation tokens.

GitHub's newer stateless installation tokens can be significantly longer than legacy installation tokens. These tests verify that go-github treats installation tokens as opaque strings rather than imposing fixed-length assumptions.

Changes

  • Add coverage for deserializing a long ghs_ installation token from the installation-token API response.
  • Verify the complete token is preserved without truncation.
  • Add coverage verifying that a long token passed through WithAuthToken is sent unchanged as:
    Authorization: Bearer <token>.
  • Preserve existing authentication behavior for legacy tokens.

Testing

  • go test ./github — passed
  • git diff --check — passed
  • go test -v -race ./github — unable to run because Go's race detector is not supported on Android/ARM64.

The current implementation already treats the token as an opaque string without a fixed-length validation constraint, so this change adds regression coverage for the required behavior.

@google-cla

google-cla Bot commented Sep 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gmlewis gmlewis changed the title test: support stateless GitHub App installation tokens test: Support stateless GitHub App installation tokens Sep 18, 2026
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.59%. Comparing base (8d9197f) to head (f910665).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4577   +/-   ##
=======================================
  Coverage   98.59%   98.59%           
=======================================
  Files         197      197           
  Lines       18326    18326           
=======================================
  Hits        18068    18068           
  Misses        258      258           

☔ View full report in Codecov by Harness.
📢 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.

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