GithubHelp home page GithubHelp logo

mvrachev / repository-service-tuf-worker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from repository-service-tuf/repository-service-tuf-worker

0.0 0.0 0.0 5.18 MB

Repository Service for TUF: Worker

License: MIT License

Shell 0.21% Python 98.69% Makefile 0.65% Dockerfile 0.31% Mako 0.13%

repository-service-tuf-worker's Introduction

Repository Service for TUF Worker

Note

This service is in Experimental stage.

OpenSSF Scorecard Test Docker Image build Tests and Lint Coverage

Repository Service for TUF Worker is part of Repository Service for TUF.

Usage

Repository Service for TUF Repository Worker Docker Image documentation

Development

Requirements

  • Python >=3.10
  • pip
  • Pipenv
  • Docker

Getting source code

Fork the repository on GitHub and clone it to your local machine:

git clone [email protected]:YOUR-USERNAME/repository-service-tuf-worker.git

Add a remote and regularly sync to make sure you stay up-to-date with our repository:

git remote add upstream https://github.com/repository-service-tuf/repository-service-tuf-worker
git checkout main
git fetch upstream
git merge upstream/main

Installing project requirements

This repository has the requirements.txt and the requirements-dev.txt files to help build your virtual environment.

We also recommend using Pipenv to manage your virtual environment.

$ pip install pipenv
$ pipenv shell

Install development requirements

$ pipenv install -d

Note

MacOS running on Macbooks M1

For developers, after above command, run

$ pip uninstall cryptography cffi -y
$ pip cache purge
$ LDFLAGS=-L$(brew --prefix libffi)/lib CFLAGS=-I$(brew --prefix libffi)/include pip install cffi cryptography

Running checks with pre-commit:

The pre-commit tool is installed as part of the development requirements.

To automatically run checks before you commit your changes you should run:

$ make precommit

This will install the git hook scripts for the first time and run the pre-commit tool. Now pre-commit will run automatically on git commit.

Running the development Worker locally

Note

All code changes will reload the Worker container automatically.

$ make run-dev

A specific docker compose can be used giving the parameter DC=<name> For example: docker-compose-redis.yml use DC=redis

$ make run-dev DC=redis

See Makefile for more options

Tests

Unit tests

We use Tox to manage running the tests.

Running tests

$ tox

You can run specific test from tox.ini using -e

$ tox -e test

Functional tests

  1. Make sure you have a development environment running (make run-dev)
  2. Run the FT tests make ft-das-local or make ft-signed-local

Managing requirements

Installing new requirements

Project requirements

$ pipenv install {package}

Development requirements

$ pipenv install -d {package}

Updating requirements files from Pipenv

$ make requirements

Managing Database migrations

It is required when changing the RSTUF Worker Database Models repository_service_tuf_worker/models/

Updating the models requires a database migrations with Alembic.

Use a clear update message with M="Added field XYZ for Targets"

$ make db-migration M="update message"

repository-service-tuf-worker's People

Contributors

breakingpitt avatar dependabot[bot] avatar enyinna1234 avatar fsavoia avatar github-actions[bot] avatar juniorlpa avatar kairoaraujo avatar kapsalis avatar kauth avatar lukpueh avatar mvrachev avatar rdimitrov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.