Skip to content

Commit

Permalink
Merge branch 'migrate-sf-plugin' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Sep 4, 2024
2 parents 53e3488 + 4fa4e34 commit 05be583
Show file tree
Hide file tree
Showing 8 changed files with 562 additions and 963 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/deploy-ALPHA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#######################################
# Start the job on all push to master #
#######################################
name: "Build & Deploy - ALPHA"
name: 'Build & Deploy - ALPHA'
on:
push:
branches:
- "alpha"
- 'alpha'

###############
# Set the Job #
Expand All @@ -29,14 +29,13 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'
always-auth: true
# Defaults to the user or organization that owns the workflow file
scope: "hardisgroupcom"
scope: 'hardisgroupcom'
- run: yarn install --frozen-lockfile && yarn run compile
- run: yarn config set version-git-tag false
- run: ALPHAID=$(date '+%Y%m%d%H%M')
- run: yarn version --prepatch --preid="alpha$ALPHAID"
- run: ALPHAID=$(date '+%Y%m%d%H%M') && yarn version --prepatch --preid="alpha$ALPHAID"
- run: yarn config set network-timeout 300000
- run: yarn publish --tag alpha
env:
Expand Down Expand Up @@ -93,13 +92,13 @@ jobs:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: "docker.io/hardisgroupcom/sfdx-hardis:alpha"
format: "table"
exit-code: "1"
image-ref: 'docker.io/hardisgroupcom/sfdx-hardis:alpha'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: "os,library"
vuln-type: 'os,library'
security-checks: vuln
severity: "CRITICAL,HIGH"
severity: 'CRITICAL,HIGH'

push_alpha_to_registry_sfdx_recommended:
name: Push alpha Docker image to Docker Hub (with @salesforce/cli version recommended by hardis)
Expand Down Expand Up @@ -152,10 +151,10 @@ jobs:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: "docker.io/hardisgroupcom/sfdx-hardis:alpha-sfdx-recommended"
format: "table"
exit-code: "1"
image-ref: 'docker.io/hardisgroupcom/sfdx-hardis:alpha-sfdx-recommended'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: "os,library"
vuln-type: 'os,library'
security-checks: vuln
severity: "CRITICAL,HIGH"
severity: 'CRITICAL,HIGH'
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Note: Can be used with `sfdx plugins:install sfdx-hardis@beta` and docker image

### Refactoring explanations

The future [deprecation of sfdx force:source:** commands on 6 november](https://github.com/forcedotcom/cli/issues/2974) finally convinced us to switch everything from SFDX core to SF CLI core. (otherwise existing CI/CD pipelines would not work anymore from this date !)
The future [deprecation of sfdx force:source:\*\* commands on 6 november](https://github.com/forcedotcom/cli/issues/2974) finally convinced us to switch everything from SFDX core to SF CLI core. (otherwise existing CI/CD pipelines would not work anymore from this date !)

Therefore, sfdx-hardis required a complete refactoring as described below, but this won't impact existing CI/CD and Monitoring pipelines.

Expand All @@ -15,11 +15,13 @@ We made many tests but risk zero do not exist, so if you see any bug, please rep
### Major changes

- Migrate plugin from SFDX plugin core to SF Cli Plugin core

- [Convert commands code from SfdxCommand base to SfCommand base](https://github.com/salesforcecli/cli/wiki/Migrate-Plugins-Built-for-sfdx)
- Migrate calls from Bulk API v1 to Bulk API v2
- Upgrade all npm dependencies to their latest version (more secured)

- Change background calls to legacy sfdx commands to call their SF Cli replacements

- `sfdx force:mdapi:convert` -> `sf project convert mdapi`
- `sfdx force:mdapi:deploy` -> `sf project deploy start --metadata-dir`
- `sfdx force:source:retrieve` -> `sf project retrieve start`
Expand Down Expand Up @@ -65,6 +67,7 @@ We made many tests but risk zero do not exist, so if you see any bug, please rep
### Deprecations

- Deprecate wrapper commands matching sfdx commands that will be removed. All replaced by sf hardis deploy start (TODO: complete !)

- `sfdx hardis:source:push`
- `sfdx hardis:source:deploy`
- `sfdx hardis:mdapi:retrieve`
Expand All @@ -74,12 +77,16 @@ We made many tests but risk zero do not exist, so if you see any bug, please rep

### Removals

- Replace puppeteer by puppeteer-core: it means that if you use a command requiring puppeteer, please make sure to have a Chrome available in your environment (already integrated within the Docker image)

- Get rid of [sfdx-essentials](https://github.com/nvuillam/sfdx-essentials) plugin dependency by internalizing its used commands

- `sf hardis:packagexml:append`
- `sf hardis:packagexml:remove`
- `sf hardis:project:clean:filter-xml-content`

- Remove npm dependencies (some of them not maintained anymore)

- @adobe/node-fetch-retry
- @amplitude/node
- @keyv/redis
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker image to run sfdx-hardis

FROM alpine:3.18
FROM alpine:3.20

LABEL maintainer="Nicolas VUILLAMY <[email protected]>"

Expand Down
4 changes: 0 additions & 4 deletions bin/run

This file was deleted.

Empty file modified bin/run.js
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"papaparse": "^5.4.1",
"pascalcase": "^2.0.0",
"psl": "^1.9.0",
"puppeteer": "^23.2.0",
"puppeteer-core": "^23.3.0",
"read-package-up": "^11.0.0",
"semver": "^7.6.3",
"set-value": "^4.1.0",
Expand All @@ -62,7 +62,7 @@
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.1.9",
"@salesforce/cli-plugins-testkit": "^5.3.10",
"@salesforce/cli-plugins-testkit": "^5.3.28",
"@salesforce/dev-config": "^4.3.1",
"@salesforce/dev-scripts": "^10",
"@types/columnify": "^1.5.4",
Expand Down Expand Up @@ -300,4 +300,4 @@
},
"exports": "./lib/index.js",
"type": "module"
}
}
2 changes: 1 addition & 1 deletion src/common/utils/orgConfigUtils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import c from 'chalk';
import fs from 'fs-extra';
import { glob } from 'glob';
import puppeteer from 'puppeteer';
import puppeteer from 'puppeteer-core';
import * as yaml from 'js-yaml';
import { uxLog } from './index.js';
import { SfError } from '@salesforce/core';
Expand Down
Loading

0 comments on commit 05be583

Please sign in to comment.