Skip to content

Commit

Permalink
UI cleanup (#266)
Browse files Browse the repository at this point in the history
* Replaced old logJSONViewer aura cmp & logViewer lwc with a new consolidated logJSON quickaction lwc

* Updated layouts & objects to remove XML nodes <excludeButtons>IsotopeSubscription</excludeButtons> and <excludedStandardButtons>OpenListInQuip</excludedStandardButtons> because dealing with standard buttons is the worst. In orgs that don't have these features enabled, the package installation fails

* Optimized the LogEntry__c flexipage by moving limits fields to be within a tab, and removed some fields from the page

* Added Chatter Feed component to app utility bar

* Fixed an issue in README's markdown accidentally removing the install button image

* Switched to using separate environment names in GitHub Actions

* Renamed deploy.yml to build.yml, added the amazing pwsh function @jamessimone created for apex-rollup to auto-promote any prod package versions that are listed in README files
  • Loading branch information
jongpie committed Jan 14, 2022
1 parent 7c0af6e commit e0a5d6b
Show file tree
Hide file tree
Showing 29 changed files with 633 additions and 596 deletions.
48 changes: 39 additions & 9 deletions .github/workflows/deploy.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Pipeline for Nebula Logger
name: Deployment
name: Build

on:
push:
Expand Down Expand Up @@ -43,7 +43,6 @@ jobs:
code-quality-tests:
name: 'Run Code Quality Tests'
runs-on: ubuntu-latest
environment: Test
steps:
- name: 'Checkout source code'
uses: actions/checkout@v2
Expand Down Expand Up @@ -88,7 +87,6 @@ jobs:
name: 'Run LWC Tests'
needs: [code-quality-tests]
runs-on: ubuntu-latest
environment: Test
steps:
- name: 'Checkout source code'
uses: actions/checkout@v2
Expand Down Expand Up @@ -116,12 +114,11 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
flags: LWC

# TODO find a way to consolidate duplicated LOC for scratch org steps
base-scratch-org-tests:
name: 'Run Base Scratch Org Tests'
needs: [code-quality-tests]
runs-on: ubuntu-latest
environment: Test
environment: 'Base Scratch Org'
steps:
- name: 'Checkout source code'
uses: actions/checkout@v2
Expand Down Expand Up @@ -168,7 +165,7 @@ jobs:
name: 'Run Experience Cloud Scratch Org Tests'
needs: [code-quality-tests]
runs-on: ubuntu-latest
environment: Test
environment: 'Experience Cloud Scratch Org'
steps:
- name: 'Checkout source code'
uses: actions/checkout@v2
Expand Down Expand Up @@ -215,7 +212,6 @@ jobs:
- name: 'Run Apex Tests'
run: npm run test:apex

# TODO revisit this part - for now, CodeCov.io upload will only run in the Experience Cloud org
- name: 'Delete unsupported code coverage files'
run: rm ./test-coverage/apex/test-result-707*-codecoverage.json

Expand All @@ -234,7 +230,7 @@ jobs:
needs: [lwc-tests, base-scratch-org-tests, experience-cloud-scratch-org-tests]
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
environment: Test
environment: 'Demo Org'
steps:
- name: 'Checkout source code'
uses: actions/checkout@v2
Expand Down Expand Up @@ -288,7 +284,7 @@ jobs:
needs: [lwc-tests, base-scratch-org-tests, experience-cloud-scratch-org-tests]
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
environment: Test
environment: 'Demo Org'
steps:
- name: 'Checkout source code'
uses: actions/checkout@v2
Expand Down Expand Up @@ -319,3 +315,37 @@ jobs:

- name: 'Create Beta Managed Package Version'
run: npm run package:version:create:managed

promote-package-versions:
name: 'Promote Package Versions'
needs: [lwc-tests, base-scratch-org-tests, experience-cloud-scratch-org-tests]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
uses: actions/checkout@v2

- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v2
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ env.cache-name }}-
npm-
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

- name: 'Authorize Packaging Org'
shell: bash
run: |
echo ${{ env.DEVHUB_SFDX_URL }} > ./DEVHUB_SFDX_URL.txt
npx sfdx auth:sfdxurl:store --sfdxurlfile ./DEVHUB_SFDX_URL.txt --setalias nebula-logger-packaging --setdefaultdevhubusername
env:
DEVHUB_SFDX_URL: ${{ secrets.DEVHUB_SFDX_URL }}

- name: 'Promote package versions'
run: npx pwsh ./config/scripts/build/promote-readme-packages.ps1
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

Designed for Salesforce admins, developers & architects. A robust logger for Apex, Lightning Components, Flow, Process Builder & Integrations.

## Unlocked Package - v4.6.15
## Unlocked Package - v4.6.16

[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lKDQAY)
[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lKDQAY)
[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lLzQAI)
[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lLzQAI)
[![View Documentation](./images/btn-view-documentation.png)](https://jongpie.github.io/NebulaLogger/)

## Managed Package - v4.6.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function Update-README-Package-Version-Id {

$packageVersionId = "$packageVersionId".Trim()
# Since there are links for both the unlocked & managed packages, the unlocked package buttons are used to ensure the correct link is updated
$sandboxUnlockedPackageReplacement = "https://test.salesforce.com/packaging/installPackage.apexp?p0=$packageVersionId"
$sandboxUnlockedPackageReplacement = "btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=$packageVersionId"
((Get-Content -path $targetreadme -Raw) -replace "btn-install-unlocked-package-sandbox.png\)\]\(https:\/\/test.salesforce.com\/packaging\/installPackage.apexp\?p0=.{0,18}", $sandboxUnlockedPackageReplacement) | Set-Content -Path $targetreadme -NoNewline
$productionUnlockedPackageReplacement = "btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=$packageVersionId"
((Get-Content -path $targetreadme -Raw) -replace "btn-install-unlocked-package-production.png\)\]\(https:\/\/login.salesforce.com\/packaging\/installPackage.apexp\?p0=.{0,18}", $productionUnlockedPackageReplacement) | Set-Content -Path $targetreadme -NoNewline
Expand Down
24 changes: 24 additions & 0 deletions config/scripts/build/promote-readme-packages.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This script finds any production install links for packages within README files & automatically promotes them

$DebugPreference = 'Continue'
$ErrorActionPreference = 'Stop'

function Start-Package-Promotion {
Write-Debug "Beginning promote script"

$allReadmes = Get-ChildItem -Exclude node_modules, .sfdx, tests | Get-ChildItem -Filter README.md -Recurse
foreach ($readme in $allReadmes) {
$readmePackageIdResults = (Select-String -Path $readme 'https:\/\/login.salesforce.com\/packaging\/installPackage.apexp\?p0=.{0,18}')
if ($readmePackageIdResults.Matches.Length -gt 0) {
$packageIdSplit = $readmePackageIdResults.Matches[0].Value.Split("=")
if ($packageIdSplit.Length -eq 2) {
$packageId = $packageIdSplit[1]
Write-Debug "Promoting $packageId from $readme"
npx sfdx force:package:version:promote --package $packageId --noprompt
}
}
}
Write-Debug "Finished package promotion!"
}

Start-Package-Promotion

This file was deleted.

This file was deleted.

Loading

0 comments on commit e0a5d6b

Please sign in to comment.