Skip to content

Commit 2fa4da3

Browse files
committed
Merge branch 'master' into devops/removal-of-fflib-sobjectmocks-again
2 parents 24b46dc + 4613569 commit 2fa4da3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+697
-183
lines changed

.github/workflows/deploy.and.test.yml

+21-10
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,28 @@ jobs:
1515
with:
1616
ref: ${{github.event.pull_request.head.ref}}
1717
repository: ${{github.event.pull_request.head.repo.full_name}}
18-
- name: Install SFDX CLI and authorize DevHub
19-
uses: apex-enterprise-patterns/setup-sfdx@v1 #We're using a fork of https://github.com/sfdx-actions/setup-sfdx for safety
18+
- name: Install SF CLI and authorize DevHub
19+
uses: apex-enterprise-patterns/setup-sfdx@v2 #We're using a fork of https://github.com/sfdx-actions/setup-sfdx for safety
2020
with:
2121
sfdx-auth-url: ${{ secrets.DEVHUB_SFDXURL }}
22-
- run: sfdx force:config:set defaultdevhubusername=SFDX-ENV -g #Even though the setup-sfdx action uses --setdefaultdevhubusername, it doesn't seem to stick since it uses --setdefaultusername so we brute force it here
23-
- run: echo y | sfdx plugins:install shane-sfdx-plugins
24-
- run: sfdx force:org:create -f config/project-scratch-def.json --setdefaultusername -d 1
25-
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-mocks -p sfdx-source/apex-mocks
26-
- run: sfdx force:source:push
27-
- run: sfdx force:apex:test:run -w 5
22+
- name: Install the required plugins
23+
run: echo y | sf plugins install shane-sfdx-plugins
24+
- name: Setup the config parameters needed
25+
run: sf config set target-dev-hub SFDX-ENV --global #Even though the setup-sfdx action uses --setdefaultdevhubusername, it doesn't seem to stick since it uses --setdefaultusername so we brute force it here
26+
- name: Create the scratch org
27+
run: sf org create scratch --definition-file config/project-scratch-def.json --set-default --duration-days 1 --no-track-source
28+
- name: Install required dependency frameworks
29+
run: sf shane github src install --convert --githubuser apex-enterprise-patterns --repo fflib-apex-mocks --path sfdx-source/apex-mocks
30+
- name: Deploy and compile the codebase
31+
run: sf project deploy start
32+
- name: Run the core framework tests
33+
run: sf apex run test --wait 5
34+
# Intentionally install the Sample Code after the core AEP Commons test pass succeeds so that we don't deploy anything in Sample Code
35+
# that could mask a test failure. A much more involved solution would've been to do a workflow_dispatch to the samplecode project.
36+
- name: Install sample code project to verify with
37+
run: sf shane github src install --convert --githubuser apex-enterprise-patterns --repo fflib-apex-common-samplecode --path sfdx-source/apex-common-samplecode
38+
- name: Run the core framework tests and the sample code project tests
39+
run: sf apex run test --wait 5
2840
- name: Destroy scratch org
29-
run: sfdx force:org:delete -p
41+
run: sf org delete scratch --no-prompt
3042
if: always()
31-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Manage SF API Versions
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
api-version:
6+
description: 'api version in the format XX e.g 58'
7+
required: true
8+
type: string
9+
jobs:
10+
update:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: apex-enterprise-patterns/[email protected]
15+
with:
16+
api-version: ${{inputs.api-version}}
17+
- uses: peter-evans/create-pull-request@v5
18+
with:
19+
title: 'Bump API Versions to ${{inputs.api-version}}.0'
20+
body: 'Automatically bumped by GitHub Actions '
21+
branch: 'devops/bump-api-versions-v${{inputs.api-version}}.0'
22+
commit-message: 'chore: bump api to v${{inputs.api-version}}.0'

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ IlluminatedCloud/
3737

3838
# SFDX Related
3939
.sfdx/
40+
.sf/
4041
sfdx-source/common-base/main/default/
4142
sfdx-source/untracked/
4243
.execanon
@@ -48,4 +49,4 @@ package-lock.json
4849

4950

5051
sfdx-source/group*
51-
research/
52+
research/

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ FFLib Apex Common
66

77
**Dependencies:** Must deploy [ApexMocks](https://github.com/apex-enterprise-patterns/fflib-apex-mocks) before deploying this library
88

9-
<a href="https://githubsfdeploy.herokuapp.com">
9+
<a href="https://githubsfdeploy.herokuapp.com?owner=apex-enterprise-patterns&repo=fflib-apex-common">
1010
<img alt="Deploy to Salesforce"
1111
src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/src/main/webapp/resources/img/deploy.png">
1212
</a>
1313

1414
Updates
1515
=======
1616

17+
- **December 2022**, **IMPORTANT CHANGE** - Support for native Apex User Mode was added to the library (see [discussion](https://github.com/apex-enterprise-patterns/fflib-apex-common/discussions/419)). For new projects, the old `enforceCRUD` and `enforceFLS` flags on `fflib_SObjectSelector` should be considered deprecated and the constructors that take `dataAccess` arguments should be used instead. Additionally, the introduction of `fflib_SObjectUnitOfWork.UserModeDML` provides an `IDML` implementation that supports `USER_MODE` or `SYSTEM_MODE`. `fflib_SObjectUnitOfWork.SimpleDML` (the default `IDML` implementation) should be considered deprecated. There are measurable performance benefits to using `SYSTEM_MODE` and `USER_MODE` (Apex CPU usage reduction). Additionally, the use of explicit `USER_MODE` and `SYSTEM_MODE` overrides the `with sharing` and `without sharing` class declaration and makes the expected behavior of DML and SOQL easier to understand.
1718
- **April 2020**, **IMPORTANT CHANGE**, the directory format of this project repo was converted to [Salesforce DX Source Format](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_source_file_format.htm). While the GIT commit history was maintained, it is not visible on GitHub. If you need to see the history, either clone the repo and execute `git log --follow` from the command line or refer to this [tag](https://github.com/apex-enterprise-patterns/fflib-apex-common/tree/metadata-format-prior-to-dx-source-format-conversion) of the codebase prior to conversion.
1819
- **September 2014**, **IMPORTANT CHANGE**, changes applied to support Dreamforce 2014 advanced presentation, library now provides Application factories for major layers and support for ApexMocks. More details to follow! As a result [ApexMocks](https://github.com/apex-enterprise-patterns/fflib-apex-mocks) must be deployed to the org before deploying this library. The sample application [here](https://github.com/apex-enterprise-patterns/fflib-apex-common-samplecode) has also been updated to demonstrate the new features!
1920
- **July 2014**, **IMPORTANT CHANGE**, prior **23rd July 2014**, both the ``fflib_SObjectDomain.onValidate()`` and ``fflib_SObjectDomain.onValidate(Map<Id, SObject> existingRecords)`` methods where called during an on **after update** trigger event. From this point on the ``onValidate()`` method will only be called during on **after insert**. If you still require the orignal behaviour add the line ``Configuration.enableOldOnUpdateValidateBehaviour();`` into your constructor.
2021
- **June 2014**, New classes providing utilities to support security and dynamic queries, in addition to improvements to existing Apex Enterprise Pattern base classes. Read more [here](http://andyinthecloud.com/2014/06/28/financialforce-apex-common-updates/).
21-
- **June 2014**, Experimental [branch](https://github.com/apex-enterprise-patterns/fflib-apex-common/tree/fls-support-experiment) supporting automated FLS checking, see [README](https://github.com/apex-enterprise-patterns/fflib-apex-common/tree/fls-support-experiment#expirimental-crud-and-fls-support) for more details.
2222

2323
This Library
2424
============
@@ -32,14 +32,6 @@ Application Enterprise Patterns on Force.com
3232

3333
Design patterns are an invaluable tool for developers and architects looking to build enterprise solutions. Here are presented some tried and tested enterprise application engineering patterns that have been used in other platforms and languages. We will discuss and illustrate how patterns such as Data Mapper, Service Layer, Unit of Work and of course Model View Controller can be applied to Force.com. Applying these patterns can help manage governed resources (such as DML) better, encourage better separation-of-concerns in your logic and enforce Force.com coding best practices.
3434

35-
Dreamforce Session and Slides
36-
-----------------------------
37-
38-
- View slides for the **Dreamforce 2013** session [here](https://docs.google.com/file/d/0B6brfGow3cD8RVVYc1dCX2s0S1E/edit)
39-
- Video recording of the **Dreamforce 2013** session [here](http://www.youtube.com/watch?v=qlq46AEAlLI).
40-
- Video recording of the **Advanced Apex Enterprise Dreamforce 2014** session [here](http://dreamforce.vidyard.com/watch/7QtP2628KmtXfmiwI-7B1w%20).
41-
- View slides for the **Dreamforce 2015** session [here](http://www.slideshare.net/andyinthecloud/building-strong-foundations-apex-enterprise-patterns)
42-
4335
Documentation
4436
-------------
4537

@@ -52,11 +44,19 @@ Documentation
5244
- [Apex Enterprise Patterns - Service Layer](http://wiki.developerforce.com/page/Apex_Enterprise_Patterns_-_Service_Layer)
5345
- [Apex Enterprise Patterns - Domain Layer](http://wiki.developerforce.com/page/Apex_Enterprise_Patterns_-_Domain_Layer)
5446
- [Apex Enterprise Patterns - Selector Layer](https://github.com/financialforcedev/df12-apex-enterprise-patterns#data-mapper-selector)
47+
- View slides for the **Dreamforce 2013** session [here](https://docs.google.com/file/d/0B6brfGow3cD8RVVYc1dCX2s0S1E/edit)
48+
- View slides for the **Dreamforce 2015** session [here](http://www.slideshare.net/andyinthecloud/building-strong-foundations-apex-enterprise-patterns)
49+
50+
**Related Webinars**
51+
- [Advanced Apex Enterprise Patterns](https://www.youtube.com/watch?v=BLXp0ZP0cF0)
52+
- [Apex Hours (August 2020): Apex Enterprise Patterns](https://www.apexhours.com/apex-enterprise-patterns/)
53+
54+
**Related Book**
55+
- [Salesforce Platform Enterprise Architecture, 4th Edition, by Andrew Fawcett](https://www.amazon.com/Salesforce-Platform-Enterprise-Architecture-applications-ebook/dp/B0BD8TBT75/)
5556

5657
**Other Related Blogs**
5758

5859
- [Preview of Advanced Apex Patterns Session (Application Factory and ApexMocks Features)](http://andyinthecloud.com/2014/08/26/preview-of-advanced-apex-enterprise-patterns-session/)
5960
- [Unit Testing with the Domain Layer](http://andyinthecloud.com/2014/03/23/unit-testing-with-the-domain-layer/)
60-
- [MavensMate Templates](http://andyinthecloud.com/2014/05/23/mavensmate-templates-and-apex-enterprise-patterns/)
6161
- [FinancialForce Apex Common Updates](http://andyinthecloud.com/2014/06/28/financialforce-apex-common-updates/)
6262

config/multicurrency-scratch-def.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"orgName": "apex-common",
3+
"edition": "Developer",
4+
"features": [
5+
"MultiCurrency"
6+
],
7+
"settings": {
8+
"currencySettings":{
9+
"enableMultiCurrency": true
10+
},
11+
"lightningExperienceSettings": {
12+
"enableS1DesktopEnabled": true
13+
}
14+
}
15+
}

sfdx-project.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"packageDirectories": [
3-
{
4-
"path": "sfdx-source/apex-common",
5-
"default": true
6-
}
7-
],
8-
"namespace": "",
9-
"sfdcLoginUrl": "https://login.salesforce.com",
10-
"sourceApiVersion": "53.0"
2+
"packageDirectories": [
3+
{
4+
"path": "sfdx-source/apex-common",
5+
"default": true
6+
}
7+
],
8+
"namespace": "",
9+
"sfdcLoginUrl": "https://login.salesforce.com",
10+
"sourceApiVersion": "61.0"
1111
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>54.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>54.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>54.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>51.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>54.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>54.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>54.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>54.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>54.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>51.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>51.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>51.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>54.0</apiVersion>
3+
<apiVersion>61.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>

0 commit comments

Comments
 (0)