From 7e09d88d3a0e31932ccda2abde33dadeb1e45cae Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Wed, 9 Oct 2024 14:00:21 -0500 Subject: [PATCH 01/29] Initial project setup with dependencies, a custom field, post-install Metadata ETL to add field to layouts, and snapshots! --- .forceignore | 7 ++ .github/workflows/feature.yml | 10 +-- cumulusci.yml | 78 +++++++++++++++++-- force-app/main/default/lwc/.eslintrc 2.json | 14 ++++ force-app/main/default/lwc/.eslintrc.json | 14 ++++ .../Account/fields/Oh_Snap__c.field-meta.xml | 11 +++ package.json | 41 ---------- 7 files changed, 121 insertions(+), 54 deletions(-) create mode 100644 .forceignore create mode 100644 force-app/main/default/lwc/.eslintrc 2.json create mode 100644 force-app/main/default/lwc/.eslintrc.json create mode 100644 force-app/main/default/objects/Account/fields/Oh_Snap__c.field-meta.xml delete mode 100644 package.json diff --git a/.forceignore b/.forceignore new file mode 100644 index 0000000..72e6dd9 --- /dev/null +++ b/.forceignore @@ -0,0 +1,7 @@ +**/jsconfig.json + +**/tsconfig.json + +**/.eslintrc.json + +**/*.ts diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index 19457ee..8d6b52c 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -1,5 +1,5 @@ name: > - 2GP Feature Test and Snapshot + 2GP Feature Test and Snapshot on: workflow_dispatch: push: @@ -9,13 +9,13 @@ on: jobs: feature-test: name: "Feature Test" - uses: muselab-d2x/d2x/.github/workflows/feature-test-2gp-snapshot.yml@cumulusci-next + uses: muselab-d2x/d2x/.github/workflows/feature-test.yml@cumulusci-next-snapshots with: create_pr_snapshot: true create_failure_snapshot: true - environment_prefix: "Snapshot: " - commit_status_context: Snapshot - + create_commit_status: true + create_envionment: true + secrets: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" gh-email: "${{ secrets.GH_EMAIL }}" diff --git a/cumulusci.yml b/cumulusci.yml index 70ca8af..25096ae 100644 --- a/cumulusci.yml +++ b/cumulusci.yml @@ -1,28 +1,89 @@ -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 - + + 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: + # QA is done using the qa_org_2gp flow using 2GP package versions + flow: config_common + config_regression: + steps: + 3: + # Regression is done using the regression_org flow using releasable packaged versions + flow: config_common orgs: scratch: @@ -30,6 +91,7 @@ orgs: config_file: orgs/managed.json dev: config_file: orgs/unmanaged.json + track_history: True feature: config_file: orgs/managed.json qa: diff --git a/force-app/main/default/lwc/.eslintrc 2.json b/force-app/main/default/lwc/.eslintrc 2.json new file mode 100644 index 0000000..a82e76d --- /dev/null +++ b/force-app/main/default/lwc/.eslintrc 2.json @@ -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 + } + } + ] +} diff --git a/force-app/main/default/lwc/.eslintrc.json b/force-app/main/default/lwc/.eslintrc.json new file mode 100644 index 0000000..a82e76d --- /dev/null +++ b/force-app/main/default/lwc/.eslintrc.json @@ -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 + } + } + ] +} diff --git a/force-app/main/default/objects/Account/fields/Oh_Snap__c.field-meta.xml b/force-app/main/default/objects/Account/fields/Oh_Snap__c.field-meta.xml new file mode 100644 index 0000000..2126108 --- /dev/null +++ b/force-app/main/default/objects/Account/fields/Oh_Snap__c.field-meta.xml @@ -0,0 +1,11 @@ + + + Oh_Snap__c + false + For those really important Accounts you need a special checkbox to flag! + false + Check for really, really special Accounts Only! + + false + Checkbox + diff --git a/package.json b/package.json deleted file mode 100644 index 0311907..0000000 --- a/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "oh-snap", - "private": true, - "version": "1.0.0", - "description": "Oh Snap", - "scripts": { - "lint": "eslint **/{aura,lwc}/**", - "test": "npm run test:unit", - "test:unit": "sfdx-lwc-jest", - "test:unit:watch": "sfdx-lwc-jest --watch", - "test:unit:debug": "sfdx-lwc-jest --debug", - "test:unit:coverage": "sfdx-lwc-jest --coverage", - "prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", - "prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", - "postinstall": "husky install", - "precommit": "lint-staged" - }, - "devDependencies": { - "@lwc/eslint-plugin-lwc": "^1.1.2", - "@prettier/plugin-xml": "^2.0.1", - "@salesforce/eslint-config-lwc": "^3.2.3", - "@salesforce/eslint-plugin-aura": "^2.0.0", - "@salesforce/eslint-plugin-lightning": "^1.0.0", - "@salesforce/sfdx-lwc-jest": "^1.1.0", - "eslint": "^8.11.0", - "eslint-plugin-import": "^2.25.4", - "eslint-plugin-jest": "^26.1.2", - "husky": "^7.0.4", - "lint-staged": "^12.3.7", - "prettier": "^2.6.0", - "prettier-plugin-apex": "^1.10.0" - }, - "lint-staged": { - "**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [ - "prettier --write" - ], - "**/{aura,lwc}/**": [ - "eslint" - ] - } -} \ No newline at end of file From 2397723b6eaa25d68a3f9b69c7b5b9c4bfa75c1d Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Thu, 10 Oct 2024 05:36:05 -0500 Subject: [PATCH 02/29] Update feature.yml --- .github/workflows/feature.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index 8d6b52c..9e4508b 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -10,12 +10,6 @@ jobs: feature-test: name: "Feature Test" uses: muselab-d2x/d2x/.github/workflows/feature-test.yml@cumulusci-next-snapshots - with: - create_pr_snapshot: true - create_failure_snapshot: true - create_commit_status: true - create_envionment: true - secrets: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" gh-email: "${{ secrets.GH_EMAIL }}" From d7b34b431df3a68055a4dad4b612d1e550074895 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Fri, 11 Oct 2024 07:57:07 -0500 Subject: [PATCH 03/29] Add workflow to create pr snapshots and one to use them --- .github/workflows/feature-pr-snapshot.yml | 16 ++++++++++++++++ .github/workflows/feature.yml | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/feature-pr-snapshot.yml diff --git a/.github/workflows/feature-pr-snapshot.yml b/.github/workflows/feature-pr-snapshot.yml new file mode 100644 index 0000000..ca846b9 --- /dev/null +++ b/.github/workflows/feature-pr-snapshot.yml @@ -0,0 +1,16 @@ +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 }}" diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index 9e4508b..dfdb596 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -1,5 +1,5 @@ name: > - 2GP Feature Test and Snapshot + Unmanaged Feature Test Using Predicted Snapshots on: workflow_dispatch: push: From c7a0706e23bd9996869948a8f37939156f20f21f Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Fri, 11 Oct 2024 08:00:25 -0500 Subject: [PATCH 04/29] Update README to trigger build --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b87826a..c8d6b15 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,4 @@ You can check the status of your setup by monitoring the status of the following * [![2GP Feature Test](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/feature.yml/badge.svg)](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/feature.yml) * [![Beta Test](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/beta.yml/badge.svg)](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/beta.yml) * [![Production Release](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/release.yml/badge.svg)](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/release.yml) + From 0b94f84e1c53ad55160f685448f837be99b8863a Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Fri, 11 Oct 2024 08:30:21 -0500 Subject: [PATCH 05/29] Add flow to update dependencies snapshot --- .github/workflows/snapshot-dependencies.yml | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/snapshot-dependencies.yml diff --git a/.github/workflows/snapshot-dependencies.yml b/.github/workflows/snapshot-dependencies.yml new file mode 100644 index 0000000..908bf12 --- /dev/null +++ b/.github/workflows/snapshot-dependencies.yml @@ -0,0 +1,22 @@ +name: > + Snapshot the dependencies flow results +on: + workflow_dispatch: + push: + branches: + - feature/initial-schema + - main + +jobs: + feature-test: + name: "Feature Test" + 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 }}" + with: + org_name: feature + flow_name: dependencies + create_snapshot_commit_status: true + create_snapshot_environment: true From 7e11e667541a3ee21de6197b2629ebe60a4e3d86 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Fri, 11 Oct 2024 08:32:24 -0500 Subject: [PATCH 06/29] Update README to trigger builds --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index c8d6b15..b87826a 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,3 @@ You can check the status of your setup by monitoring the status of the following * [![2GP Feature Test](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/feature.yml/badge.svg)](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/feature.yml) * [![Beta Test](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/beta.yml/badge.svg)](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/beta.yml) * [![Production Release](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/release.yml/badge.svg)](https://github.com/muselab-d2x/Oh-Snap/actions/workflows/release.yml) - From 34e6a0ea403c249b49522a241182dba555be2837 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Sun, 13 Oct 2024 17:20:54 -0500 Subject: [PATCH 07/29] Set create_pr_snapshot to true --- .github/workflows/feature-pr-snapshot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/feature-pr-snapshot.yml b/.github/workflows/feature-pr-snapshot.yml index ca846b9..ae8954d 100644 --- a/.github/workflows/feature-pr-snapshot.yml +++ b/.github/workflows/feature-pr-snapshot.yml @@ -14,3 +14,5 @@ jobs: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" gh-email: "${{ secrets.GH_EMAIL }}" github-token: "${{ secrets.CCI_GITHUB_TOKEN }}" + with: + create_pr_snapshot: false From 6f3f0093257d211555e643df015ceeefc727dcef Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Mon, 14 Oct 2024 08:17:10 -0500 Subject: [PATCH 08/29] Fix unmanaged builds --- cumulusci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cumulusci.yml b/cumulusci.yml index 25096ae..8593eec 100644 --- a/cumulusci.yml +++ b/cumulusci.yml @@ -74,17 +74,23 @@ flows: steps: 3: flow: config_common + config_qa: steps: 3: - # QA is done using the qa_org_2gp flow using 2GP package versions - flow: config_common + 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: From 8954d810bf87b86ed1043cb5ed2fee303274991e Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Mon, 14 Oct 2024 08:43:52 -0500 Subject: [PATCH 09/29] Set flags to create snapshots --- .github/workflows/feature-pr-snapshot.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/feature-pr-snapshot.yml b/.github/workflows/feature-pr-snapshot.yml index ae8954d..e78ba83 100644 --- a/.github/workflows/feature-pr-snapshot.yml +++ b/.github/workflows/feature-pr-snapshot.yml @@ -15,4 +15,7 @@ jobs: gh-email: "${{ secrets.GH_EMAIL }}" github-token: "${{ secrets.CCI_GITHUB_TOKEN }}" with: - create_pr_snapshot: false + create_pr_snapshot: true + create_failure_snapshot: true + create_snapshot_commit_status: true + create_snapshot_environment: true From d2be49efe4ce0c3579b5d2e69b5cea4b07de1164 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Mon, 14 Oct 2024 09:56:45 -0500 Subject: [PATCH 10/29] Fix job names --- .github/workflows/snapshot-dependencies.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/snapshot-dependencies.yml b/.github/workflows/snapshot-dependencies.yml index 908bf12..b11b34d 100644 --- a/.github/workflows/snapshot-dependencies.yml +++ b/.github/workflows/snapshot-dependencies.yml @@ -8,8 +8,8 @@ on: - main jobs: - feature-test: - name: "Feature Test" + 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 }}" From df0a89c04f6e1e0545b8a8061ea5daffa2f3bc50 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Mon, 14 Oct 2024 11:37:05 -0500 Subject: [PATCH 11/29] Fix task options for github_pull_request_snapshot --- cumulusci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cumulusci.yml b/cumulusci.yml index 8593eec..7c3a1f6 100644 --- a/cumulusci.yml +++ b/cumulusci.yml @@ -34,9 +34,8 @@ tasks: github_pull_request_snapshot: options: - project_code: OH snapshot_pr: True - snapshot_failure: True + snapshot_fail_pr: True run_tests: options: From 3930153580e576606048f81aa3d820384c8f435f Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Wed, 16 Oct 2024 08:47:42 -0500 Subject: [PATCH 12/29] Disable GitHub environment creation for now --- .github/workflows/feature-pr-snapshot.yml | 1 - cumulusci.yml | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/feature-pr-snapshot.yml b/.github/workflows/feature-pr-snapshot.yml index e78ba83..3a570c3 100644 --- a/.github/workflows/feature-pr-snapshot.yml +++ b/.github/workflows/feature-pr-snapshot.yml @@ -18,4 +18,3 @@ jobs: create_pr_snapshot: true create_failure_snapshot: true create_snapshot_commit_status: true - create_snapshot_environment: true diff --git a/cumulusci.yml b/cumulusci.yml index 7c3a1f6..57c8ad5 100644 --- a/cumulusci.yml +++ b/cumulusci.yml @@ -94,12 +94,16 @@ orgs: scratch: beta: config_file: orgs/managed.json + namespaced: False dev: config_file: orgs/unmanaged.json - track_history: True + 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 From f1dab0dd66401941b9772bc9f46ff737c642b792 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Thu, 17 Oct 2024 07:53:19 -0500 Subject: [PATCH 13/29] Add 2gp feature test workflow with predictive snapshots --- .github/workflows/feature-2gp.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/feature-2gp.yml diff --git a/.github/workflows/feature-2gp.yml b/.github/workflows/feature-2gp.yml new file mode 100644 index 0000000..8ecdc44 --- /dev/null +++ b/.github/workflows/feature-2gp.yml @@ -0,0 +1,16 @@ +name: > + 2GP Feature Test with Predicted Snapshots +on: + workflow_dispatch: + push: + branches: + - feature/** + - main +jobs: + feature-test: + name: "Feature Test" + uses: muselab-d2x/d2x/.github/workflows/feature-test-2gp.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 }}" From 0f94a2251ea3a76183503ae551d3b5b021afc1c2 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Thu, 17 Oct 2024 08:30:27 -0500 Subject: [PATCH 14/29] Add github app id/key --- .github/workflows/feature-pr-snapshot.yml | 2 ++ .github/workflows/snapshot-dependencies.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/feature-pr-snapshot.yml b/.github/workflows/feature-pr-snapshot.yml index 3a570c3..60d2325 100644 --- a/.github/workflows/feature-pr-snapshot.yml +++ b/.github/workflows/feature-pr-snapshot.yml @@ -14,6 +14,8 @@ jobs: 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 diff --git a/.github/workflows/snapshot-dependencies.yml b/.github/workflows/snapshot-dependencies.yml index b11b34d..b3b4f43 100644 --- a/.github/workflows/snapshot-dependencies.yml +++ b/.github/workflows/snapshot-dependencies.yml @@ -15,6 +15,8 @@ jobs: 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 From 3c0a85da8bdcf53b237b91038ab39a1fe6b0c6ef Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Thu, 17 Oct 2024 08:36:32 -0500 Subject: [PATCH 15/29] Trigger builds --- .github/workflows/snapshot-dependencies.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/snapshot-dependencies.yml b/.github/workflows/snapshot-dependencies.yml index b3b4f43..0a7370f 100644 --- a/.github/workflows/snapshot-dependencies.yml +++ b/.github/workflows/snapshot-dependencies.yml @@ -6,7 +6,6 @@ on: branches: - feature/initial-schema - main - jobs: snapshot-dependencies: name: "Snapshot dependencies" From a4c5de9e7ab97cde46aef48fa892f33daf337727 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Fri, 18 Oct 2024 07:46:48 -0500 Subject: [PATCH 16/29] Rework flows: - Added build-feature-test-package - Changed feature-2gp and new feature-2gp-snapshot to trigger off successful build-feature-test-package - Test out new logic for determining if a PR snapshot should even be created before creating an org --- .../workflows/build-feature-test-package.yml | 16 ++++++++++ .github/workflows/feature-2gp-snapshot.yml | 29 +++++++++++++++++++ .github/workflows/feature-2gp.yml | 11 ++++--- .github/workflows/feature-pr-snapshot.yml | 9 +++--- .github/workflows/feature.yml | 11 +++---- 5 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/build-feature-test-package.yml create mode 100644 .github/workflows/feature-2gp-snapshot.yml diff --git a/.github/workflows/build-feature-test-package.yml b/.github/workflows/build-feature-test-package.yml new file mode 100644 index 0000000..fcd74ab --- /dev/null +++ b/.github/workflows/build-feature-test-package.yml @@ -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 }}" diff --git a/.github/workflows/feature-2gp-snapshot.yml b/.github/workflows/feature-2gp-snapshot.yml new file mode 100644 index 0000000..67b3a8d --- /dev/null +++ b/.github/workflows/feature-2gp-snapshot.yml @@ -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 Feature Test Package + types: + - completed +jobs: + feature-test: + name: "Feature Test and Snapshot" + 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 + triggering_workflow_conclusion: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion || 'success' }} diff --git a/.github/workflows/feature-2gp.yml b/.github/workflows/feature-2gp.yml index 8ecdc44..f3d7b87 100644 --- a/.github/workflows/feature-2gp.yml +++ b/.github/workflows/feature-2gp.yml @@ -2,10 +2,11 @@ name: > 2GP Feature Test with Predicted Snapshots on: workflow_dispatch: - push: - branches: - - feature/** - - main + workflow_run: + workflows: + - Build Feature Test Package + types: + - completed jobs: feature-test: name: "Feature Test" @@ -14,3 +15,5 @@ jobs: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" gh-email: "${{ secrets.GH_EMAIL }}" github-token: "${{ secrets.CCI_GITHUB_TOKEN }}" + with: + triggering_workflow_conclusion: ${{ github.event.workflow_run.conclusion }} diff --git a/.github/workflows/feature-pr-snapshot.yml b/.github/workflows/feature-pr-snapshot.yml index 60d2325..9ada44c 100644 --- a/.github/workflows/feature-pr-snapshot.yml +++ b/.github/workflows/feature-pr-snapshot.yml @@ -2,10 +2,11 @@ name: > Unmanaged Feature Test With PR Snapshot Creation on: workflow_dispatch: - push: - branches: - - feature/** - - main + workflow_run: + workflows: + - Build Feature Test Package + types: + - completed jobs: feature-test: name: "Feature Test" diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index dfdb596..8f0d81b 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -2,10 +2,11 @@ name: > Unmanaged Feature Test Using Predicted Snapshots on: workflow_dispatch: - push: - branches: - - feature/** - - main + workflow_run: + workflows: + - Build Feature Test Package + types: + - completed jobs: feature-test: name: "Feature Test" @@ -13,4 +14,4 @@ jobs: 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 }}" \ No newline at end of file From 775697c8d14fbfef983364333333c1558aa3e201 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Fri, 18 Oct 2024 07:49:14 -0500 Subject: [PATCH 17/29] Add push triggers back to unmanaged jobs --- .github/workflows/feature-pr-snapshot.yml | 10 +++++----- .github/workflows/feature.yml | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/feature-pr-snapshot.yml b/.github/workflows/feature-pr-snapshot.yml index 9ada44c..fd1adee 100644 --- a/.github/workflows/feature-pr-snapshot.yml +++ b/.github/workflows/feature-pr-snapshot.yml @@ -2,11 +2,11 @@ name: > Unmanaged Feature Test With PR Snapshot Creation on: workflow_dispatch: - workflow_run: - workflows: - - Build Feature Test Package - types: - - completed + push: + branches: + - feature/** + - main + jobs: feature-test: name: "Feature Test" diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index 8f0d81b..b765629 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -2,11 +2,10 @@ name: > Unmanaged Feature Test Using Predicted Snapshots on: workflow_dispatch: - workflow_run: - workflows: - - Build Feature Test Package - types: - - completed + push: + branches: + - feature/** + - main jobs: feature-test: name: "Feature Test" From 231885a04a56bd55eac1cf1dd853bafdcd68357f Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Fri, 18 Oct 2024 08:15:20 -0500 Subject: [PATCH 18/29] Attempt to fix workflow_run triggering --- .github/workflows/feature-2gp-snapshot.yml | 5 +++-- .github/workflows/feature-2gp.yml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/feature-2gp-snapshot.yml b/.github/workflows/feature-2gp-snapshot.yml index 67b3a8d..0459c9d 100644 --- a/.github/workflows/feature-2gp-snapshot.yml +++ b/.github/workflows/feature-2gp-snapshot.yml @@ -10,12 +10,13 @@ on: workflow_run: workflows: - - Build Feature Test Package + - 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 }}" @@ -26,4 +27,4 @@ jobs: create_pr_snapshot: true create_failure_snapshot: true create_snapshot_commit_status: true - triggering_workflow_conclusion: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion || 'success' }} + triggering_workflow_conclusion: ${{ github.event.workflow_run.conclusion }} \ No newline at end of file diff --git a/.github/workflows/feature-2gp.yml b/.github/workflows/feature-2gp.yml index f3d7b87..97eed68 100644 --- a/.github/workflows/feature-2gp.yml +++ b/.github/workflows/feature-2gp.yml @@ -10,10 +10,11 @@ on: 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 secrets: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" gh-email: "${{ secrets.GH_EMAIL }}" github-token: "${{ secrets.CCI_GITHUB_TOKEN }}" with: - triggering_workflow_conclusion: ${{ github.event.workflow_run.conclusion }} + triggering_workflow_conclusion: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion || 'success' }} From edbb4a54eb0b99ff6b79472f5737e4283262fa97 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Fri, 18 Oct 2024 08:27:22 -0500 Subject: [PATCH 19/29] Update workflow name for trigger --- .github/workflows/feature-2gp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-2gp.yml b/.github/workflows/feature-2gp.yml index 97eed68..295a169 100644 --- a/.github/workflows/feature-2gp.yml +++ b/.github/workflows/feature-2gp.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: workflow_run: workflows: - - Build Feature Test Package + - Build 2GP Feature Test Package types: - completed jobs: From cdc99be2a3f1c7acc861d366fcf512b30bdb1d28 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Fri, 18 Oct 2024 08:33:31 -0500 Subject: [PATCH 20/29] Attempt to fix triggering --- .github/workflows/feature-2gp-snapshot.yml | 3 +-- .github/workflows/feature-2gp.yml | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/feature-2gp-snapshot.yml b/.github/workflows/feature-2gp-snapshot.yml index 0459c9d..b2353e7 100644 --- a/.github/workflows/feature-2gp-snapshot.yml +++ b/.github/workflows/feature-2gp-snapshot.yml @@ -26,5 +26,4 @@ jobs: debug: ${{ github.event.inputs.debug }} create_pr_snapshot: true create_failure_snapshot: true - create_snapshot_commit_status: true - triggering_workflow_conclusion: ${{ github.event.workflow_run.conclusion }} \ No newline at end of file + create_snapshot_commit_status: true \ No newline at end of file diff --git a/.github/workflows/feature-2gp.yml b/.github/workflows/feature-2gp.yml index 295a169..413f972 100644 --- a/.github/workflows/feature-2gp.yml +++ b/.github/workflows/feature-2gp.yml @@ -16,5 +16,3 @@ jobs: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" gh-email: "${{ secrets.GH_EMAIL }}" github-token: "${{ secrets.CCI_GITHUB_TOKEN }}" - with: - triggering_workflow_conclusion: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion || 'success' }} From 13d0adda49e3d8746d4bdeee72c1176f3737a382 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Sat, 19 Oct 2024 08:31:40 -0500 Subject: [PATCH 21/29] Add support for environment creation in workflow_dispatch --- .github/workflows/feature-2gp.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/feature-2gp.yml b/.github/workflows/feature-2gp.yml index 413f972..4590fdf 100644 --- a/.github/workflows/feature-2gp.yml +++ b/.github/workflows/feature-2gp.yml @@ -2,6 +2,15 @@ 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 + debug: + description: "Enable cci's debug mode for more verbose output" + type: boolean + required: false + default: false workflow_run: workflows: - Build 2GP Feature Test Package @@ -12,6 +21,9 @@ jobs: 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: + debug: ${{ github.event.inputs.debug }} + environment_name: ${{ github.event.inputs.environment_name || '' }} secrets: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" gh-email: "${{ secrets.GH_EMAIL }}" From 445d4dea0ab8bb11e68de345a083ede6ffc3680e Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Sat, 19 Oct 2024 08:35:17 -0500 Subject: [PATCH 22/29] Fix env --- .github/workflows/feature-2gp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-2gp.yml b/.github/workflows/feature-2gp.yml index 4590fdf..933f2d7 100644 --- a/.github/workflows/feature-2gp.yml +++ b/.github/workflows/feature-2gp.yml @@ -22,7 +22,7 @@ jobs: 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: - debug: ${{ github.event.inputs.debug }} + debug: ${{ github.event.inputs.debug || false }} environment_name: ${{ github.event.inputs.environment_name || '' }} secrets: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" From 7d7bb7f73400e5428409a5dda22ef4ce1ec74182 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Sat, 19 Oct 2024 08:38:31 -0500 Subject: [PATCH 23/29] Skip debug support for now --- .github/workflows/feature-2gp.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/feature-2gp.yml b/.github/workflows/feature-2gp.yml index 933f2d7..f76d95c 100644 --- a/.github/workflows/feature-2gp.yml +++ b/.github/workflows/feature-2gp.yml @@ -6,11 +6,6 @@ on: 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 - debug: - description: "Enable cci's debug mode for more verbose output" - type: boolean - required: false - default: false workflow_run: workflows: - Build 2GP Feature Test Package @@ -22,7 +17,6 @@ jobs: 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: - debug: ${{ github.event.inputs.debug || false }} environment_name: ${{ github.event.inputs.environment_name || '' }} secrets: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" From 37618c33ed72ea18ddaf3480a76721f8cef45cac Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Sun, 20 Oct 2024 07:43:48 -0500 Subject: [PATCH 24/29] Add snpashot prerelease dependencies flow --- .github/workflows/feature.yml | 2 +- .github/workflows/snapshot-dependencies.yml | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index b765629..e287fd0 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - feature/** + # - feature/** - main jobs: feature-test: diff --git a/.github/workflows/snapshot-dependencies.yml b/.github/workflows/snapshot-dependencies.yml index 0a7370f..a6af29a 100644 --- a/.github/workflows/snapshot-dependencies.yml +++ b/.github/workflows/snapshot-dependencies.yml @@ -2,10 +2,6 @@ name: > Snapshot the dependencies flow results on: workflow_dispatch: - push: - branches: - - feature/initial-schema - - main jobs: snapshot-dependencies: name: "Snapshot dependencies" From b42d99d08d8ccc2b0e1207f5f243fcf3c749b69d Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Sun, 20 Oct 2024 07:45:37 -0500 Subject: [PATCH 25/29] Add workflow --- .../snapshot-dependencies-prerelease.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/snapshot-dependencies-prerelease.yml diff --git a/.github/workflows/snapshot-dependencies-prerelease.yml b/.github/workflows/snapshot-dependencies-prerelease.yml new file mode 100644 index 0000000..6320af1 --- /dev/null +++ b/.github/workflows/snapshot-dependencies-prerelease.yml @@ -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 From 93ed8a5910dd81cdb7341e66ef8776033df5697c Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Sun, 20 Oct 2024 08:15:09 -0500 Subject: [PATCH 26/29] Add workflow for testing env saving with the devhub --- .github/workflows/test-org-to-env.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/test-org-to-env.yml diff --git a/.github/workflows/test-org-to-env.yml b/.github/workflows/test-org-to-env.yml new file mode 100644 index 0000000..fb939ac --- /dev/null +++ b/.github/workflows/test-org-to-env.yml @@ -0,0 +1,18 @@ +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.CCI_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 \ No newline at end of file From 357054022e5f66c93fad1b98fe96250cf34d022f Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Sun, 20 Oct 2024 08:57:42 -0500 Subject: [PATCH 27/29] Use default github token --- .github/workflows/test-org-to-env.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-org-to-env.yml b/.github/workflows/test-org-to-env.yml index fb939ac..cab5b53 100644 --- a/.github/workflows/test-org-to-env.yml +++ b/.github/workflows/test-org-to-env.yml @@ -10,7 +10,7 @@ jobs: secrets: dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" target-org-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" - github-token: "${{ secrets.CCI_GITHUB_TOKEN }}" + github-token: "${{ secrets.GITHUB_TOKEN }}" github-app-id: "${{ secrets.CCI_GITHUB_APP_ID }}" github-app-key: "${{ secrets.CCI_GITHUB_APP_KEY }}" with: From 1b1e93c85ddc6bd965650d7fa864052c60b00edb Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Sun, 20 Oct 2024 10:01:43 -0500 Subject: [PATCH 28/29] Add update_environment --- .github/workflows/test-org-to-env.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-org-to-env.yml b/.github/workflows/test-org-to-env.yml index cab5b53..79d5d0a 100644 --- a/.github/workflows/test-org-to-env.yml +++ b/.github/workflows/test-org-to-env.yml @@ -15,4 +15,5 @@ jobs: github-app-key: "${{ secrets.CCI_GITHUB_APP_KEY }}" with: org_alias: target - environment_name: MuselabPBO \ No newline at end of file + environment_name: MuselabPBO + update_environment: true \ No newline at end of file From 64a4f8ca71fc0805750d5d1d5e2e4f8f660d51d2 Mon Sep 17 00:00:00 2001 From: Jason Lantz Date: Tue, 22 Oct 2024 10:20:30 -0500 Subject: [PATCH 29/29] Add org-from-snapshot workflow --- .github/workflows/org-from-snapshot.yml | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/org-from-snapshot.yml diff --git a/.github/workflows/org-from-snapshot.yml b/.github/workflows/org-from-snapshot.yml new file mode 100644 index 0000000..47c4109 --- /dev/null +++ b/.github/workflows/org-from-snapshot.yml @@ -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 }}