Skip to content

Commit 6e66be3

Browse files
authored
[ENG-8505] Updates to continue to prepare for the addition of GFP (#278)
* feat(eng-8505): Added testing and global data for testing * chore(docs): added compodoc readme file * chore(icons): Removed the icons * refactor(pr): Removed a console.log based on the PR comments
1 parent 15599db commit 6e66be3

18 files changed

Lines changed: 2275 additions & 27 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Compiled output
44
/dist
5+
/documentation
56
/tmp
67
/out-tsc
78
/bazel-out

.husky/pre-commit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@ npx lint-staged || {
22
printf "\n\nERROR: Linting issues were found in the committed files. Please address them before proceeding.\n\n\n\n"
33
exit 1
44
}
5+
6+
npm run docs:coverage || {
7+
printf "\n\nERROR: Documentation Coverage thresholds are not met."
8+
printf "\n\nIn the future this will block your ability to commit locally until it is resolved."
9+
printf "\n\nThe same pipeline runs via GitHub actions."
10+
printf "\n\nYou are seeing this error because code was added without documentation."
11+
# exit 1
12+
}

.husky/pre-push

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# npm run build
22

33
npm run test:coverage || {
4-
printf "\n\nERROR: Testing errors or coverage issues were found."
4+
printf "\n\nERROR: Testing errors or coverage issues are found."
55
printf "\n\nIn the future this will block your ability to push to github until it is resolved."
6-
printf "\n\nThe same pipeline runs on github."
6+
printf "\n\nThe same pipeline runs via GitHub actions."
77
printf "\n\nYou are seeing this error because code was added without test coverage."
88
# printf "\n\n Please address them before proceeding.\n\n\n\n"
99
# exit 1
1010
}
1111

1212
npm run test:check-coverage-thresholds || {
13-
printf "\n\nERROR: Coverage thresholds were not met."
13+
printf "\n\nERROR: Coverage thresholds are not met."
1414
printf "\n\nIn the future this will block your ability to push to github until it is resolved."
15-
printf "\n\nThe same pipeline runs on github."
15+
printf "\n\nThe same pipeline runs via GitHub actions."
1616
printf "\n\nYou are seeing this error because test coverage increased without updating the jest.config.js thresholds."
1717
#printf "\n\nPlease address them before proceeding.\n\n\n\n"
1818
# exit 1

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ take up to 60 seconds once the docker build finishes.
1616

1717
### Recommended
1818

19-
- Install git commit template: [Commit Template](docs/commit.template.md).
19+
- Compodoc: [Compodoc Conventions](docs/compodoc.md).
2020
- Docker Commands: [Docker Commands](docs/docker.md).
2121
- Git Conventions: [Git Conventions](docs/git-convention.md).
22+
- Install git commit template: [Commit Template](docs/commit.template.md).
2223
- Volta: [Volta](#volta)
2324
- Redux DevTools: [Redux DevTools](#redux-devtools)
2425

docs/compodoc.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Angular Documentation with Compodoc
2+
3+
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.
4+
5+
---
6+
7+
## How to Generate Documentation
8+
9+
To generate and view the documentation locally:
10+
11+
```bash
12+
npm run docs
13+
```
14+
15+
This will:
16+
17+
1. Build the Compodoc documentation.
18+
2. Launch a local web server to view it (typically on [http://localhost:8080](http://localhost:8080)).
19+
20+
---
21+
22+
## Documentation Coverage Requirements
23+
24+
- **100% Compodoc coverage is required** across all services, components, models, and utilities.
25+
- All public methods, properties, and classes must be documented using proper JSDoc style comments.
26+
- Coverage checks are enforced **before every commit** and **during CI/CD** via GitHub Actions.
27+
28+
---
29+
30+
## Pre-commit Enforcement via Husky
31+
32+
Husky is configured to run a **pre-commit hook** that will:
33+
34+
- Run Compodoc.
35+
- Check coverage.
36+
- Block the commit if documentation coverage is below 100%.
37+
38+
If the hook fails, you’ll see output indicating which files or symbols are undocumented.
39+
40+
---
41+
42+
## CI/CD Enforcement
43+
44+
During pull requests and merges, GitHub Actions re-validates documentation coverage.
45+
46+
Any PR that does not meet the 100% documentation requirement will be blocked from merging until resolved.
47+
48+
---
49+
50+
## Tips for Passing Coverage
51+
52+
- Use `@Input`, `@Output`, and `@Injectable` annotations with proper descriptions.
53+
- Document every exported interface, function, method, and variable.
54+
- Use the `@example` tag for complex methods when helpful.
55+
- Apply JSDoc on constructor-injected properties using `@param`.
56+
57+
---
58+
59+
## Output Directory
60+
61+
By default, generated documentation lives in:
62+
63+
```
64+
/documentation/
65+
```
66+
67+
This folder is **not committed to the repo** and is only used locally or in build pipelines.
68+
69+
---
70+
71+
## Need Help?
72+
73+
Run the following to see detailed CLI options:
74+
75+
```bash
76+
npx compodoc --help
77+
```
78+
79+
Or visit: [https://compodoc.app](https://compodoc.app)
80+
81+
---

jest.config.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
'^@core/(.*)$': '<rootDir>/src/app/core/$1',
1010
'^@shared/(.*)$': '<rootDir>/src/app/shared/$1',
1111
'^@styles/(.*)$': '<rootDir>/assets/styles/$1',
12+
'^@testing/(.*)$': '<rootDir>/src/testing/$1',
1213
'^src/environments/environment$': '<rootDir>/src/environments/environment.ts',
1314
},
1415
transform: {
@@ -34,6 +35,8 @@ module.exports = {
3435
'!src/app/**/*.route.{ts,js}',
3536
'!src/app/**/*.enum.{ts,js}',
3637
'!src/app/**/*.type.{ts,js}',
38+
'!src/app/**/*.enum.{ts,js}',
39+
'!src/app/**/*.type.{ts,js}',
3740
'!src/app/**/*.spec.{ts,js}',
3841
'!src/app/**/*.module.ts',
3942
'!src/app/**/index.ts',
@@ -56,15 +59,24 @@ module.exports = {
5659
'<rootDir>/src/environments/',
5760
'<rootDir>/src/@types/',
5861
],
62+
watchPathIgnorePatterns: [
63+
'<rootDir>/node_modules/',
64+
'<rootDir>/dist/',
65+
'<rootDir>/coverage/',
66+
'<rootDir>/src/assets/',
67+
'<rootDir>/src/environments/',
68+
'<rootDir>/src/@types/',
69+
],
5970
testPathIgnorePatterns: [
6071
'<rootDir>/src/app/app.config.ts',
6172
'<rootDir>/src/app/app.routes.ts',
6273
'<rootDir>/src/app/features/registry/',
63-
'<rootDir>/src/app/features/my-projects/',
64-
'<rootDir>/src/app/features/project/addons',
74+
'<rootDir>/src/app/features/project/addons/components/configure-configure-addon/',
75+
'<rootDir>/src/app/features/project/addons/components/connect-configured-addon/',
76+
'<rootDir>/src/app/features/project/addons/components/disconnect-addon-modal/',
6577
'<rootDir>/src/app/features/project/analytics/',
6678
'<rootDir>/src/app/features/project/contributors/',
67-
'<rootDir>/src/app/features/files/',
79+
'<rootDir>/src/app/features/project/files/',
6880
'<rootDir>/src/app/features/project/metadata/',
6981
'<rootDir>/src/app/features/project/overview/',
7082
'<rootDir>/src/app/features/project/registrations',

0 commit comments

Comments
 (0)