Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BimleshRB committed Mar 20, 2024
0 parents commit 39f68fd
Show file tree
Hide file tree
Showing 16 changed files with 1,957 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/Contributor_Guide/Contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Contribute to <Project_Name>

Thank you for taking the time to contribute to <project_name>! We really appreciate it.

Before contributing, please make sure to read the [Code of Conduct](../../CODE_OF_CONDUCT.md). We expect you to follow it in all your interactions with the project.

## New to <Project_Name>?

If you are new to <Project_Name>, please take a look at the [documentation](./Project_Tour.md). It is a great place to start.

## New Contributor Guide

To get an overview of the codebase, check out the '[README.md](../src/README.md)' file in the `src` directory.

that will help you understand the structure of the project.

## How to Contribute

### Reporting Bugs

If you find a bug in the source code, you can help us by [submitting an issue](../ISSUE_TEMPLATE/bug_report.yaml).

### Suggesting Enhancements

If you want to suggest an enhancement to <Project_Name>, please [submit an issue](../ISSUE_TEMPLATE/feature_request.yaml).

### Pull Requests

If you want to contribute to <Project_Name>, submit a pull request.

- url: `https://github.com/OPCODE-Open-Spring-Fest/<project_Name>/compare/branch...YOURGITHUBUSERNAME:<project_Name>:BRANCH?quick_pull=1&template=pr.md`

### Requirements


### Setup

12 changes: 12 additions & 0 deletions .github/Contributor_Guide/Project_Tour.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Project Tour

* notes:
* > Discuss about your project file structure
* > what each folder is responsible
* > then go through each file in folders and explain there purpose
* > if possible create a doc system ( there are autogen docs available for most of the languages )
* > decide coding style , linting style and formatting style and other themes like variable naming etc.
* > provide an example for existing function and tests system if possible
*

# MAKE SURE PROJECT MANAGERS UPDATE THIS MD
73 changes: 73 additions & 0 deletions .github/Contributor_Guide/commiting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Commiting Guidelines

## Commit Structure

- **Make Commits Atomic**: Each commit should represent a single logical change. Avoid mixing multiple changes in a single commit. If a change affects multiple files, ensure it constitutes one "logical" change.

### Writing Commit Messages

- **Clear Subject Line**: Start the commit message with a clear and concise description of the change. It should be no more than 50 characters, start with a capital letter, and be in imperative mood.

- > ```bash
> feat: Add function to calculate average
> ```
- **Separate Subject from Body**: If further explanation is needed, include it in the body of the commit message, following a blank line after the subject line.
- **Explain the Change**: The body of the commit message should explain why the change was needed and how it was implemented. Keep it wrapped to 72 characters and written in present tense.
- > ```bash
> fix: Resolve issue with login form not submitting on Safari
>
> This commit fixes a bug where the login form was not submitting on Safari browsers. The issue was caused by an outdated event listener binding, which has been updated to the correct syntax.
> ```
- **Avoid "How" Details**: Use the commit message to explain what changes were made and why, not how they were made. Well-written code should be self-explanatory.
- **Reference Issues or Pull Requests**: If the commit is related to an issue or a pull request, include the reference in the commit message. This can be done in the body of the message or at the end.
- > ```bash
> feat: Add user authentication feature
>
> Closes #123
> ```
- **Avoid Unnecessary Punctuation**: Do not end the subject line with a period.
### Commit Message Structure Rules
- **Type Enum**: Ensure your commit type matches one of the predefined values: `build`, `chore`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `style`, `test`.
- `build`: This type is used for changes related to build processes or tools. It includes modifications to build scripts, configuration files, and build-related dependencies.
- `chore`: Chore changes typically involve tasks related to maintenance or housekeeping. This could include updating dependencies, cleaning up code, or configuring development tools.
- `ci`: Changes related to Continuous Integration (CI) configuration files and scripts fall under this type. It includes modifications to CI pipelines, configurations for automated testing, and integration with CI services.
- `docs`: Documentation changes belong to this type. It covers updates to documentation files, such as READMEs, API documentation, or inline code comments.
- `feat`: This type is for new feature implementations or enhancements to existing features. It signifies significant additions or improvements to the codebase's functionality.
- `fix`: Use this type for bug fixes or patches. It indicates changes made to address issues or bugs in the codebase.
- `perf`: Performance-related changes are categorized under this type. It includes optimizations aimed at improving the codebase's performance, such as reducing execution time or memory usage.
- `refactor`: Refactoring changes fall under this type. It involves restructuring or cleaning up the code without changing its external behavior. Refactoring aims to improve code quality, maintainability, or readability.
- `revert`: Reverting changes made in a previous commit is indicated by this type. It's used when undoing the effects of a specific commit, often to address unexpected issues or regressions introduced by the previous change.
- `style`: Style-related changes belong to this type. It covers modifications to code style, formatting, or whitespace, without affecting the code's functionality.
- `test`: Test-related changes are categorized under this type. It includes additions or modifications to test cases, test suites, or testing infrastructure to ensure code correctness and reliability.
- **Type Case**: Use lowercase for commit types.
- **Subject Not Empty**: The subject line should not be empty.
- **Subject Case**: Use sentence case for the subject line.
- **Subject Length**: Keep the subject line under 100 characters.
- **Body Leading Blank**: Ensure there's a leading blank line in the commit body.
- **Body Max Line Length**: Keep each line in the commit body under 100 characters.
75 changes: 75 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["Issue:bug"]
assignees:
- <project_manager>
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: Description
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "Describe the issue happened"
validations:
required: true
- type: textarea
id: error-message
attributes:
label: Error message
description: If applicable, please provide the error message you received.
placeholder: Copy and paste the error message here
validations:
required: false
- type: dropdown
id: severity
attributes:
label: Severity
description: How severe is the bug?
options:
- Low
- Medium
- High
- Critical
- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: Please provide detailed steps for reproducing the issue.
placeholder: Tell us how to reproduce the issue
value: "1. 2. 3."
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: Please provide details about your environment.
placeholder: Tell us about your environment
value: "OS: \nBrowser: \nVersion: \nLanguage:..."
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
placeholder: Drag and drop your screenshots here

- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](../Code_of_Conduct.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Feature Request
description: Request a feature or suggest us what is in your mind!
title: "[Feature]: "
labels: "Issue:feature"
assignees:
- <project manager>
body:
- type: markdown
attributes:
value: |
Please explain what is in your mind, we would like to hear it from you! 🤠
- type: textarea
id: explaining
attributes:
label: So, what is it about?
description: Please describe what you're requesting for. So, we Akarui Team can understand your request better and work on it faster!
placeholder: It's about...
validations:
required: true

- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OPCODE-Open-Spring-Fest/template/blob/main/.github/Contributor_Guide/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

## Description

> Give a brief description of the pull request.
## Semver Changes

- [ ] Patch (bug fix, no new features)
- [ ] Minor (new features, no breaking changes)
- [ ] Major (breaking changes)

## Issues

> List any issues that this pull request closes.
## Checklist

- [ ] I have read the [Contributing Guidelines](../Contributor_Guide/Contruting.md).

36 changes: 36 additions & 0 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on: [push, pull_request]

jobs:
commitlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install required dependencies
run: |
sudo apt update
sudo apt install -y sudo
sudo apt install -y git curl
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs
- name: Print versions
run: |
git --version
node --version
npm --version
npx commitlint --version
- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
32 changes: 32 additions & 0 deletions .github/workflows/prmerged.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: On Pull Request Merge

on:
pull_request:
types: [closed]

jobs:

on-merge:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == true }}
steps:
- name: Get Pull Request Data
id: get-pr-data
env:
PULL_REQUEST_OWNER: ${{ github.event.pull_request.user.login }}
PULL_REQUEST_LABELS: ${{ join(github.event.pull_request.labels.*.name, ', ') }}
REPOSITORY_NAME: ${{ github.event.repository.name }}
REPOSITORY_URL: ${{ github.event.repository.html_url }}
run: |
echo "::set-output name=owner::$PULL_REQUEST_OWNER"
echo "::set-output name=labels::$PULL_REQUEST_LABELS"
echo "::set-output name=repo_name::$REPOSITORY_NAME"
echo "::set-output name=repo_url::$REPOSITORY_URL"
- name: Send Data to API
env:
API_URL: https://osf-api.onrender.com/api/prmerged
API_AUTH_TOKEN: ${{ secrets.API_AUTH_TOKEN }}
run: |
payload=$(echo '{"owner":"${{ steps.get-pr-data.outputs.owner }}","labels":"${{ steps.get-pr-data.outputs.labels }}","repository_name":"${{ steps.get-pr-data.outputs.repo_name }}","repository_url":"${{ steps.get-pr-data.outputs.repo_url }}"}')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $API_AUTH_TOKEN" -d "$payload" "$API_URL"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run commitlint ${1}
Empty file added .husky/pre-commit
Empty file.
Loading

0 comments on commit 39f68fd

Please sign in to comment.