Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getporter.org for custom extensions in bundle.json #2661

Open
Tracked by #2667
carolynvs opened this issue Mar 28, 2023 · 0 comments
Open
Tracked by #2667

Use getporter.org for custom extensions in bundle.json #2661

carolynvs opened this issue Mar 28, 2023 · 0 comments
Labels
help wanted Good for someone who has contributed before pep003-advanced-dependencies Implementation of the Advanced Dependencies proposal

Comments

@carolynvs
Copy link
Member

carolynvs commented Mar 28, 2023

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 as sh.porter.file-parameters or sh.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:

  • sh.porter.file-parameters should be org.getporter.file-parameters
  • sh.porter should be org.getporter (this contains porter specific bundle metadata, such as the contents of the porter.yaml file)

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.

@carolynvs carolynvs added help wanted Good for someone who has contributed before pep003-advanced-dependencies Implementation of the Advanced Dependencies proposal labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Good for someone who has contributed before pep003-advanced-dependencies Implementation of the Advanced Dependencies proposal
Projects
No open projects
Status: No status
Development

No branches or pull requests

1 participant