Merge pull request #266 from GRA0007/docs/issue-templates

Issue templates and contributing guide
This commit is contained in:
Benji Grant 2023-06-11 15:17:15 +10:00 committed by GitHub
commit 80dba79006
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 225 additions and 113 deletions

View file

@ -1,38 +0,0 @@
---
name: "\U0001F41E Bug report"
about: Report an issue
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View file

@ -1,20 +0,0 @@
---
name: "\U0001F31F Feature request"
about: Suggest an idea
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

41
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Bug report
description: Report an issue on Crab Fit
labels:
- bug
body:
- type: markdown
attributes:
value: Check to make sure someone hasn't already opened a similar [issue](https://github.com/GRA0007/crab.fit/issues).
- type: textarea
attributes:
label: Description of the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: To reproduce
description: Steps to reproduce the behavior
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: false
- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Additional information
description: Add any other context including screenshots and device information where applicable here.
validations:
required: false

4
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1,4 @@
contact_links:
- name: Crab Fit wiki
url: https://github.com/GRA0007/crab.fit/wiki
about: Check the wiki if you're asking a question to make sure it hasn't already been answered.

View file

@ -0,0 +1,29 @@
name: Feature request
description: Suggest an idea for Crab Fit
labels:
- enhancement
body:
- type: markdown
attributes:
value: Check to make sure someone hasn't already opened a similar [issue](https://github.com/GRA0007/crab.fit/issues).
- type: textarea
attributes:
label: Proposed feature or solution
description: A clear and concise description of what you want to happen and why.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: Give a clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Additional information
description: Add any other context or screenshots about the feature request here.
validations:
required: false

8
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,8 @@
<!--
Thanks for taking the time to create a pull request on Crab Fit!
If you haven't already, please make sure you read the wiki page on pull requests before submitting this one: https://github.com/GRA0007/crab.fit/wiki/Pull-Requests
Don't forget to mention the issue this PR will close, e.g. Closes #123
If applicable, please also attach screenshots to this PR
-->

View file

@ -3,8 +3,14 @@ name: API Checks
on:
pull_request:
paths:
- api/**
- .github/workflows/check_api.yml
- api/**
- .github/workflows/check_api.yml
push:
branches:
- main
paths:
- api/**
- .github/workflows/check_api.yml
# Fail on warnings
env:
@ -19,5 +25,5 @@ jobs:
working-directory: api
steps:
- uses: actions/checkout@v3
- run: cargo clippy
- uses: actions/checkout@v3
- run: cargo clippy

View file

@ -3,9 +3,16 @@ name: Frontend Checks
on:
pull_request:
paths:
- frontend/**
- .github/workflows/check_frontend.yml
- '!frontend/src/i18n/locales/**'
- frontend/**
- .github/workflows/check_frontend.yml
- '!frontend/src/i18n/locales/**'
push:
branches:
- main
paths:
- frontend/**
- .github/workflows/check_frontend.yml
- '!frontend/src/i18n/locales/**'
jobs:
lint:
@ -16,14 +23,14 @@ jobs:
working-directory: frontend
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
- run: yarn install --immutable
- run: yarn lint --max-warnings 0
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
- run: yarn install --immutable
- run: yarn lint --max-warnings 0
typecheck:
runs-on: ubuntu-latest
@ -33,11 +40,11 @@ jobs:
working-directory: frontend
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
- run: yarn install --immutable
- run: yarn tsc
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
- run: yarn install --immutable
- run: yarn tsc

View file

@ -3,10 +3,10 @@ name: Deploy API
on:
push:
branches:
- main
- main
paths:
- api/**
- .github/workflows/deploy_api.yml
- api/**
- .github/workflows/deploy_api.yml
jobs:
build-and-push:
@ -21,8 +21,8 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

View file

@ -3,10 +3,10 @@ name: Deploy Frontend
on:
push:
branches:
- main
- main
paths:
- frontend/**
- .github/workflows/deploy_frontend.yml
- frontend/**
- .github/workflows/deploy_frontend.yml
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
@ -22,17 +22,17 @@ jobs:
working-directory: frontend
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

77
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,77 @@
# Contributing to Crab Fit
## Creating Issues
If you find any bugs or have a feature request, please [create an issue](https://github.com/GRA0007/crab.fit/issues/new/choose).
## Translating
If you speak a language other than English and you want to help translate Crab Fit, visit [Crab Fit on Transifex](https://explore.transifex.com/crab-fit/crab-fit/) and click "Join this project".
For more information on how to translate, visit the [translating wiki page](https://github.com/GRA0007/crab.fit/wiki/Translating).
## Local Development
This is a guide on getting Crab Fit working locally for development purposes. You should first follow this if you're thinking of making a [pull request](#pull-requests).
Note: if you'd like to get Crab Fit running because you want to have your own instance, please instead follow the [self-hosting](https://github.com/GRA0007/crab.fit/wiki/Self%E2%80%90hosting) guide.
### Software
Crab Fit is written using Rust (for the API) and Next.js (for the frontend). Before you begin, you'll need to make sure you have the required software installed:
| Software | Installation instructions |
| --- | --- |
| git | You'll need git to clone the repository. You likely already have it if you're on MacOS, otherwise see the [git site](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). |
| node | I recommend using `nvm` or `fnm` to manage multiple node versions, but you can also install directly from the [node.js website](https://nodejs.org/en/download). |
| yarn | Node comes with `npm`, which you can use to run `npm install --global yarn` to install yarn. |
| rust | You can install rust by following the directions on the [rust website](https://www.rust-lang.org/tools/install). |
### Setup
1. Clone the repository.
2. Run `cargo run` in the `api` folder to build and start the API.
3. Run `yarn` in `frontend` folder to install dependencies, then `yarn dev` to start the dev server.
By default, the API will start at http://localhost:3000, and the frontend will be available at http://localhost:1234.
#### Code Documentation
For code-specific documentation, please see the README files in the repo.
### Browser Extension
The Crab Fit browser extension is currently an iFrame that points to `/create` on the frontend. To test, edit the `popup.html` file's iframe src to be `http://localhost:1234/create`, then view that in your browser.
Note that you can't just visit the url directly, as it will redirect to the full create form if not running within an iFrame.
## Pull Requests
Before starting a pull request, first check if there's an issue open that your pull request will resolve. If there isn't, please create one to give the community a chance to comment, and also to prevent others from working on similar pull requests that will conflict with yours.
Mention the issue you are closing at the top of your PR like so:
```
Closes #123
[describe your PR...]
```
## Git Branch Conventions
`main`
Production branch. Do not commit directly to this branch.
`feat/*`
Prefix new feature branches with feat. When complete, submit a PR into main.
`fix/*`
When fixing a bug, prefix branches with fix. When complete, submit a PR into main.
`refactor/*`
For refactoring code. When complete, submit a PR into main.
`chore/*`
For chores like adding type checking, setting up CI, fixing typos etc. When finished, submit a PR into main.
`docs/*`
Used when updating documentation such as README files. When finished, submit a PR into main.

View file

@ -4,11 +4,11 @@
[![API Checks](https://github.com/GRA0007/crab.fit/actions/workflows/check_api.yml/badge.svg)](https://github.com/GRA0007/crab.fit/actions/workflows/check_api.yml)
Align your schedules to find the perfect time that works for everyone.
Licensed under the GNU GPLv3.
Open-source and licensed under the [GNU GPLv3](./LICENSE).
### ⭐️ Bugs or feature requests
If you find any bugs or have a feature request, please create an issue by <a href="https://github.com/GRA0007/crab.fit/issues/new/choose">clicking here</a>.
If you find any bugs or have a feature request, please [create an issue](https://github.com/GRA0007/crab.fit/issues/new/choose).
### 🌐 Translations
@ -20,12 +20,10 @@ For more information on how to translate, visit the [translating wiki page](http
---
## Self-hosting
### Self-hosting
Crab Fit is fully open-source, and you can get your own version running by following the [self-hosting guide](https://github.com/GRA0007/crab.fit/wiki/Self%E2%80%90hosting).
## Contributing
### Contributing
Visit the wiki page for [local development](https://github.com/GRA0007/crab.fit/wiki/Local-Development) to get Crab Fit running locally.
Want to contribute to a pull request? Make sure you read the wiki page on [pull requests](https://github.com/GRA0007/crab.fit/wiki/Pull-Requests) first.
Visit the [contributing guide](./CONTRIBUTING.md) for info on running locally and submitting pull requests.