Skip to content

Latest commit

 

History

History
159 lines (109 loc) · 5.18 KB

CONTRIBUTING.md

File metadata and controls

159 lines (109 loc) · 5.18 KB

Contributing

For general contribution and community guidelines, please see the community repo. In particular, before contributing please review our contributor licensing guide to ensure your contribution is compliant with our contributor license agreements.

Table of Contents

Development

To set up a development environment follow the instructions in this section.

  1. Create a directory that will hold all the virtualenv packages and files. Note: You need to run this command once only.

macOS:

python3 -m venv venv

Windows:

py -m venv venv
  1. Enable your terminal to use the files in this directory using this command. Note: This command needs to run each time you return to your virtual environment.

macOS:

source venv/bin/activate

Windows:

venv\Scripts\activate.bat
  1. Install the requirements
pip3 install -r requirements.txt

You can now run tests and the SDK with modifiable files.

To test the SDK against a locally running Conjur Server, see Manual testing

Consuming the SDK locally

If you want to install the SDK using pip without uploading it to pypi you can run the following command from the repo source dir:

pip3 install .

Note that the SDK requires Python version >= than the one specified in the setup.cfg file under the python_requires field.

Testing

Linting

In the project, a linter is used to help enforce coding standards and provides refactoring suggestions.

./ci/test/test_linting.sh

Unit tests

To run the unit test isolated inside a container, run:

./ci/test/test_unit.sh

Integration tests

To run integration tests run:

./ci/test/test_integration -e ubuntu

This creates a Conjur environment with an Ubuntu container running the SDK's integration tests.

Manual testing

To perform manual tests, run:

./ci/test/test_integration -e ubuntu -d

This creates a Conjur environment with an Ubuntu container running in interactive mode. You can now run Python and manually test the SDK.

The connection parameters to Conjur are:

  • conjur_url = https://conjur-https
  • username = admin
  • account = dev
  • api_key = stored inside the CONJUR_AUTHN_API_KEY environment variable. You can fetch the value by running echo $CONJUR_AUTHN_API_KEY

Releases

Releases should be created by maintainers only. To create and promote a release, follow the instructions in this section.

Update the changelog and notices

NOTE: If the Changelog and NOTICES.txt are already up-to-date, skip this step and promote the desired release build from the main branch.

  1. Create a new branch for the version bump.
  2. Based on the changelog content, determine the new version number and update.
  3. Review the git log and ensure the changelog contains all relevant recent changes with references to GitHub issues or PRs, if possible.
  4. Review the changes since the last tag, and if the dependencies have changed revise the NOTICES to correctly capture the included dependencies and their licenses / copyrights.
  5. Commit these changes - Bump version to x.y.z is an acceptable commit message - and open a PR for review.

Release and Promote

  1. Merging into the main branch will automatically trigger a release build. If successful, this release can be promoted at a later time.
  2. Jenkins build parameters can be utilized to promote a successful release or manually trigger aditional releases as needed.
  3. Reference the internal automated release doc for releasing and promoting.

Manual Verification

  1. Log into PyPIand verify that the package uploaded successfully
  2. Import the package locally by running pip install conjur-api==<version_number>, for example pip install conjur-api==0.0.5
  3. Verify git release page from the tag. Click here for assistance

Contributing workflow

  1. Fork the project
  2. Clone your fork
  3. Make local changes to your fork by editing files
  4. Commit your changes
  5. Push your local changes to the remote server
  6. Create new Pull Request

From here your pull request will be reviewed and once you've responded to all feedback it will be merged into the project. Congratulations, you're a contributor!