Skip to content

Improved Fully-Qualified References

Compare
Choose a tag to compare
@jongpie jongpie released this 11 Jul 17:03
· 5 commits to main since this release
48ea5fe

Since the unlocked package does not have a namespace, orgs can encounter installation errors for Nebula Logger if the target org has any custom Apex code (classes, enums, interfaces, etc.) with the same name as standard class in the Schema or System namespace (referred to as name shadowing).

This is the same concept & approach as the changes made in several previous releases (listed below) - but my hope is that this PR finally finishes this effort, and all references are now fully qualified.

This shouldn't cause any functional changes to Nebula Logger - this is to tidy up existing references to avoid name collisions so that more orgs can use the unlocked package.

Core Unlocked Package Changes

Apex Code Changes

  • Switched to using fully-qualified references for these standard classes in the Schema and System namespaces :

    • Schema namespace standard classes
      • ApexClassSchema.ApexClass
      • ApexEmailNotificationSchema.ApexEmailNotification
      • ApexTriggerSchema.ApexTrigger
      • AsyncApexJobSchema.AsyncApexJob
      • BatchApexErrorEventSchema.BatchApexErrorEvent
      • CustomPermissionSchema.CustomPermission
      • DisplayTypeSchema.DisplayType
      • FlowDefinitionViewSchema.FlowDefinitionView
      • FlowExecutionErrorEventSchema.FlowExecutionErrorEvent
      • FlowVersionViewSchema.FlowVersionView
      • PermissionSetSchema.PermissionSet
      • PermissionSetAssignmentSchema.PermissionSetAssignment
      • SoapTypeSchema.SoapType
      • UserRecordAccessSchema.UserRecordAccess
      • UserRoleSchema.UserRole
    • System namespace standard classes
      • BatchableContextSystem.BatchableContext
      • ComparableSystem.Comparable
      • DatabaseSystem.Database
      • EventBusSystem.EventBus
      • FinalizerContextSystem.FinalizerContext
      • InstallHandlerSystem.InstallHandler
      • JSONSystem.JSON
      • MatcherSystem.Matcher
      • PatternSystem.Pattern
      • PicklistEntrySystem.PicklistEntry
      • QueueableSystem.Queueable
      • QueueableContextSystem.QueueableContext
      • QuidditySystem.Quiddity
      • RequestSystem.Request
      • RestContextSystem.RestContext
      • RestRequestSystem.RestRequest
      • RestResponseSystem.RestResponse
      • SchedulableSystem.Schedulable
      • SchedulableContextSystem.SchedulableContext
      • SearchSystem.Search
      • TriggerOperationSystem.TriggerOperation
      • UUIDSystem.UUID
  • Scope creep: fixed some flaky tests in LogBatchPurgeController_Tests

extra-tests Metadata Changes

  • Moved the existing name-shadowing classes in the extra-tests directory to be in separate subdirectories (one for each namespace, Schema and System)
  • Added several new name-shadowing classes for all of the Schema & System references (mentioned above) that are now using fully-qualified references
    • These classes are deployed in Nebula Logger's pipeline to enforce that the codebase uses fully-qualified references

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.13.12...v4.13.13