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​
- Git
- Python 3.9+ (3.10 is recommended)
- ArangoDB 3.8.4+
- GNU Compiler Collection (GCC) (depending on the host system, Python dependencies may need to be compiled from source)
- Rust Compiler (depending on the host system, Python dependencies may need to be compiled from source)
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​
-
Fork the repository.
-
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. -
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
-
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.
-
Run the provided script to configure the virtual environment:
./setup_venv.sh --dev --path .
-
Activate the virtual environment:
- Linux/macOS
- Windows
source venv/bin/activate
venv\Scripts\activate.bat
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 &
.
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.
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:
- Core
- Shell
- Worker
- Metrics
cd fixcore
python -m fixcore
cd fixshell
python -m fixshell
cd fixworker
python -m fixworker
cd fixmetrics
python -m fixmetrics
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?
-
Commit them to your local repository:
git commit
-
Push them to your fork:
git push --set-upstream origin <branch_name>
-
Submit your pull request on GitHub.
You are welcome to open your pull request as a draft for early feedback and review.
noteBe sure to follow the pull request template!
infoPull request titles should follow the following format for correct parsing by the changelog generator script:
[<scope>][<type>] <description>
Placeholder Description <scope>
Affected/target component <type>
fix
,feat
, orchore
<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.