Skip to content

Conversation

@jongpie
Copy link
Owner

@jongpie jongpie commented Feb 3, 2022

This initial release is focused on extracting data from non-reportable objects MetadataPackage, MetadataPackageVersion, and PackageSubscriber, and storing the data in 3 custom objects: Package__c, PackageVersion__c, and PackageSubscriberOrg__c. This unlocked package release includes:

  • 3 custom objects (mentioned above), along with custom tabs
  • A console app, 'Package Analytics'
  • A batch/schedulable class, PackageDataExtractJob. This job has been designed so it can be deployed to sandboxes/scratch orgs, although it will only function properly in a dev hub/packaging org
  • 2 permission sets:
    1. PackageAnalyticsAdmin - provides full read/write/edit/delete access for the included custom objects
    2. PackageAnalyticsViewer - provides read-only access for the included custom objects

Screenshots:

Packages tab, displayed inside of the include console app Package Analytics

image

Package details page (Package__c), displaying a related list of Package Versions (PackageVersion__c)

image

Package Version details page (PackageVersion__c), displaying a related list of Package Subscriber Orgs (PackageSubscriberOrg__c)

image

…version's PackageVersionNumber__c field value
…the SObjects MetataPackage, MetadataPackageVersion, and PackageSubscriber. Also switched to using Database.DmlOptions instead of the truncateFieldValue() method

Thanks to @jamessimone for the fantastic suggestion on handling the SObjects - this is much cleaner than all of the stupid strings I was using previously
Really beauty is on the inside - and before this change, the PackageExtractJob was very ugly
Could it still be better? Probably. Is everything working? Hopefully - well enough to create a package version with code coverage.
…lame usage of Schema.getGlobalDescribe() (thanks again to @jamessimone!)
…KAGING_ORG, added project header in Apex classes
- Added overload for scheduleHourly() to control if the job also executes immediately
- Added private method executeBatch() to eliminate some code duplication
- Moved DMLOptions to a constant. Previously, it was being recreated for every SObject record
Copy link
Collaborator

@jamessimone jamessimone left a comment

Choose a reason for hiding this comment

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

Some minor comments but otherwise LGTM!

@jongpie jongpie merged commit 755d4cd into main Feb 7, 2022
@jongpie jongpie deleted the init branch February 7, 2022 15:31
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