Skip to content

[CHERRY_PICK] fix(session): fix SessionRegenerate save args and lifetime#22882

Merged
chlins merged 1 commit intogoharbor:release-2.14.0from
chlins:release-2.14/fix/session-lifetime
Mar 20, 2026
Merged

[CHERRY_PICK] fix(session): fix SessionRegenerate save args and lifetime#22882
chlins merged 1 commit intogoharbor:release-2.14.0from
chlins:release-2.14/fix/session-lifetime

Conversation

@chlins
Copy link
Member

@chlins chlins commented Feb 26, 2026

Thank you for contributing to Harbor!

Comprehensive Summary of your change

It's a cherry pick of #22873 and #22726.

This pull request makes improvements to session regeneration handling and enhances test coverage for session management. The main changes ensure that empty session data is stored with the correct type and add additional tests to verify session regeneration behavior.

Session regeneration improvements:

  • Modified SessionRegenerate in session.go to store empty session data as a map instead of an empty string, ensuring correct session data type and consistency.

Session management test enhancements:

  • Added new assertions in TestSessionRegenerate in session_test.go to test session regeneration for a new session ID (session-004), verifying that the session is properly created and exists after regeneration.

Issue being fixed

Fixes #(issue)

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@chlins chlins added the release-note/update Update or Fix label Feb 26, 2026
@chlins chlins requested a review from a team as a code owner February 26, 2026 10:30
@chlins chlins enabled auto-merge (squash) February 26, 2026 10:30
@chlins chlins changed the title fix(session): fix SessionRegenerate save args and lifetime [CHERRY_PICK] fix(session): fix SessionRegenerate save args and lifetime Feb 26, 2026
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release-2.14.0@87ea48a). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##             release-2.14.0   #22882   +/-   ##
=================================================
  Coverage                  ?   65.86%           
=================================================
  Files                     ?     1072           
  Lines                     ?   116078           
  Branches                  ?     2931           
=================================================
  Hits                      ?    76458           
  Misses                    ?    35384           
  Partials                  ?     4236           
Flag Coverage Δ
unittests 65.86% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/core/session/session.go 37.60% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@wy65701436 wy65701436 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@MinerYang MinerYang left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: chlins <chlins.zhang@gmail.com>
@chlins chlins force-pushed the release-2.14/fix/session-lifetime branch from d896858 to 2aec3da Compare March 20, 2026 02:17
@chlins chlins merged commit 859d9a5 into goharbor:release-2.14.0 Mar 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants