Monday, 20 June 2022

Second-generation managed packages

 SFDX :

Salesforce Developer Experience(DX) is command line interface which provides tools

to manage data and metadata on salesforce environments.


DH: Dev Hub :

Organization feature which provides access to create and manage scratch orgs and 

create and manage second generation package.


Package :

Bundled container of code and metadata which can be published on AppExchange or shared directly to subscribers.


2GMP :


Second-Generation managed package,created,developed and managed by SFDX CLI.


1GMP :


First-Generation managed package also known as classic package,created and managed from Packaging or Patch Orgs.


ISV :

Independent Software Vendor


The company, who releases the managed package.


NS :

Namespace is the prefix used by managed packages to isolate the metadata scope.


AppExchange :

Salesforce marketplace where packages can be found for installation or published by ISV.


Security Review :


Salesforce acknowledgement of managed package required for publishing on AppExchange.


NO :

Namespace Org, the org where namespace is registered.


PKO :


Packaging Org, the org where the package is created, built and registered.


PTO :

Patch org, the org where the patch version of package is developed and built.


Sbo :


Subscriber Org, the org where your subscriber clients install and use your package.


Sco :

Scratch Org i the source driven temporary disposable organization.


Push Upgrades :


Feature, which allows to push upgrades to the subscribers without their consent.


Package Version :


Package snapshot, which is defined by Major,Minor,Patch and Build Version.


How 2GMP are different from 1GMP ?


1. What is the source of truth ?


Source of truth : Packaging Org vs VCS


2.Who is the owner of package and metadata?


Owner of package and metadata : Pko vs DH+VCS.


3.How many packages may belong to an Org?


Number of Packages per org : 1 vs many


4.Where is the namespace registered?


namespace : PKO vs Namespace Org(NO) linked to DH.


5.How many packages may share namespace?


Number of package per NS : 1 vs many


6.Which are the options to share code?


Share code : global or @namespaceAccessible


ex :

@namespaceAccessible

public with sharing class JQ {


public class InvalidJSONQueryException extends Exception{}


@testVisible Map<String,Object> internalRepresentation;

@namespaceAccessible

public JQ(String data){

  internalRepresentation=(Map<String,Object>)JSON.deserializeUntyped(data);

}


}


7.Can package create or uninstall be automated?


SFDX commands can be used to create or uninstall.


8.Is branching supported in package versioning?


Package versioning : linear vs branching


9.How patch versions can be created?


Patch versions: Patch Org vs VCS



which functionality is supported in 1 GMP but not in 2 GMP?


1.Components can't be deleted from packages.

2.Package versions can't be deprecated.

3.Apex versionProvider isn't supported.

4.A default language for labels in packages can't be specified.


Q)SFDX CLI command to create a new package version fails to be create because of exceeding limit Package2VersionCreates,

but developer needs to create a new version urgently for a client.What developer can do?



sfdx force:package:version:create --skipvalidation


Include --skipvalidation switch in the SFDX CLI command

Skip validation during package version creation;

you can't promote unvalidated package versions


However,unvalidated package verions have a separate limit which has 

much higher value even for free developer orgs.The value of Package2VersionCreatesWithoutValidation is 500

While the value of Package2VersionCreates is 6.


No comments:

Post a Comment