5.4 KiB
Contribution Guidelines
This document aims to outline the requirements for the various forms of contribution for this project.
Project Architecture
Pull Requests
ALL contributions are subject to review via pull request
Pull Requests
- Ensure the "base repository" is set to "ansible/product-demos".
Pull Request Guidelines
- PRs should include the playbook/demo and required entry in corresponding
<demo>/setup.yml. - PRs should include documentation in corresponding
<demo>/README.md. - PRs should be rebased against the
mainbranch to avoid conflicts. - PRs should not impact more than a single directory/demo section.
- PRs should not rely on external infrastructure or configuration unless the dependency is automated or specified in the
user_messageofsetup.yml.
Adding a New Demo
- Create a new branch based on main. (eg.
git checkout -b <branch name>) - Add your playbook to the appropriate demo/section subdirectory.
- Make any changes needed to match the existing standards in the directory.
- Ex: Parameterized hosts
hosts: "{{ _hosts | default('windows') }}" - Create an entry for your playbook in your subdirectories
setup.yml- You can copy paste an existing one and edit it.
- Ensure you edit the name, playbook path, survey etc.
- Add any needed roles/collections to the requirements.yml
- Test via demo.redhat.com, specify your branch name within the project configuration.
NOTE: demo.redhat.com is available to Red Hat Associates and Partners with a valid account.
New Demo Section/Category
- Create a new subdirectory with no spaces
- Create a new setup.yml copying appropriate elements from another
- Below is a sample skeleton for a new setup.yml
--- user_message: '' controller_components: - job_templates controller_templates: ...controller_componentscan be any of the roles defined here- Add variables for each component listed
- Include a README.md in the subdirectory
Testing
We utilize pre-commit to handle Git hooks, initiating a pre-commit check with each commit, both locally and on CI.
To install pre-commit, use the following commands:
pip install pre-commit
pre-commit install
For further details, refer to the pre-commit installation documentation.
To execute ansible-lint (whether within pre-commit or independently), you must configure an environment variable for the token required to connect to Automation Hub. Obtain the token here.
Copy the token value and execute the following command:
export ANSIBLE_GALAXY_SERVER_AH_TOKEN=<token>
Release Process
We follow a structured release process for this project. Here are the steps involved:
-
Create a Release Branch:
- Start by creating a new release branch from the
mainbranch.
git checkout -b release/v-<version> - Start by creating a new release branch from the
-
Update Changelog:
-
Open the
CHANGELOG.mdfile to manually add your change to the appropriate section. -
Our changelog follows the Keep a Changelog format and includes the following categories of changes:
Addedfor new features.Changedfor changes in existing functionality.Deprecatedfor features that will be removed in upcoming releases.Fixedfor bug fixes.Removedfor deprecated features that were removed.Securityfor security-related changes.
-
Add a new entry under the relevant category. Include a brief summary of the change and the merge request commit tag.
## [Unreleased] ### Added - New feature or enhancement ([Merge Request Commit](https://github.com/ansible/product-demos/-/commit/<commit-hash>)) -
Replace
<commit-hash>with the actual commit hash from the merge request.
-
-
Commit Changes:
- Commit the changes made to the
CHANGELOG.mdfile.
git add CHANGELOG.md git commit -m "Update CHANGELOG for release <version>" - Commit the changes made to the
-
Create a Pull Request:
- Open a pull request from the release branch to the
mainbranch.
- Open a pull request from the release branch to the
-
Review and Merge:
- Review the pull request and merge it into the
mainbranch.
- Review the pull request and merge it into the
-
Tag the Release:
- Once the pull request is merged, tag the release with the version number.
git tag -a v-<version> -m "Release <version>" git push origin v-<version> -
Publish the Release:
-
After the successful completion of the pull request and merging into the
mainbranch, an automatic GitHub Action will be triggered to publish the release.The GitHub Action will perform the following steps:
- Parse the
CHANGELOG.mdfile. - Generate a release note based on the changes.
- Attach relevant files (such as
LICENSE,CHANGELOG.md, and the generatedCHANGELOG.txt) to the GitHub Release.
No manual intervention is required for this step; the GitHub Action will handle the release process automatically.
- Parse the
-
-
Cleanup:
- Delete the release branch.
git branch -d release/v-<version>
