Salesforce integration
Learn how to set up SRE.ai in your Salesforce Workspace.
Install SRE managed package in Salesforce Workspace
The Salesforce environment connected to the workspace acts as a remote connection for storing and synchronizing metadata from the SRE.ai Application with other team members and application nodes.
Installing the managed package
Log in to your Salesforce environment
Use the following link to install the managed package
/packagingSetupUI/ipLanding.app?apvId=04taj0000006Gi1AAE
Click Install for Admins Only
Click Install
Ensure functionality
New users must verify their email address in the Salesforce user record before being granted access.
After installation, grant SRE users permission to access objects, classes, and other components. This step is required for functionality to work as expected.
Please ignore the warning. We are working through the Security Review for the AppExchange Partner Program.
Create a connected app in your org for GitHub actions
Salesforce CLI requires a connected app in the org that you're authorizing. A connected app will enable you to integrate Salesforce CLI with Salesforce using APIs and standard protocols, such as OAuth.
Download JWT certificate
Go to the SRE App
Select Settings from the User menu option on the top-right
Select the Certificate tab under Settings
Click Generate New to download a certificate necessary for creating a connected app.
Create a Connected App
Go to Salesforce Setup
Search for App Manager in the quick-find
Click New Connected App
Select Create a Connected App in the dialog
Click Continue
Adjust the following settings (modify as needed):
Connected App Name: GitHub Action JWT
API Name: GitHub_Action_JWT
Contact Email: <Administrator Email>
Enable OAuth Settings: Checked (Checkbox)
Callback URL: http://localhost:1717/OauthRedirect
Use digital signatures: Checked (Checkbox)
Upload the Certificate from the previous step
Select the following OAuth Scopes:
Access the identity URL service (id, profile, email, address, phone)
Full access (full)
Manage user data via APIs (API)
Manage user data via Web browsers (web)
Perform requests at any time (refresh_token, offline_access)
Adjust the following settings:
Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows: Un-checked (Checkbox)
Require Secret for Web Server Flow: Checked (Checkbox)
Require Secret for Refresh Token Flow: Checked (Checkbox)
Click Save
Update Permitted Users
Click Manage
Click Edit Policies and update Permitted Users to Admin approved users are pre-authorized
Click Save
Click Manage Profiles
Include the System Administrator Profile in the Profiles section
Click Manage Consumer Details
Take note of the Client ID and Client Secret
Install GitHub app to Acme GitHub workspace
Add our AlphaSRE app to your GitHub Repository using the following link: https://github.com/apps/alphasre
Share the Installation ID with the SRE.ai team:
Select the GitHub Repository Settings
Click GitHub Apps
Click AlphaSre Configure
Copy the Installation ID in the URL
https://github.com/ACME/CRM/settings/installations/<installation id>
Setting up GitHub Action Secrets and Variables
Select the GitHub Repository Settings
Click Actions under Secrets and Variables on the left menu
Add the following Secrets and Variables:
Secret 1:
Name: SRE_KEY
BASE64 Encoded Key for Certificate generated in Previous Step- Create a Connected App in Your Org for GitHub Actions > Step 3
Secret 2:
Name: SRE_WORKSPACE_CLIENT_ID
Client Id for GitHub Action JWT
Secret 3:
Name: SRE_WORKSPACE_USERNAME
Value: User’s Username
Variable 1:
Name: SRE_TEAM
Value: ACME
Variable 2:
Name: SRE_USERNAME
Value: <User’s Email ID>
GitHub Action YAML
Include the following YAML file in your repository to bind the Pull Request Approval and the Label to perform Continuous Deployment for file location .github/workflows/AlphaSRE CI Agent.yml
name: AlphaSRE CI Agent
on:
pull_request_review:
types: [ submitted ]
pull_request:
types: [ labeled ]
jobs:
promote_to_stage:
name: Promote to Stage
if: github.event.pull_request.base.ref == 'stage' && ( github.event.review.state == 'approved' || contains(github.event.pull_request.labels.*.name, 'Skip-Reviews') )
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: AlphaSRE Agent GitHub Action
uses: SRE-ai/[email protected]
with:
image: sreai/platform:latest
options: -v ${{github.workspace}}:/usr/src/app/docs/sre/data/acme/git/acme-tryout -e SRE_TEAM=${{vars.SRE_TEAM}} -e SRE_USERNAME=${{vars.SRE_USERNAME}}
run: |
git config --global --add safe.directory /usr/src/app/docs/sre/data/acme/git/acme-tryout
git config --global user.email "${{vars.SRE_USERNAME}}"
git config --global user.name "${{vars.SRE_USERNAME}}"
sh sre.sh configure -k "${{secrets.SRE_KEY}}"
sh sre.sh authorize -u "${{secrets.SRE_WORKSPACE_USERNAME}}" -k "${{secrets.SRE_WORKSPACE_CLIENT_ID}}"
sh sre.sh promote -b "${{github.event.pull_request.head.ref}}" -i "stage" -r "acme-tryout"
promote_to_prod:
needs: promote_to_stage
name: Promote to Prod
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: AlphaSRE Agent GitHub Action
uses: SRE-ai/[email protected]
with:
image: sreai/platform:latest
options: -v ${{github.workspace}}:/usr/src/app/docs/sre/data/acme/git/acme-tryout -e SRE_TEAM=${{vars.SRE_TEAM}} -e SRE_USERNAME=${{vars.SRE_USERNAME}}
run: |
git config --global --add safe.directory /usr/src/app/docs/sre/data/acme/git/acme-tryout
git config --global user.email "${{vars.SRE_USERNAME}}"
git config --global user.name "${{vars.SRE_USERNAME}}"
sh sre.sh configure -k "${{secrets.SRE_KEY}}"
sh sre.sh authorize -u "${{secrets.SRE_WORKSPACE_USERNAME}}" -k "${{secrets.SRE_WORKSPACE_CLIENT_ID}}"
sh sre.sh promote -b "${{github.event.pull_request.head.ref}}" -i "prod" -r "acme-tryout"
Create a Connected App in Your Org for SSO
The SRE Application can now use your Salesforce Org as an Identity Provider and, by default, inherits its SSO capabilities.
Go to Salesforce Setup
Search for App Manager in the quick-find
Click New Connected App
Select Create a Connected App in the dialog
Click Continue
Adjust the following settings (modify as needed):
Connected App Name: GitHub Action JWT
API Name: GitHub_Action_JWT
Contact Email: <Administrator Email>
Enable OAuth Settings: Checked (Checkbox)
Callback URL: http://localhost:1717/OauthRedirect
Use digital signatures: Checked (Checkbox)
Upload the Certificate from the previous step
Select the following OAuth Scopes:
Access the identity URL service (id, profile, email, address, phone)
Full access (full)
Manage user data via APIs (API)
Manage user data via Web browsers (web)
Perform requests at any time (refresh_token, offline_access)
Adjust the following settings:
Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows: Un-checked (Checkbox)
Require Secret for Web Server Flow: Checked (Checkbox)
Require Secret for Refresh Token Flow: Checked (Checkbox)
Click Save
Last updated