Skip to content

Add NewAmfRanDefault function to properly initialize log#745

Merged
gab-arrobo merged 2 commits into
omec-project:mainfrom
gab-arrobo:add-NewAmfRanDefault
Jul 10, 2026
Merged

Add NewAmfRanDefault function to properly initialize log#745
gab-arrobo merged 2 commits into
omec-project:mainfrom
gab-arrobo:add-NewAmfRanDefault

Conversation

@gab-arrobo

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a standard constructor for context.AmfRan that pre-initializes its logger, then updates NGAP/GMM tests and dispatcher logic to use that constructor so ran.Log is not nil.

Changes:

  • Add context.NewAmfRanDefault() to create an AmfRan with Log initialized to logger.NgapLog.
  • Update multiple tests to construct RAN contexts via NewAmfRanDefault() instead of ad-hoc &context.AmfRan{...}.
  • Update ngap.DispatchLb to use NewAmfRanDefault() in the “GnbIpAddr but no GnbId” path, and simplify error logging in DispatchNgapMsg to use ran.Log directly.

Reviewed changes

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

Show a summary per file
File Description
context/amf_ran.go Adds NewAmfRanDefault() to ensure AmfRan.Log is initialized by default.
ngap/dispatcher.go Uses the new constructor in one dispatch path; simplifies logging by removing fallback logger branches.
ngap/dispatcher_test.go Updates dispatcher tests to use NewAmfRanDefault() instead of a noop zap logger.
ngap/handler_test.go Replaces direct AmfRan allocations (with zap noop loggers) with NewAmfRanDefault().
ngap/message/build_test.go Switches test RAN creation to NewAmfRanDefault() and sets AnType explicitly.
gmm/handler_test.go Updates GMM tests to construct AmfRan via NewAmfRanDefault() and then set required fields.

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

Comment thread ngap/dispatcher.go
Copilot AI review requested due to automatic review settings July 10, 2026 06:03

Copilot AI left a comment

Copy link
Copy Markdown

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 7 out of 7 changed files in this pull request and generated no new comments.

Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>
Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>
Copilot AI review requested due to automatic review settings July 10, 2026 06:21
@gab-arrobo
gab-arrobo force-pushed the add-NewAmfRanDefault branch from 791c671 to 6a5b2d3 Compare July 10, 2026 06:21

Copilot AI left a comment

Copy link
Copy Markdown

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 7 out of 7 changed files in this pull request and generated no new comments.

@gab-arrobo
gab-arrobo merged commit 793c890 into omec-project:main Jul 10, 2026
12 checks passed
@gab-arrobo
gab-arrobo deleted the add-NewAmfRanDefault branch July 10, 2026 06:33
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.

3 participants