Skip to content

Latest commit

 

History

History
101 lines (66 loc) · 2.99 KB

CONTRIBUTING.md

File metadata and controls

101 lines (66 loc) · 2.99 KB

Contributing Guidelines

Please follow common guidelines for our projects here.

Reporting Bugs

Guidelines for Developers

Dependencies

make install-dependencies automatically installs python dependencies and pnpm. In case the pnpm installation fails, follow this guide for different installation options.

Naming Scheme

  • camelCase for variable names.
  • Indentation: 4 Spaces.
  • Regular JS functions are defined like function someFunction()
  • React components are defined using the arrow syntax.
  • React Hooks style syntax is used, wherever possible, over the old Class based syntax.

Running packit-service/dashboard locally on Docker

  1. Build docker image
make build-stg
  1. Generate private key
openssl genrsa -des3 -out secrets/privkey.pem 2048
  1. Generate Certificate Signing Request
openssl req -new -key secrets/privkey.pem -out secrets/signing-request.csr
  1. Remove Passphrase from Key
openssl rsa -in secrets/privkey.pem -out secrets/privkey.pem
  1. Generate self signed certificate
openssl x509 -req -days 365 -in secrets/signing-request.csr -signkey secrets/privkey.pem -out secrets/fullchain.pem
  1. Start dashboard container
make run-container-stg
  1. Install CA (optional)
cp secrets/fullchain.pem /usr/local/share/ca-certificates/dashboard-fullchain.crt
sudo update-ca-certificates

Increase System Limit for File Watchers

While transpiling and packing code, Vite continuously watches all dependencies for changes. It's not uncommon to encounter a system limit on the number of files you can monitor.

Increase it with

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Technical details

Using React Router and React Query

Other things to consider is our usage of React Router and React Query. If the component is making use of these in any way, such as useParams from React Router, or useQuery from React Query, we need to add those to the default export. Take CoprBuildsTable component here which has both.

Here we need to import both withRouter to allow us to use hooks from React Router, and use our own withQueryClient so that React Query doesn't freak out due to not having a React Context

import React from "react";
import { CoprBuildsTable } from "./CoprBuildsTable";

export default {
  title: "CoprBuildsTable",
  component: CoprBuildsTable,
};

Thank you for your interest!