Skip to content

Instantly share code, notes, and snippets.

View tugce's full-sized avatar
💭
DON'T PANIC!

Tugce Sirin tugce

💭
DON'T PANIC!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ztugcesirin on github.
  • I am tugce (https://keybase.io/tugce) on keybase.
  • I have a public key whose fingerprint is BA7C 6CD9 6B44 3C28 32F2 B7E7 B0E9 B7FF D9B8 7E93

To claim this, I am signing this object:

public class CopadoADDDataLoader {
public static List<List<SObject>> allNewRecords;
public static void loadData(){
//prepare data for github call
String githubToken = '6121aa9eb9deb0c20a920d8fee7f238e6a5e7894';
String githubEndpoint = 'https://api.github.com/repos/CopadoSolutions/PartnerTraining';
String sha = '';
Http http = new Http();
@tugce
tugce / CreateAllMetadataScript.cls
Created May 26, 2020 15:32
Apex script to create one metadata group called All Metadata with all metadata types
copado__Metadata_Group__c allMetadata = new copado__Metadata_Group__c ();
allMetadata.Name = 'All Metadata Types';
insert allMetadata;
List<copado__Metadata_Group_Item__c> items = new List<copado__Metadata_Group_Item__c>();
Schema.DescribeFieldResult typeResult = copado__Metadata_Group_Item__c.copado__Type__c.getDescribe();
List<Schema.PicklistEntry> ple = typeResult.getPicklistValues();
for( Schema.PicklistEntry f : ple) {
@tugce
tugce / ClearCopadoData.cls
Last active September 30, 2020 09:44
For cleaning up the Copado records
public static void deleteCopadoRelatedData(){
delete [SELECT Id From copado__Copado_Notification__c];
delete [SELECT Id From copado__User_Story__c];
delete [SELECT Id From copado__Project__c];
delete [SELECT Id From copado__Sprint__c];
delete [SELECT Id From copado__Release__c];
delete [SELECT Id From copado__Theme__c];
delete [SELECT Id From copado__Test_Run__c];
delete [SELECT Id From copado__Test_Script__c];
delete [SELECT Id From copado__Deployment_Flow__c];
@tugce
tugce / UnbundleStories.cls
Last active September 30, 2020 09:43
Unbundle stories for Copado USB. This code script can be run in the developer console to easily cancel the bundle for a specific bundle
Id bundleStoryId = 'BUNDLE_STORY_ID';
//Get all the stories that are part of the bundle.
List<copado__User_Story__c> bundledStories = [SELECT Id, copado__Stop_Indexing_Metadata__c, copado__Exclude_From_CBM__c, Bundle_User_Story__c
FROM copado__User_Story__c
WHERE Is_Bundle__c = FALSE
AND Bundle_User_Story__c = :bundleStoryId];
if(bundledStories.isEmpty()){
//Nothing to do, let's return
return;
@tugce
tugce / CopadoLicenseAssigner.cls
Last active September 30, 2020 09:42
Code snippet for Copado license assignment
copado.GlobalAPI copadoGlobalAPI = new copado.GlobalAPI();
copado.GlobalAPI.UserLicense UL = new copado.GlobalAPI.UserLicense();
UL.isCADEnabled = false; //Agile delivery license
UL.isCCHEnabled = false; //Compliance hub license
UL.isCCMEnabled = true; //Change management (developer) license
UL.isCopadoEnabled = true; //Enterprise (admin / release manager) license
UL.isCSTEnabled = true; //Copado Selenium testing license
UL.userId = UserInfo.getUserId();
@tugce
tugce / Calisthenics.md
Created November 24, 2020 08:33 — forked from bobuss/Calisthenics.md
The 9 Rules of Object Calisthenics

Object Calisthenics outlines 9 basic rules to apply when performing the exercise:

  • One level of indentation per method.
  • Don't use the ELSE keyword.
  • Wrap all primitives and Strings in classes.
  • First class collections.
  • One dot per line.
  • Don't abbreviate.
  • Keep all classes less than 50 lines.
  • No classes with more than two instance variables.