We welcome contributions from the community and first want to thank you for taking the time to contribute!
Before starting, please take some time to familiarize yourself with the Code of Conduct.
We welcome many different types of contributions and not all of them need a Pull Request. Contributions may include:
- New features and proposals
- Documentation
- Bug fixes
- Issue Triage
- Answering questions and giving feedback
- Helping to onboard new contributors
- Other related activities
Some tools are required on your system in order to help you with the development process:
-
Git: Archivista is hosted on GitHub, so you will need to have Git installed. For more information, please follow this guide.
-
GNU Make: The root of the directory contains a
Makefile
for automating development processes. Themake
CLI tool is usually installed by default on most systems (excluding Windows), but you can check if it is installed by runningmake --version
on your terminal. If this command is unsuccessful, you will need to find the standard method for installing it for your system. For installingmake
on Windows, please see here. -
Go v1.19: Archivista is written in Go, so you will need this installed in order to compile and run the source code.
-
pre-commit: It is a framework for managing and maintaining multi-language pre-commit hooks. It is used to run some checks on the code before it is committed. You can install it by following the instructions here.
-
jq: It is a lightweight and flexible command-line JSON processor. It is used to parse JSON files. You can install it by following the instructions here.
-
A Container Runtime: Archivista is a container-based tool, and therefore you might need a container runtime tool installed for development. The most common solution for this is Docker, however this is not free on all platforms. If you are using MacOS, Colima is a free good alternative, as well as Rancher Desktop. Please note that Archivista is not tested on these alternative tools, so compatibility is not guaranteed.
Fork the repository on GitHub and clone it to your local machine:
git clone [email protected]:YOUR-USERNAME/archivista.git
The command above uses SSH to clone the repository, which we recommend. You can find out more about how to set SSH up with Github here.
Add a remote and regularly sync to make sure you stay up-to-date with our repository:
git remote add upstream https://github.com/in-toto/archivista.git
git checkout main
git fetch upstream
git merge upstream/main
Please note that the following make
commands make use of both the docker
and
docker compose
commands, so you may need to modify this locally if using tools
such as nerdctl or podman.
To start the Archivista development environment, simply execute the command:
make run-dev
This will run the Archivista container and its required dependent services. Archivista will be available at http://localhost:8082
Any changes made to the source code will be reflected in the development environment while it is running, so there is no need to restart it.
To stop the development environment, run:
make stop
To clean all Archivista containers in your environment execute the command:
make clean
If there are changes in the SQL Schema you must to create the database migration. To do this, you must run the following command:
make db-migrations
You can run all the tests by executing the command:
make test