Skip to content

feat: PR with bumped version for release#20

Merged
jonasXchen merged 1 commit into
masterfrom
docs/added-v2-and-anchor-v1-support
May 26, 2026
Merged

feat: PR with bumped version for release#20
jonasXchen merged 1 commit into
masterfrom
docs/added-v2-and-anchor-v1-support

Conversation

@jonasXchen
Copy link
Copy Markdown
Contributor

@jonasXchen jonasXchen commented May 26, 2026

  • added CI tests before publish
  • bumped version to 3.1.1
  • updated README

Summary by CodeRabbit

Documentation

  • Updated documentation to emphasize SessionTokenV2 for new implementations
  • Clarified backwards compatibility support for SessionToken V1
  • Added complete examples and implementation guidance for both versions

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Walkthrough

Updated README for the gpl_session program to establish SessionTokenV2 as the recommended approach. The documentation introduces V2-first usage patterns in the main section, provides an updated instruction struct example, and adds comprehensive guidance for both V1 backwards-compatibility and complete V2 implementation with extended external references.

Changes

SessionTokenV2 Documentation Update

Layer / File(s) Summary
V2 prioritization and usage introduction
programs/gpl_session/README.md
Usage section establishes SessionTokenV2 as the latest approach, notes SessionToken (V1) remains supported for backwards compatibility, and clarifies that the Session derive auto-detects version based on field type.
Instruction struct example update
programs/gpl_session/README.md
Sample Anchor instruction struct updated to declare session_token as Option<Account<..., SessionTokenV2>>, with surrounding handler macro example reorganized to match V2 flow.
Backwards-compatibility guidance and extended examples
programs/gpl_session/README.md
New dedicated V1 section showing how to maintain SessionToken (V1) usage and how to explicitly require V2 via #[derive(SessionV2)]. Adds complete "Full V2 example" with end-to-end Anchor program and #[session_auth_or(...)] usage patterns. Updates "More examples" section with additional external references.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested reviewers

  • GabrielePicco
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and lacks the structured format required by the template, missing critical sections like Problem, Solution, Deploy Notes, and issue links. Expand the description to follow the template structure: explain the problem being solved, detail the solution, include any deployment notes, and link relevant issues.
Title check ❓ Inconclusive The title 'feat: PR with bumped version for release' is vague and generic, mentioning version bumping but not the actual substantive change which is updating README documentation for SessionTokenV2 support. Consider a more specific title like 'docs: Update README to prioritize SessionTokenV2 usage' that clearly indicates the main documentation improvement being made.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/added-v2-and-anchor-v1-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@programs/gpl_session/README.md`:
- Line 47: Reword the sentence to clarify intended behavior: replace "who the
instruction should validate the signer when sessions are not present" with a
clearer phrase such as "how to validate the signer when no session token is
present" and ensure the surrounding text still explains adding the
session_auth_or macro to your instruction handler with fallback logic and an
appropriate ErrorCode (reference: session_auth_or and any require*! usage in the
instruction handler).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c14a0612-2583-46a8-b12b-fc1d0380dc6f

📥 Commits

Reviewing files that changed from the base of the PR and between 0fe140f and 3350356.

📒 Files selected for processing (1)
  • programs/gpl_session/README.md

```

3. Add the `session_auth_or` macro to your instruction handler with fallback logic on who the instruction should validate the signer when sessions are not present and an appropirate ErrorCode. If you've used `require*!` macros in anchor_lang you already know how this works.
3. Add the `session_auth_or` macro to your instruction handler with fallback logic on who the instruction should validate the signer when sessions are not present and an appropriate ErrorCode. If you've used `require*!` macros in anchor_lang you already know how this works.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Consider clarifying the wording.

The phrase "who the instruction should validate the signer when sessions are not present" is slightly unclear. Consider rephrasing to something like "how to validate the signer when no session token is present" for improved clarity.

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 47-47: Ordered list item prefix
Expected: 1; Actual: 3; Style: 1/1/1

(MD029, ol-prefix)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@programs/gpl_session/README.md` at line 47, Reword the sentence to clarify
intended behavior: replace "who the instruction should validate the signer when
sessions are not present" with a clearer phrase such as "how to validate the
signer when no session token is present" and ensure the surrounding text still
explains adding the session_auth_or macro to your instruction handler with
fallback logic and an appropriate ErrorCode (reference: session_auth_or and any
require*! usage in the instruction handler).

@jonasXchen jonasXchen merged commit 91c631e into master May 26, 2026
3 checks passed
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