Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/initial schema #2

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7e09d88
Initial project setup with dependencies, a custom field, post-install…
jlantz Oct 9, 2024
2397723
Update feature.yml
jlantz Oct 10, 2024
d7b34b4
Add workflow to create pr snapshots and one to use them
jlantz Oct 11, 2024
c7a0706
Update README to trigger build
jlantz Oct 11, 2024
0b94f84
Add flow to update dependencies snapshot
jlantz Oct 11, 2024
7e11e66
Update README to trigger builds
jlantz Oct 11, 2024
34e6a0e
Set create_pr_snapshot to true
jlantz Oct 13, 2024
6f3f009
Fix unmanaged builds
jlantz Oct 14, 2024
8954d81
Set flags to create snapshots
jlantz Oct 14, 2024
d2be49e
Fix job names
jlantz Oct 14, 2024
df0a89c
Fix task options for github_pull_request_snapshot
jlantz Oct 14, 2024
3930153
Disable GitHub environment creation for now
jlantz Oct 16, 2024
f1dab0d
Add 2gp feature test workflow with predictive snapshots
jlantz Oct 17, 2024
0f94a22
Add github app id/key
jlantz Oct 17, 2024
3c0a85d
Trigger builds
jlantz Oct 17, 2024
a4c5de9
Rework flows:
jlantz Oct 18, 2024
775697c
Add push triggers back to unmanaged jobs
jlantz Oct 18, 2024
231885a
Attempt to fix workflow_run triggering
jlantz Oct 18, 2024
edbb4a5
Update workflow name for trigger
jlantz Oct 18, 2024
cdc99be
Attempt to fix triggering
jlantz Oct 18, 2024
13d0add
Add support for environment creation in workflow_dispatch
jlantz Oct 19, 2024
445d4de
Fix env
jlantz Oct 19, 2024
7d7bb7f
Skip debug support for now
jlantz Oct 19, 2024
37618c3
Add snpashot prerelease dependencies flow
jlantz Oct 20, 2024
b42d99d
Add workflow
jlantz Oct 20, 2024
93ed8a5
Add workflow for testing env saving with the devhub
jlantz Oct 20, 2024
3570540
Use default github token
jlantz Oct 20, 2024
1b1e93c
Add update_environment
jlantz Oct 20, 2024
64a4f8c
Add org-from-snapshot workflow
jlantz Oct 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .forceignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/jsconfig.json

**/tsconfig.json

**/.eslintrc.json

**/*.ts
16 changes: 16 additions & 0 deletions .github/workflows/build-feature-test-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: >
Build 2GP Feature Test Package
on:
workflow_dispatch:
push:
branches:
- feature/**
- main
jobs:
feature-test:
name: "Create 2GP Package Version"
uses: muselab-d2x/d2x/.github/workflows/build-feature-test-package.yml@cumulusci-next-snapshots
secrets:
dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
gh-email: "${{ secrets.GH_EMAIL }}"
github-token: "${{ secrets.CCI_GITHUB_TOKEN }}"
29 changes: 29 additions & 0 deletions .github/workflows/feature-2gp-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: >
2GP Feature Test an PR Snapshots
on:
workflow_dispatch:
inputs:
debug:
description: "Enable cci's debug mode for more verbose output"
required: false
default: "false"

workflow_run:
workflows:
- Build 2GP Feature Test Package
types:
- completed
jobs:
feature-test:
name: "Feature Test and Snapshot"
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
uses: muselab-d2x/d2x/.github/workflows/feature-test-2gp-snapshot.yml@cumulusci-next-snapshots
secrets:
dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
gh-email: "${{ secrets.GH_EMAIL }}"
github-token: "${{ secrets.CCI_GITHUB_TOKEN }}"
with:
debug: ${{ github.event.inputs.debug }}
create_pr_snapshot: true
create_failure_snapshot: true
create_snapshot_commit_status: true
24 changes: 24 additions & 0 deletions .github/workflows/feature-2gp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: >
2GP Feature Test with Predicted Snapshots
on:
workflow_dispatch:
inputs:
environment_name:
description: "If set, the scratch org will be kept and stored as a GitHub Environment with this name. Must be a unique environment name."
required: false
workflow_run:
workflows:
- Build 2GP Feature Test Package
types:
- completed
jobs:
feature-test:
name: "Feature Test"
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
uses: muselab-d2x/d2x/.github/workflows/feature-test-2gp.yml@cumulusci-next-snapshots
with:
environment_name: ${{ github.event.inputs.environment_name || '' }}
secrets:
dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
gh-email: "${{ secrets.GH_EMAIL }}"
github-token: "${{ secrets.CCI_GITHUB_TOKEN }}"
23 changes: 23 additions & 0 deletions .github/workflows/feature-pr-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: >
Unmanaged Feature Test With PR Snapshot Creation
on:
workflow_dispatch:
push:
branches:
- feature/**
- main

jobs:
feature-test:
name: "Feature Test"
uses: muselab-d2x/d2x/.github/workflows/feature-test-snapshot.yml@cumulusci-next-snapshots
secrets:
dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
gh-email: "${{ secrets.GH_EMAIL }}"
github-token: "${{ secrets.CCI_GITHUB_TOKEN }}"
github-app-id: "${{ secrets.CCI_GITHUB_APP_ID }}"
github-app-key: "${{ secrets.CCI_GITHUB_APP_KEY }}"
with:
create_pr_snapshot: true
create_failure_snapshot: true
create_snapshot_commit_status: true
14 changes: 4 additions & 10 deletions .github/workflows/feature.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
name: >
2GP Feature Test and Snapshot
Unmanaged Feature Test Using Predicted Snapshots
on:
workflow_dispatch:
push:
branches:
- feature/**
# - feature/**
- main
jobs:
feature-test:
name: "Feature Test"
uses: muselab-d2x/d2x/.github/workflows/feature-test-2gp-snapshot.yml@cumulusci-next
with:
create_pr_snapshot: true
create_failure_snapshot: true
environment_prefix: "Snapshot: "
commit_status_context: Snapshot

uses: muselab-d2x/d2x/.github/workflows/feature-test.yml@cumulusci-next-snapshots
secrets:
dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
gh-email: "${{ secrets.GH_EMAIL }}"
github-token: "${{ secrets.CCI_GITHUB_TOKEN }}"
github-token: "${{ secrets.CCI_GITHUB_TOKEN }}"
29 changes: 29 additions & 0 deletions .github/workflows/org-from-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create Org from Snapshot
on:
workflow_dispatch:
inputs:
environment_name:
description: "The name of the org to create. Must be a valid GitHub Environment name."
required: true
type: string
org_config:
description: "The CumulusCI org name to use as the base configuration"
required: true
default: "feature"
type: string
snapshot_name:
description: "The name of the snapshot to use to create the org"
required: true
jobs:
create-org:
uses: muselab-d2x/d2x/.github/workflows/org-from-snapshot.yml@cumulusci-next-snapshots
secrets:
dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
gh-email: "${{ secrets.GH_EMAIL }}"
github-app-id: "${{ secrets.CCI_GITHUB_APP_ID }}"
github-app-key: "${{ secrets.CCI_GITHUB_APP_KEY }}"
github-token: "${{ secrets.GITHUB_TOKEN}}"
with:
org_name: ${{ github.event.inputs.org_config }}
snapshot_name: ${{ github.event.inputs.snapshot_name }}
environment_name: ${{ github.event.inputs.environment_name }}
24 changes: 24 additions & 0 deletions .github/workflows/snapshot-dependencies-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: >
Snapshot the 2gp dependnencies flow results
on:
workflow_dispatch:
push:
branches:
- feature/initial-schema
- main
jobs:
snapshot-dependencies:
name: "Snapshot dependencies"
uses: muselab-d2x/d2x/.github/workflows/snapshot-flow.yml@cumulusci-next-snapshots
secrets:
dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
gh-email: "${{ secrets.GH_EMAIL }}"
github-token: "${{ secrets.CCI_GITHUB_TOKEN }}"
github-app-id: "${{ secrets.CCI_GITHUB_APP_ID }}"
github-app-key: "${{ secrets.CCI_GITHUB_APP_KEY }}"
with:
org_name: feature
flow_name: install_2gp_commit
flow_run_options: --skip-from install_managed
create_snapshot_commit_status: true
create_snapshot_environment: true
19 changes: 19 additions & 0 deletions .github/workflows/snapshot-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: >
Snapshot the dependencies flow results
on:
workflow_dispatch:
jobs:
snapshot-dependencies:
name: "Snapshot dependencies"
uses: muselab-d2x/d2x/.github/workflows/snapshot-flow.yml@cumulusci-next-snapshots
secrets:
dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
gh-email: "${{ secrets.GH_EMAIL }}"
github-token: "${{ secrets.CCI_GITHUB_TOKEN }}"
github-app-id: "${{ secrets.CCI_GITHUB_APP_ID }}"
github-app-key: "${{ secrets.CCI_GITHUB_APP_KEY }}"
with:
org_name: feature
flow_name: dependencies
create_snapshot_commit_status: true
create_snapshot_environment: true
19 changes: 19 additions & 0 deletions .github/workflows/test-org-to-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
push:
branches:
- feature/**
- main
jobs:
save-org-to-env:
name: "Save Org to Environment"
uses: muselab-d2x/d2x/.github/workflows/org-to-env.yml@cumulusci-next-snapshots
secrets:
dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
target-org-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
github-app-id: "${{ secrets.CCI_GITHUB_APP_ID }}"
github-app-key: "${{ secrets.CCI_GITHUB_APP_KEY }}"
with:
org_alias: target
environment_name: MuselabPBO
update_environment: true
91 changes: 81 additions & 10 deletions cumulusci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,109 @@
minimum_cumulusci_version: '3.76.0'
minimum_cumulusci_version: "3.76.0"
project:
name: Oh-Snap
package:
name: Oh Snap
namespace: d2x
api_version: '58.0'
api_version: "58.0"
git:
default_branch: 'main'
default_branch: "main"
source_format: sfdx
dependencies:

- github: "https://github.com/SalesforceFoundation/NPSP"


tasks:
run_tests:
add_page_layout_fields:
options:
required_org_code_coverage_percent: 75
api_names:
- Account-Account Layout
- Account-Account (Marketing) Layout
- Account-Account (Sales) Layout
- Account-Account (Support) Layout
fields:
- api_name: "%%%NAMESPACE%%%Oh_Snap__c"
position:
- relative: after
field: Name
- relative: bottom
section: 0

create_dependencies_snapshot:
options:
create_commit_status: True
create_environment: True

github_pull_request_snapshot:
options:
project_code: OH
snapshot_pr: True
snapshot_failure: True

snapshot_fail_pr: True

run_tests:
options:
required_org_code_coverage_percent: 75

flows:
config_common_unmanaged:
group: Oh Snap! Setup
description: Common configuration steps for Oh Snap! in unmanaged dev environments
steps:
1:
task: add_page_layout_fields

config_common:
group: Oh Snap! Setup
description: Common configuration steps for Oh Snap! in managed environments
steps:
1:
flow: config_common_unmanaged
options:
add_page_layout_fields:
managed: True

# Add common flows to CumulusCI's universal Org Setup flows
config_apextest:
steps:
3:
# Feature testing in GitHub Actions is done on 2GP package versions
flow: config_common
config_dev:
steps:
3:
flow: config_common_unmanaged
config_managed:
steps:
3:
flow: config_common

config_qa:
steps:
3:
flow: config_common_unmanaged

config_regression:
steps:
3:
# Regression is done using the regression_org flow using releasable packaged versions
flow: config_common

ci_feature:
steps:
3:
flow: config_common_unmanaged

orgs:
scratch:
beta:
config_file: orgs/managed.json
namespaced: False
dev:
config_file: orgs/unmanaged.json
namespaced: False
feature:
config_file: orgs/managed.json
namespaced: False
qa:
config_file: orgs/managed.json
namespaced: False
release:
config_file: orgs/managed.json
namespaced: False
14 changes: 14 additions & 0 deletions force-app/main/default/lwc/.eslintrc 2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": ["@salesforce/eslint-config-lwc/recommended"],
"overrides": [
{
"files": ["*.test.js"],
"rules": {
"@lwc/lwc/no-unexpected-wire-adapter-usages": "off"
},
"env": {
"node": true
}
}
]
}
14 changes: 14 additions & 0 deletions force-app/main/default/lwc/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": ["@salesforce/eslint-config-lwc/recommended"],
"overrides": [
{
"files": ["*.test.js"],
"rules": {
"@lwc/lwc/no-unexpected-wire-adapter-usages": "off"
},
"env": {
"node": true
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Oh_Snap__c</fullName>
<defaultValue>false</defaultValue>
<description>For those really important Accounts you need a special checkbox to flag!</description>
<externalId>false</externalId>
<inlineHelpText>Check for really, really special Accounts Only!</inlineHelpText>
<label>Oh Snap!</label>
<trackFeedHistory>false</trackFeedHistory>
<type>Checkbox</type>
</CustomField>
Loading
Loading