Thank you for considering contributing to the devcontainers-extra/features repository! We appreciate your time and effort in helping us improve this project. Below are the guidelines for contributing new features to the repository.
-
Fork the Repository: Start by forking the repository.
-
Add Boilerplate: Run
just add your-feature
to add boilerplate for your feature insrc
andtest
. -
Install Feature: Modify
src/your-feature/install.sh
to install the feature. Some helpers are available for common install methods- ghcr.io/devcontainers-extra/features/gh-release for GitHub Releases
- ghcr.io/devcontainers-extra/features/pipx-package for Python packages via pipx
-
Update Metadata: In
src/your-feature/devcontainer-feature.json
- Replace
<installation-method>
with the feature's install method, likeGitHub Releases
- Provide a short description of the feature
- Provide a default version, or use the latest version
- Add the image names of any helpers to
installsAfter
- Replace
-
Add README: Add a
src/your-feature/README.md
file with information about your new feature. It may help to copy a README from an existing feature. Include usage instructions, arguments, and any relevant details. -
Update Tests: Replace
x.y.z
intest/your-feature/scenarios.json
with the latest version of the feature. Then modifytest_specific_version.sh
to check for that version, andtest.sh
to check for any version. -
Test Your Changes: Visit the Actions tab in your fork, and enable Actions. Then commit and push your changes, and ensure the tests pass.
-
Create a Pull Request: Create a pull request to the main repository. Provide a detailed description of your changes and any additional information that may be helpful for the review process.
The repository contains a justfile
with commands for testing and adding features. Here are some useful just
commands:
just test <feature-name>
: Test a specific feature.just test-scenario <feature-name> <scenario-filter>
: Test a specific feature with a scenario filter.just unarchive <feature-name>
: Unarchive a feature from thearchive
directory.just add <feature-name>
: Add a new feature using the templates in thetemplates
directory.
- Code Style: Follow the existing code style and conventions used in the repository.
- Documentation: Ensure that your feature is well-documented, including usage instructions and any relevant details.
- Testing: Thoroughly test your feature to ensure it works as expected and does not introduce any issues.
The pipx-package
helper is a convenient way to install Python packages via pipx. It simplifies the installation process and ensures that the packages are installed in isolated environments.
To use the pipx-package
helper, follow these steps:
-
Add the Helper to Your Feature: In your
devcontainer-feature.json
file, add thepipx-package
helper to theinstallsAfter
array. For example:"installsAfter": [ "ghcr.io/devcontainers-extra/features/pipx-package", "ghcr.io/devcontainers/features/python" ]
-
Modify the Install Script: In your
install.sh
script, use thepipx-package
helper to install the desired Python package. For example:$nanolayer_location \ install \ devcontainer-feature \ "ghcr.io/devcontainers-extra/features/pipx-package:1.1.9" \ --option package='your-package' --option version="$VERSION"
-
Test the Installation: Ensure that the package is installed correctly by running the appropriate tests.
Thank you for your contribution! If you have any questions or need further assistance, feel free to open an issue or reach out to the maintainers.