Use getporter.org for custom extensions in bundle.json #2661
Labels
help wanted
Good for someone who has contributed before
pep003-advanced-dependencies
Implementation of the Advanced Dependencies proposal
When porter was first written we were using the porter.sh domain. We now use getporter.org and would like to be consistent about the domain when it makes sense.
When porter build is run, it generates the CNAB bundle definition, bundle.json. Porter defines custom extensions to define special porter-specific behavior using the
sh.porter.*
domain, such assh.porter.file-parameters
orsh.porter
extensions. Going forward with the v2 dependencies custom extension,org.getporter.dependencies@v2
we are using the new domain and I would like to be able to have all our custom extensions use the new domain as well. Mostly for consistency and avoid confusion long term.To preserve compatibility with existing bundles that use the porter.sh domain, we can do a quick replacement on the keys in the custom map on the bundle. When we find well-known keys that should be renamed to getporter.org, swap them. This can occur easily at load time when we process the bundle extensions (LoadBundle in pkg/cnab/provider/bundle.go) and then we can use the new domain throughout our code. The extensions in pkg/cnab/file_parameter.go and pkg/cnab/extensions.go should be updated to use org.getporter instead of sh.porter and test files updated to match. You can run
mage updateTestFiles
after making your change and that will updated any testdata files to match the new output.We would need a unit test for each of those extensions to validate that we can detect those two extensions properly using the ExtendedBundle wrapper after calling LoadBundle. Some of the integration tests use existing bundles that have already been published, and those will validate that we can still work with older bundles. For manual testing, you can run through the credentials quickstart which uses an older published bundle that has the old extension names.
Known extensions that use porter.sh that should be replaced:
See our Contributing Tutorial and New Contributor Guide for help getting started contributing to Porter.
ℹ️ Read PEP003 - Advanced Dependencies for context about how dependencies should work, design details, and notes about desired behavior.
The text was updated successfully, but these errors were encountered: