Skip to main content

Component Development

Fix Inventory is comprised of multiple components, each of which is maintained as separate project in the someengineering/fixinventory GitHub repository.

Contributions are made via pull requests to the GitHub repository. Pull requests should target a single component.

Prerequisites​

note

On Apple Silicon (ARM) devices, like the M1 Macbooks, only versions of ArangoDB < 3.9 are supported. That is because ArangoDB 3.9+ is officially only available on x86 architecture and makes use of CPU instructions not emulated by MacOS' Rosetta 2.

There are unofficial ARM builds of ArangoDB, like e.g. programmador/arangodb but they have not been tested with Fix Inventory.

1. Clone the Repository​

  1. Fork the repository.

  2. Create a local clone of the repository:

    git clone https://github.com/<your_github_username>/fixinventory.git

    This will create a directory named fixinventory in your current working directory.

  3. Add a remote pointing to the upstream repository (as opposed to your fork) named upstream:

    git remote add upstream https://github.com/someengineering/fixinventory.git
  4. Create a new branch from main (it is recommended to give your branch a meaningful, descriptive name):

    git checkout -b <branch_name> main

2. Set Up a Virtual Environment​

We recommend using a Python virtual environment.

  1. Run the provided script to configure the virtual environment:

    ./setup_venv.sh --dev --path .
  2. Activate the virtual environment:

    source venv/bin/activate

3. Start the Database​

Start ArangoDB (using systemctl on Linux, by clicking the application icon in macOS, etc.). If you used Homebrew to install ArangoDB, run /usr/Cellar/arangodb/<VERSION>/sbin/arangod &.

note

Depending on the installation method, authentication may or may not be enabled on the built-in root user account. The installation process either prompted for the root password (Debian, Windows), configured a random password (Red Hat), or set the password to an empty string.

In order for fixcore to perform the required database setup and for tests to pass, authentication must be disabled or the password for root must be set to an empty string.

warning

This setup is for development only and should not be deployed in production environments.

4. Start the Components​

You can now start each of the Fix Inventory components:

cd fixcore
python -m fixcore

5. Test Your Changes​

We use the pytest framework. Prior to submitting your changes for review, please verify that all existing tests pass and add test coverage for new code.

Lint and test your code:

tox

6. Push Your Changes​

Ready to submit your changes for review?

  1. Commit them to your local repository:

    git commit
  2. Push them to your fork:

    git push --set-upstream origin <branch_name>
  3. Submit your pull request on GitHub.

    You are welcome to open your pull request as a draft for early feedback and review.

    note

    Be sure to follow the pull request template!

    info

    Pull request titles should follow the following format for correct parsing by the changelog generator script:

    [<scope>][<type>] <description>
    PlaceholderDescription
    <scope>Affected/target component
    <type>fix, feat, or chore
    <description>Description of changes

    However, do not worry too much about getting this right, as we will make any necessary adjustments prior to merging your changes.