deps: migrate to use the SDK for the certs topic#3824
Open
jdodson wants to merge 8 commits into
Open
Conversation
…json) - test(certs): stub @heroku/sdk directly, drop nock (test)
Signed-off-by: Jon Dodson <jdodson@salesforce.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate all 10 certs commands to use the SDK.
Commands
certs,certs:generate,certs:info,certs:remove,certs:updatecerts:auto,certs:auto:enable,certs:auto:disable,certs:auto:refreshcerts:addAlso
lib/certs/domains.ts.lib/domains/domains.ts(shared with the domains topic — only the wait logic went, presentation stayed).certs:auto:refreshwas blocked on a schema gap;@heroku/types@4.0.1fixes it, so it's included here.
Type of Change
Breaking Changes (major semver update)
!after your change type to denote a change that breaks current behaviorFeature Additions (minor semver update)
Patch Updates (patch semver update)
Testing
The SDK uses heroku-fetch, which reads a netrc file — so log in with
HEROKU_NETRC_WRITE=true. Use a throwaway test app. Some steps aredestructive (remove, auto:disable).
Setup
npm i && npm run build./bin/run logoutHEROKU_NETRC_WRITE=true ./bin/run loginCreate an app + custom domain to test against
./bin/run domains:add test.example.com --app APPcerts:addassociates the cert withand what
certs:autoreports ACM status foractually reach
cert issued(otherwise it stayspending, which is finefor exercising the code path)
If you only want to smoke-test the cert CRUD commands (
generate/add/list/info/update/remove) and skip ACM, a plainapps:createapp is enough —no domain or paid dyno needed.
certs:generate — makes a self-signed cert on disk
./bin/run certs:generate test1.example.com --app APP --selfsigned --nowtest1.example.com.crtandtest1.example.com.keycerts:add — the interactive path (needs the 2 certs above)
./bin/run certs:add test1.example.com.crt test1.example.com.key --app APPcerts (list)
./bin/run certs --app APPNamecerts:info
./bin/run certs:info --app APP --name CERT_NAME./bin/run certs:info --app APP --name CERT_NAME --show-domainscerts:update — reuse the generated files
./bin/run certs:update test1.example.com.crt test1.example.com.key --app APP --name CERT_NAMEcerts:auto:enable / auto / auto:refresh / auto:disable
./bin/run certs:auto:enable --app APP./bin/run certs:auto --app APP./bin/run certs:auto:refresh --app APPPATCH must send a body, not silently no-op)
./bin/run certs:auto:disable --app APP --confirm APPcerts:remove (destructive — do last)
./bin/run certs:remove --app APP --name CERT_NAME --confirm APP./bin/run certs --app APPno longer lists itCleanup
.crt/.keyfiles./bin/run apps:destroy --app APP --confirm APP(if you made a throwaway app)./bin/run logoutRelated Issues
GUS work item: https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002eHYVDYA4/view