NaCi vs ChatGPT: Which one is better for creating Salesforce CI/CD pipelines in seconds?
If you've been on the internet for the last few days, you have probably heard of ChatGPT, an AI app that can (among many other things) create almost production-ready apex code for you. It's really incredible!
Can ChatGPT create a CI/CD Pipeline?
So I wanted to check if the app could create an entire YAML file for a Salesforce CI/CD pipeline. Here's what I asked:
create a github actions yaml file that deploys the delta changes from a salesforce org. The workflow should trigger when a pull request is closed against the "main" branch. The code should be scanned using the sfdx scanner.
And here's the result
The entire YAML file is this one:
name: SFDX Deploy on Pull Request Close
on:
pull_request:
branches: [main]
types: [closed]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: actions/setup-java@v1
- uses: actions/setup-sfdx@v1
with:
sfdx-version: latest
- run: sfdx force:auth:jwt:grant --clientid ${{ secrets.SFDX_CLIENT_ID }} --jwtkeyfile assets/server.key --username ${{ secrets.SFDX_USERNAME }} --setdefaultdevhubusername -a DevHub
- run: sfdx force:source:deploy -u ${{ secrets.SFDX_USERNAME }} -d src -w 10
- run: sfdx force:scan:run -u ${{ secrets.SFDX_USERNAME }} -r
Not bad!
What's missing
So, the above is not bad at all! I'm very impressed!
That said, it got a few these things wrong:
- No delta package was created
- It didn't use the sfdx scanner to scan the code
NaCi is the clear winner
With NaCi (https://ci.salto.io/ ) you can create a fully functional CI/CD pipeline in GitHub Actions (more CI servers coming soon), with just a few clicks
And the output YAML file is 100% accurate, here's a sample one:
So turns out some old-school code, in this case, is better than AI. 😅
What do you think? Will AI impact how we think of DevOps and CI/CD?