Skip to content

test(audiobooks): give the login-scope test a source credential - #3303

Closed
Quick104 wants to merge 1 commit into
mainfrom
fix/audiobooks-login-scope-test-source-credential
Closed

Quick104 wants to merge 1 commit into
mainfrom
fix/audiobooks-login-scope-test-source-credential

Conversation

@Quick104

@Quick104 Quick104 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

main fails ci / Go test in internal/audiobooks/abs, so every open pull request's Go test job fails too. Two changes that merged within seconds of each other caused it: #2919 made token issuance reject tokens with no source credential, and #2793 added TestTokenHandlers_ScopeLibrariesToAuthenticatedProfile, whose login case signs in with a principal that has no login session. Each passed CI on its own. Together, the login case gets a 500 (persist tokens: tokens issued with no source credential).

This gives that principal a login session, as the other login tests already do.

Approach

Test-only change: the login case's Principal now sets LoginSessionID. The production check from #2919 is correct and stays as it is. A real login always carries a login session.

Validation

  • go test ./internal/audiobooks/abs/: the failing test fails on main and the package passes with this change.
  • go vet on the package passes. golangci-lint was not run locally; CI's Go lint covers it.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-3303/

No user-visible change. The evidence page has the steps and test output.

Risks

None identified.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code, running in T3 Code
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, not yet human verified
  • Adversarial review: n/a, test-only fixture change

🤖 Generated with Claude Code

The login-envelope scope test (#2793) and the source-credential check in
token issuance (#2919) merged together. The test's login principal carried no
login session, so the token store rejected the issued tokens and the test
failed on main. Give the principal a login session as the other login tests do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Oct 31, 2026
@silo-kody

silo-kody Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T05:11:34.682959Z b0e2127 PR opened
🔒 Security Review ✅ Completed 2026-10-31T05:12:29.985646Z b0e2127 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-triage silo-triage Bot added bug Something isn't working go Pull requests that update go code priority: P1 Core-path bug; painful workaround — next after P0 labels Oct 31, 2026
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 896663b6-b803-4b18-be4c-ede333864fc9
Commits

Reviewing files that changed from the base of the PR and between d31eecb and b0e2127.

Files selected for processing: 1
  • internal/audiobooks/abs/login_scope_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

The login test now sets LoginSessionID to "login-1" in the Principal passed to completeLogin. The other arguments and assertions remain unchanged.

Changes: Login test

Layer / File(s) Summary
Add login session ID
internal/audiobooks/abs/login_scope_test.go
The test's Principal now includes LoginSessionID: "login-1".

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to b0e21

The test fixture correctly exercises session-aware token persistence and is ready to merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the test-only change: adding a source credential to the audiobooks login-scope test.
Description check Passed The description directly explains the failing test, the missing LoginSessionID, the chosen fix, validation results, and the lack of production impact.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code priority: P1 Core-path bug; painful workaround — next after P0 size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant