Skip to content

Fix: member audit log resolution after transaction commit#23586

Open
Mauraza wants to merge 4 commits into
goharbor:mainfrom
Mauraza:fix-error-message-audit-group
Open

Fix: member audit log resolution after transaction commit#23586
Mauraza wants to merge 4 commits into
goharbor:mainfrom
Mauraza:fix-error-message-audit-group

Conversation

@Mauraza

@Mauraza Mauraza commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to Harbor!

Comprehensive Summary of your change

This fixes issue #23557 by resolving project member audit entries without depending on the original request transaction. As a result, member audit logs remain readable even after the request context has ended.

Issue being fixed

Fixes #23557

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.

@Mauraza
Mauraza requested a review from a team as a code owner July 20, 2026 13:55
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.39%. Comparing base (5713e11) to head (e5daace).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #23586      +/-   ##
==========================================
+ Coverage   66.37%   66.39%   +0.01%     
==========================================
  Files        1073     1073              
  Lines      117750   117751       +1     
  Branches     2965     2965              
==========================================
+ Hits        78161    78178      +17     
+ Misses      35286    35273      -13     
+ Partials     4303     4300       -3     
Flag Coverage Δ
unittests 66.39% <100.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
src/pkg/auditext/event/member/member.go 71.32% <100.00%> (+3.72%) ⬆️

... and 5 files with indirect coverage changes

🚀 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.

Signed-off-by: Ibone Gonzalez <ibone.gonzalez@suse.com>
@stonezdj
stonezdj force-pushed the fix-error-message-audit-group branch from 2dd7c6a to e753ad0 Compare July 21, 2026 03:14
@stonezdj stonezdj added the release-note/update Update or Fix label Jul 21, 2026
Copilot AI review requested due to automatic review settings July 22, 2026 08:11
Signed-off-by: Ibone Gonzalez <ibone.gonzalez@suse.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes member audit-log resolution after request transactions finish.

Changes:

  • Replaces transaction-bound ORM contexts with fresh ORM instances.
  • Adds partial unit coverage for ORM context handling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
member.go Avoids querying through completed transactions.
member_test.go Tests non-transactional context preservation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/pkg/auditext/event/member/member_test.go
Copilot AI review requested due to automatic review settings July 23, 2026 10:18
Signed-off-by: Ibone Gonzalez <ibone.gonzalez@suse.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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

Labels

release-note/update Update or Fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can not resolve member user name in the audit log

6 participants