Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ name: Require at least one approval

on:
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
pull_request_review:
types: [submitted, edited, dismissed]
types: [opened, reopened, ready_for_review, synchronize, edited]

jobs:
check-approval:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ take up to 60 seconds once the docker build finishes.
- [Docker Commands](docs/docker.md).
- [ESLint Strategy](docs/eslint.md).
- [Git Conventions](docs/git-convention.md).
- [i18n](docs/i18n.md).
- [NGXS Conventions](docs/ngxs.md).
- [Testing Strategy](docs/testing.md).

Expand Down
11 changes: 6 additions & 5 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ module.exports = {
2,
'always',
[
'chore', // Build process, CI/CD, dependencies
'docs', // Documentation update
'feat', // New feature
'fix', // Bug fix
'docs', // Documentation update
'style', // Code style (formatting, missing semicolons, etc.)
'refactor', // Code refactoring (no feature changes)
'lang', // All updates related to i18n changes
'perf', // Performance improvements
'test', // Adding tests
'chore', // Build process, CI/CD, dependencies
'refactor', // Code refactoring (no feature changes)
'revert', // Reverting changes
'style', // Code style (formatting, missing semicolons, etc.)
'test', // Adding tests
],
],
'scope-empty': [2, 'never'], // Scope must always be present
Expand Down
13 changes: 13 additions & 0 deletions docs/admin.knowledge-base.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# Admin Knowledge Base

## Index

- [Overview](#overview)
- [All things GitHub](#all-things-github)

---

## Overview

Information on updates that require admin permissions

---

## All things GitHub

### GitHub pipeline
Expand All @@ -16,6 +27,8 @@ The `.github` folder contains the following:
.github/workflows
4. The GitHub PR templates
.github/pull_request_template.md
5. The backup json for the settings/rules
.github/rules

### Local pipeline

Expand Down
Binary file modified docs/assets/osf-ngxs-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/commit.template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 📝 Enabling the Shared Commit Template

## Overview

This project includes a Git commit message template stored at:

```
Expand Down
15 changes: 15 additions & 0 deletions docs/compodoc.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Angular Documentation with Compodoc

## Index

- [Overview](#overview)
- [How to Generate Documentation](#how-to-generate-documentation)
- [Documentation Coverage Requirements](#documentation-coverage-requirements)
- [Pre-commit Enforcement via Husky](#pre-commit-enforcement-via-husky)
- [CI/CD Enforcement](#cicd-enforcement)
- [Tips for Passing Coverage](#tips-for-passing-coverage)
- [Output Directory](#output-directory)
- [Need Help?](#need-help)

---

## Overview

This project uses [Compodoc](https://compodoc.app/) to generate and enforce documentation for all Angular code. Documentation is mandatory and must meet a **100% coverage threshold** to ensure consistent API clarity across the codebase.

---
Expand Down
14 changes: 14 additions & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Docker

## Index

- [Overview](#overview)
- [Docker Commands](#docker-commands)
- [Troubleshooting](#troubleshooting)

---

## Overview

The OSF angular project uses a docker image to simplify the developer process.

### Volumes
Expand Down Expand Up @@ -33,6 +43,8 @@ If you don’t see the site, ensure the start script includes:
"start": "ng serve --host 0.0.0.0 --port 4200 --poll 2000"
```

---

## Docker Commands

### build + run in background (build is only required for the initial install or npm updates)
Expand Down Expand Up @@ -105,6 +117,8 @@ docker rmi <image_name>:<tag>
docker rmi -f <IMAGE_ID>
```

---

## Troubleshooting

If the application does not open in your browser at [http://localhost:4200](http://localhost:4200), follow these steps in order:
Expand Down
11 changes: 11 additions & 0 deletions docs/eslint.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Linting Strategy – OSF Angular

## Index

- [Overview](#overview)
- [Linting Commands](#linting-commands)
- [ESLint Config Structure](#eslint-config-structure)
- [Pre-Commit Hook](#pre-commit-hook)
- [Summary](#summary)

---

## Overview
Expand All @@ -12,6 +20,9 @@ This project uses a **unified, modern ESLint flat config** approach to enforce c

It also integrates into the **Git workflow** via `pre-commit` hooks to ensure clean, compliant code before every commit.

**IMPORTANT**
The OSF application must meet full accessibility (a11y) compliance to ensure equitable access for users of all abilities, in alignment with our commitment to inclusivity and funding obligations.

---

## Linting Commands
Expand Down
72 changes: 48 additions & 24 deletions docs/git-convention.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# CommitLint and Git Branch Naming Convention (Aligned with Angular Guideline)

## Index

- [Overview](#overview)
- [Local pipeline](#local-pipeline)
- [Contributing Workflow](#contributing-workflow)
- [Commitlint](#commitlint)
- [Branch Naming Format](#branch-naming-format)

---

## Overview

To maintain a clean, structured commit history and optimize team collaboration, we adhere to the Angular Conventional Commits standard for both commit messages and Git branch naming. This ensures every change type is immediately recognizable and supports automation for changelog generation, semantic versioning, and streamlined release processes.

In addition, we enforce these standards using CommitLint, ensuring that all commit messages conform to the defined rules before they are accepted into the repository.

This project employs both GitHub Actions and a local pre-commit pipeline to validate commit messages, enforce branch naming conventions, and maintain repository integrity throughout the development workflow.

---

## Local pipeline

The local pipeline is managed via husky
Expand All @@ -16,6 +30,8 @@ The local pipeline is managed via husky
- All tests pass
- Test coverage is met

---

## Contributing Workflow

To contribute to this repository, follow these steps:
Expand Down Expand Up @@ -69,6 +85,8 @@ This workflow ensures that:

For a step-by-step guide on forking and creating pull requests, see [GitHub’s documentation on forks](https://docs.github.com/en/get-started/quickstart/fork-a-repo) and [about pull requests](https://docs.github.com/en/pull-requests).

---

## Commitlint

OSF uses [Commitlint](https://www.npmjs.com/package/commitlint) to **enforce a consistent commit message format**.
Expand Down Expand Up @@ -103,35 +121,37 @@ Commit messages must be structured as:

| Type | Description |
| ------------ | ------------------------------------------------------------------------------------- |
| **chore** | Changes to the build process, CI/CD pipeline, or dependencies. |
| **docs** | Documentation-only changes (e.g., README, comments). |
| **feat** | New feature added to the codebase. |
| **fix** | Bug fix for an existing issue. |
| **docs** | Documentation-only changes (e.g., README, comments). |
| **style** | Changes that do not affect code meaning (formatting, whitespace, missing semicolons). |
| **refactor** | Code restructuring without changing external behavior. |
| **lang** | Any updates to the i18n files in src/asssets/i18n/en.json. |
| **perf** | Code changes that improve performance. |
| **test** | Adding or updating tests. |
| **chore** | Changes to the build process, CI/CD pipeline, or dependencies. |
| **refactor** | Code restructuring without changing external behavior. |
| **revert** | Reverts a previous commit. |
| **style** | Changes that do not affect code meaning (formatting, whitespace, missing semicolons). |
| **test** | Adding or updating tests. |

---

### **Examples**

**Good Examples**
**Good Examples**

```
chore(deps): update Angular to v19
docs(readme): add setup instructions for Windows
feat(auth): add OAuth2 login support
fix(user-profile): resolve avatar upload failure on Safari
docs(readme): add setup instructions for Windows
style(header): reformat nav menu CSS
refactor(api): simplify data fetching logic
lang(eng-4898): added new strings for preprint page
perf(search): reduce API response time by caching results
test(auth): add tests for password reset flow
chore(deps): update Angular to v19
refactor(api): simplify data fetching logic
revert: revert “feat(auth): add OAuth2 login support”
style(header): reformat nav menu CSS
test(auth): add tests for password reset flow
```

**Bad Examples**
**Bad Examples**

```
fixed bug in login
Expand All @@ -156,10 +176,10 @@ update stuff
Refs #456
```

---

Commitlint will run automatically and reject non-compliant messages.

---

## Branch Naming Format

### The branch name should follow the format:
Expand All @@ -175,10 +195,14 @@ short-description – a brief description of the change.

```

---

## Available Types (type)

See the [Allowed Commit Types](#allowed-commit-types) section for details.

---

## Branch Naming Examples

### Here are some examples of branch names:
Expand All @@ -192,7 +216,7 @@ See the [Allowed Commit Types](#allowed-commit-types) section for details.

```

### 🛠 Example of Creating a Branch:
### Example of Creating a Branch:

To create a new branch, use the following command:

Expand All @@ -201,15 +225,15 @@ git checkout -b feat/1234-add-user-authentication

```

### 🏆 Best Practices
### Best Practices

- Use short and clear descriptions in branch names.
- Follow a consistent style across all branches for better project structure.
- Avoid redundant words, e.g., fix/1234-fix-bug (the word "fix" is redundant).
- Use kebab-case (- instead of \_ or CamelCase).
- If there is no issue ID, omit it, e.g., docs/update-contributing-guide.
- Use short and clear descriptions in branch names.
- Follow a consistent style across all branches for better project structure.
- Avoid redundant words, e.g., fix/1234-fix-bug (the word "fix" is redundant).
- Use kebab-case (- instead of \_ or CamelCase).
- If there is no issue ID, omit it, e.g., docs/update-contributing-guide.

### 🔗 Additional Resources
### Additional Resources

**Conventional Commits**: https://www.conventionalcommits.org

Expand All @@ -219,12 +243,12 @@ git checkout -b feat/1234-add-user-authentication

### This branch naming strategy ensures better traceability and improves commit history readability.

### 🔗 Additional Resources
### Additional Resources

Conventional Commits: https://www.conventionalcommits.org

Angular Commit Guidelines: https://github.com/angular/angular/blob/main/CONTRIBUTING.md

Git Flow: https://nvie.com/posts/a-successful-git-branching-model/

This branch naming and commit message strategy ensures better traceability and improves commit history readability. 🚀
This branch naming and commit message strategy ensures better traceability and improves commit history readability.
Loading