Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
8719972
feat: add infringement count tracking and reset logic
AnthonyWeathers Jun 30, 2025
1c1410a
feat(cache): add support for clearing all LostTeamEntry_* keys dynami…
Ramaruva Aug 2, 2025
060648d
fix: Merged development into branch and resolving eslint errors in fi…
AnthonyWeathers Aug 7, 2025
4bce3e0
build: create a modal and a mock api endpoint for the filter
JuliaHa0902 Sep 9, 2025
0352d78
build: Add CRUD endpoints for weekly summmaries filter
JuliaHa0902 Sep 10, 2025
276104d
build: limit filterName to 7 characters
JuliaHa0902 Sep 17, 2025
739a156
feat(userProfile): add final day API route
humemah Sep 24, 2025
a092d0d
build: Add api endpoint replace-teamcode for filters
JuliaHa0902 Sep 25, 2025
d957053
build: change API URL to camelCase
JuliaHa0902 Sep 25, 2025
849d576
fix lint rules and write yaml job
1709abhishek Sep 25, 2025
ac786d7
fix lint rules and write yaml job
1709abhishek Sep 26, 2025
41538f1
Merge branch 'development' into abhishek_lint_test_automation
1709abhishek Sep 26, 2025
787e899
update dependecies
1709abhishek Sep 26, 2025
3190e5b
update node version
1709abhishek Sep 26, 2025
f6f4334
update node version
1709abhishek Sep 26, 2025
0c4fed6
check coverage %age
1709abhishek Sep 26, 2025
1ddfdfe
check coverage %age
1709abhishek Sep 26, 2025
9308e5f
check coverage %age
1709abhishek Sep 26, 2025
113f6e8
check coverage %age
1709abhishek Sep 26, 2025
5740d30
check coverage %age
1709abhishek Sep 26, 2025
8ed4632
check coverage %age
1709abhishek Sep 26, 2025
5789350
check coverage %age
1709abhishek Sep 26, 2025
4e5f9f5
merge development
1709abhishek Sep 26, 2025
17b1736
fail ci
1709abhishek Sep 26, 2025
79c960f
correct ci
1709abhishek Sep 26, 2025
e4b5226
build: add api endpoint to handle individual teamcode change
JuliaHa0902 Sep 30, 2025
aa50dbb
build: restrict endpoints for manage filter with permission
JuliaHa0902 Sep 30, 2025
e649d44
fix: Merge with the development branch, so the MongDB connection stri…
JuliaHa0902 Oct 2, 2025
421ed72
fix merge conflicts
1709abhishek Oct 19, 2025
5d811fb
feat(task-replication): implement replicate task endpoint
Amalesh-A Oct 23, 2025
7a86c05
build: Create route for upload file
JuliaHa0902 Oct 29, 2025
6847364
build: Add endpoint to upload student task
JuliaHa0902 Oct 31, 2025
f23fd94
build: update the fields in student task, validate file type and side
JuliaHa0902 Oct 31, 2025
19ec18a
build: handle the case of upload url only
JuliaHa0902 Oct 31, 2025
1765d91
Add backend permission 'interactWithSetFinalDayButton'
humemah Nov 1, 2025
ab10f12
feat: created intermediate tasks model and router. Registered router …
shashank-madan Nov 3, 2025
17934a0
feat: added intermediate task controller
shashank-madan Nov 4, 2025
0cd6760
fix: Corrected request body parameter naming
shashank-madan Nov 4, 2025
ac74b44
build: add backend api for material cost graph
JuliaHa0902 Nov 6, 2025
6241d18
fix: Fix error with parameter projectId
JuliaHa0902 Nov 7, 2025
32ad12a
fix mergeconflicts
1709abhishek Nov 7, 2025
38556e8
fix mergeconflicts
1709abhishek Nov 7, 2025
43f0dc9
fix linters
1709abhishek Nov 7, 2025
bdfdd2d
fix linters
1709abhishek Nov 7, 2025
a97e2d0
fix tests
1709abhishek Nov 7, 2025
f366a67
build: add unit test and integration test for material cost controlle…
JuliaHa0902 Nov 7, 2025
767425c
fix: remove integration test
JuliaHa0902 Nov 7, 2025
ea91dbe
chore: merged development
AnthonyWeathers Nov 10, 2025
324e4c2
feat(charts): Update PR Quality Distribution charts
aryanrachala54 Nov 11, 2025
960a3f0
Fix hasPermission function call and variable conflict in setFinalDay
humemah Nov 14, 2025
50632aa
fix: Merge with development
JuliaHa0902 Nov 16, 2025
82328a2
fix: trigger the push again
JuliaHa0902 Nov 16, 2025
7634eb0
fix: install optional dependancies for sharp
JuliaHa0902 Nov 16, 2025
6d95fc8
chore: merged latest development
AnthonyWeathers Nov 16, 2025
2469f25
Merge branch 'development' into Amalesh-replicate-task
Amalesh-A Nov 17, 2025
37ceb44
Merge branch 'development' into aryan_quality_distribution_charts_bac…
aryanrachala54 Nov 18, 2025
3a2dad4
fix: merge with development and resolve conflict
JuliaHa0902 Nov 19, 2025
5bcd59c
Merge pull request #1767 from OneCommunityGlobal/julia-create-special…
one-community Nov 20, 2025
b29d3ee
Merge pull request #1749 from OneCommunityGlobal/humemah-set-final-da…
one-community Nov 20, 2025
9938848
fix: total org summary page erroring out in frontend
Nov 20, 2025
ad2bc23
Merge pull request #1914 from OneCommunityGlobal/venkataramanan_fix_t…
one-community Nov 20, 2025
9d35930
Merge pull request #1899 from OneCommunityGlobal/aryan_quality_distri…
one-community Nov 20, 2025
fe668fd
chore: merged development to resolve merge conflicts
AnthonyWeathers Nov 21, 2025
35730ac
fix tests
1709abhishek Nov 22, 2025
abde240
fix tests
1709abhishek Nov 22, 2025
f95add4
fix tests
1709abhishek Nov 22, 2025
e8f7bee
Merge with development
JuliaHa0902 Nov 23, 2025
6bfed52
Merge pull request #1868 from OneCommunityGlobal/julia-create-backend…
one-community Nov 23, 2025
e7cc725
Merge pull request #1825 from OneCommunityGlobal/Amalesh-replicate-task
one-community Nov 23, 2025
e34cded
Merge pull request #1504 from OneCommunityGlobal/Anthony-fix-badges-a…
one-community Nov 23, 2025
eeedb05
fix(project_task): Project assign/delete & Task delete from User Profile
DiyaWadhwani Nov 25, 2025
811f5ca
fix: Fixed API routes for adding and marking intermediate tasks as done
shashank-madan Nov 25, 2025
cbc7126
fix(blueSquare): modified reply to - user email
DiyaWadhwani Nov 26, 2025
912c811
Merge pull request #1922 from OneCommunityGlobal/Diya_Fix_BSReplyTo
one-community Nov 26, 2025
55befed
fix: merge with development
JuliaHa0902 Nov 26, 2025
6aeda77
fix: email sorting order when adding blue square
Nov 26, 2025
5ef572b
Merge pull request #1924 from OneCommunityGlobal/venkataramanan_fix_e…
one-community Nov 27, 2025
e04265e
final merge conflict
1709abhishek Nov 27, 2025
d4dcb54
Merge pull request #1920 from OneCommunityGlobal/shashank-madan-creat…
one-community Nov 27, 2025
894f596
Merge pull request #1888 from OneCommunityGlobal/julia-create-backend…
one-community Nov 27, 2025
35a08c0
Merge pull request #1626 from OneCommunityGlobal/Ramakrishna_Fix_lose…
one-community Nov 27, 2025
b999d13
Merge pull request #1754 from OneCommunityGlobal/abhishek_lint_test_a…
one-community Nov 27, 2025
55bf5cb
build(deps): bump node-forge from 1.3.1 to 1.3.2 (#1923)
dependabot[bot] Nov 29, 2025
d8ea8e8
fix: team code error
Dec 1, 2025
6af573c
Merge pull request #1929 from OneCommunityGlobal/venkataramanan_fix_t…
one-community Dec 2, 2025
03c4b43
fix(userTitle): User Title in BS Assignment
DiyaWadhwani Dec 2, 2025
aba2ab6
Merge pull request #1919 from OneCommunityGlobal/Diya_Fix_UserProfile…
one-community Dec 4, 2025
469c5e3
Merge pull request #1931 from OneCommunityGlobal/Diya_Fix_UserTitle_B…
one-community Dec 4, 2025
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
124 changes: 122 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ module.exports = {
},
env: { es6: true, node: true, commonjs: true },
rules: {
// ===============================
// KEEP EXISTING RELAXED RULES
// ===============================
'global-require': 'off',
'func-names': 'off',
'no-underscore-dangle': 'off',
Expand All @@ -21,8 +24,94 @@ module.exports = {
'template-curly-spacing': 'off',
indent: 'off',
'linebreak-style': 0,
'no-console': 'off',
'no-console': 'warn',
'consistent-return': 'off',

// ===============================
// LIGHT ENTERPRISE ADDITIONS (MOSTLY WARNINGS)
// ===============================

// Critical Error Prevention (errors only for breaking stuff)
'no-undef': 'error',
'no-unused-vars': ['warn', {
vars: 'local',
args: 'none',
varsIgnorePattern: '^_',
argsIgnorePattern: '^_'
}],
'no-unreachable': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',

// Security (light - just warnings to start awareness)
'no-eval': 'warn',
'no-implied-eval': 'warn',
'no-new-func': 'warn',
'no-script-url': 'warn',

// Code Quality (warnings only - gradual improvement)
'no-var': 'warn', // Encourage let/const
'prefer-const': 'warn', // Encourage immutability
'no-magic-numbers': ['warn', {
ignore: [-1, 0, 1, 2, 100, 200, 201, 400, 401, 403, 404, 500],
ignoreArrayIndexes: true
}],
'prefer-template': 'warn',
'no-duplicate-imports': 'warn',
'object-shorthand': 'warn',

// Async/Promise Best Practices (warnings)
'no-return-await': 'warn',
'prefer-promise-reject-errors': 'warn',
'no-async-promise-executor': 'warn',

// Node.js Specific (warnings)
'no-path-concat': 'warn',
'no-process-exit': 'warn',
'handle-callback-err': 'warn',
'new-cap': 'warn',
'no-lonely-if': 'warn',
'no-nested-ternary': 'warn',
'camelcase': 'warn',
'radix': 'warn',
'no-restricted-syntax': 'warn',


// Light Complexity Control (warnings with high thresholds)
'complexity': ['warn', { max: 15 }], // High threshold for lazy devs
'max-depth': ['warn', { max: 5 }],
'max-params': ['warn', { max: 4 }],
'max-lines-per-function': ['warn', {
max: 100,
skipBlankLines: true,
skipComments: true
}],

// Import Organization (warnings only)
'import/order': ['warn', {
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'never' // Keep it simple
}],
'import/newline-after-import': 'warn',
'import/no-duplicates': 'warn',

// Performance Hints (warnings)
'no-loop-func': 'warn',

// API Design (warnings for better practices)
'no-throw-literal': 'warn',
'prefer-rest-params': 'warn',
'prefer-spread': 'warn',

// Database/Backend Specific (warnings)
'no-eq-null': 'warn', // Encourage strict equality
'eqeqeq': ['warn', 'smart'], // Allow == null for lazy devs

// Documentation Encouragement (warnings)
'spaced-comment': ['warn', 'always', {
markers: ['/', '!', '*'],
exceptions: ['-', '+', '*']
}],
},
settings: {
'import/resolver': {
Expand All @@ -32,9 +121,40 @@ module.exports = {
},
},
overrides: [
// Test Files - More Relaxed
{
files: ['**/*.test.js', '**/*.spec.js', 'src/test/**/*.js', 'src/__tests__/**/*.js'],
env: { jest: true },
rules: {
// Relax rules for test files
'no-magic-numbers': 'off',
'max-lines-per-function': 'off',
'complexity': 'off',
'max-params': 'off',
'prefer-promise-reject-errors': 'off',
'no-console': 'off',
'import/no-extraneous-dependencies': 'off',
}
},

// Config Files - Super Relaxed
{
files: ['*.config.js', '.eslintrc.js', 'babel.config.js', 'webpack.config.js'],
rules: {
'no-console': 'off',
'import/no-extraneous-dependencies': 'off',
'global-require': 'off',
}
},

// Migration Files - Relaxed (if using DB migrations)
{
files: ['**/migrations/*.js', '**/seeders/*.js'],
rules: {
'no-console': 'off',
'max-lines-per-function': 'off',
'no-magic-numbers': 'off',
}
}
],
};
};
76 changes: 66 additions & 10 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,75 @@ on:
branches: [ development ]

jobs:
build:
lint:
name: Lint Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js 20.17.0
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 20.17.0
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint

- run: npm ci
- name: Run email sender check
run: node src/utilities/debugEmailSender.js
- run: npm run test


test:
name: Tests with 10% Coverage Enforcement
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js 20.17.0
uses: actions/setup-node@v4
with:
node-version: 20.17.0
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests with coverage enforcement
run: npm run test:ci

- name: Print detailed coverage report
if: always()
run: |
echo "📊 COVERAGE ENFORCEMENT REPORT 📊"
echo "=================================="
echo "Minimum Required: Lines: 34%, Statements: 34%, Functions: 27%, Branches: 12%"
echo "=================================="
if [ -f coverage/coverage-summary.json ]; then
node -e "
const coverage = require('./coverage/coverage-summary.json');
const { lines, statements, functions, branches } = coverage.total;

console.log('📈 CURRENT COVERAGE:');
console.log(\`📄 Lines: \${lines.pct}% \${lines.pct >= 34 ? '✅ PASS' : '❌ FAIL'}\`);
console.log(\`📝 Statements: \${statements.pct}% \${statements.pct >= 34 ? '✅ PASS' : '❌ FAIL'}\`);
console.log(\`🔧 Functions: \${functions.pct}% \${functions.pct >= 27 ? '✅ PASS' : '❌ FAIL'}\`);
console.log(\`🌿 Branches: \${branches.pct}% \${branches.pct >= 12 ? '✅ PASS' : '❌ FAIL'}\`);

const allPass = [lines, statements, functions, branches].every(metric => metric.pct >= 60);
console.log('================================');
console.log(\`🎯 OVERALL: \${allPass ? '✅ COVERAGE REQUIREMENTS MET' : '❌ COVERAGE REQUIREMENTS FAILED'}\`);
console.log('================================');
"
else
echo "❌ No coverage report generated"
fi

- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: backend-coverage-report
path: coverage/
3 changes: 2 additions & 1 deletion create-tasks-for-current-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ async function createTasksForCurrentUser() {

console.log('✅ Connected to MongoDB');

const currentUserId = '68645a7c48658d005501e2f9';
// add your user id here to create tasks for that user
const currentUserId = '';

// Get existing data
const subjects = await Subject.find({});
Expand Down
40 changes: 34 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
module.exports = {
roots: ['<rootDir>/src'],
collectCoverageFrom: [
'!<rootDir>/src/**/*.js', // need to collect coverage from all files that are involved in serving an API request
'!<rootDir>/src/server.js',
'!<rootDir>/src/models/**/*.js',
'!<rootDir>/src/startup/**/*.js',
'!<rootDir>/src/test/**/*.js',
'!<rootDir>/src/utilities/**/*.js', // need to collect coverage from utilities after all unit tests have been created
'src/**/*.js',
'src/controllers/**/*.js',
'src/routes/**/*.js',
'src/utilities/**/*.js',
'src/helpers/**/*.js',
'src/models/**/*.js',
'src/services/**/*.js',
'src/middleware/**/*.js',
// Exclude test files and mock data
'!src/**/*.test.js',
'!src/**/*.spec.js',
'!src/**/*MockData.js',
'!src/**/*MockData.jsx',
'!src/test/**',
'!src/__tests__/**'
],
// Coverage thresholds - Start light and increase gradually
coverageThreshold: {
global: {
branches: 9,
functions: 24,
lines: 30,
statements: 30
},

},

// Coverage reporters - shows in terminal and generates reports
coverageReporters: [
'text', // Terminal output
'text-summary', // Brief summary
'lcov', // For CI/CD tools
'html', // HTML report in coverage/ folder
'json' // JSON report for parsing
],
testTimeout: 60000, // 1 minute for CI environments
coverageDirectory: 'coverage',
Expand Down
Loading
Loading