Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
fbbe467
Pending changes exported from your codespace
vihar2712 Jun 24, 2025
755012e
grades controller finished
vihar2712 Aug 5, 2025
a1878ad
Merged main branch into join-team-requests-and-invitations
vihar2712 Aug 11, 2025
cd798c6
team hierarchy still unresolved. authorization module included.
vihar2712 Aug 21, 2025
65bf36b
/api/v1 removed
vihar2712 Oct 1, 2025
61e8698
modified invitation model
vihar2712 Oct 1, 2025
8985131
modified student_teams controller - made use of serializer, sending c…
vihar2712 Oct 6, 2025
04e31e6
methods inside student_teams added
vihar2712 Oct 12, 2025
9f8d758
retract, accept, reject invitation working
vihar2712 Oct 13, 2025
f0ebf63
added authorization inside invitations controller
vihar2712 Oct 17, 2025
4c80523
modified invitations controller
vihar2712 Oct 27, 2025
61a437b
added invitations sent by participant route and method
vihar2712 Oct 29, 2025
ec90caa
added methods for performing crud operations on advertisement inside …
vihar2712 Nov 5, 2025
2952a55
single action_allowed? method implemented
vatsal-dp Nov 15, 2025
ffd3251
Review and validate the existing controller methods, ensuring they ar…
vatsal-dp Nov 15, 2025
36ea31b
common database
devyash2930 Nov 15, 2025
2cfda59
signup data
vatsal-dp Nov 15, 2025
dd2ace3
joining team requests implemented
smitraval24 Nov 15, 2025
c129b97
adding data for the requests and joins
smitraval24 Nov 15, 2025
e08e826
Implement email notifications for accepted join team requests and inv…
smitraval24 Nov 26, 2025
ee37683
adding test cases
smitraval24 Nov 26, 2025
44730b9
test case integrated
smitraval24 Nov 27, 2025
cdba488
axios
devyash2930 Dec 3, 2025
99b1aa2
fix change teams
vatsal-dp Dec 3, 2025
053260c
Model tests
devyash2930 Dec 5, 2025
03ddc9d
removed /api/v1 nomenclature from the system (#210)
vihar2712 Sep 25, 2025
8d29a89
Ndt2000 patch 1 (#215)
NDT2000 Oct 8, 2025
5bd77e7
Changed Rails Version (#211)
prithishsamanta Oct 8, 2025
cade60b
E2555: Backend for Participants page (#222)
SeojinSeojin Nov 16, 2025
354f97c
Added teams columns like shown on the website
SpencerKersey Nov 16, 2025
be5bbd6
Finish Grades controller (#229)
vihar2712 Nov 20, 2025
9d7c8f7
grades controller finished
vihar2712 Aug 5, 2025
4e8539b
team hierarchy still unresolved. authorization module included.
vihar2712 Aug 21, 2025
648d82f
/api/v1 removed
vihar2712 Oct 1, 2025
d8a4e9f
modified invitation model
vihar2712 Oct 1, 2025
811b875
modified student_teams controller - made use of serializer, sending c…
vihar2712 Oct 6, 2025
e54d0cf
methods inside student_teams added
vihar2712 Oct 12, 2025
a38a2bc
retract, accept, reject invitation working
vihar2712 Oct 13, 2025
e88006f
added authorization inside invitations controller
vihar2712 Oct 17, 2025
0943fa8
modified invitations controller
vihar2712 Oct 27, 2025
b0c3165
added invitations sent by participant route and method
vihar2712 Oct 29, 2025
58b5d2f
added methods for performing crud operations on advertisement inside …
vihar2712 Nov 5, 2025
f0c23d0
single action_allowed? method implemented
vatsal-dp Nov 15, 2025
3b18df2
Review and validate the existing controller methods, ensuring they ar…
vatsal-dp Nov 15, 2025
71f3a21
signup data
vatsal-dp Nov 15, 2025
5e02494
joining team requests implemented
smitraval24 Nov 15, 2025
ad0107a
Implement email notifications for accepted join team requests and inv…
smitraval24 Nov 26, 2025
283117d
test case integrated
smitraval24 Nov 27, 2025
d726264
axios
devyash2930 Dec 3, 2025
e998444
fix change teams
vatsal-dp Dec 3, 2025
a214139
Model tests
devyash2930 Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 20 additions & 3 deletions .github/workflows/TestPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,25 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Clear Ruby cache
run: |
rm -rf ~/.ruby-version
rm -rf ~/.rbenv
rm -rf ~/.rvm
rm -rf /usr/local/rvm
rm -rf /opt/ruby

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.7
bundler-cache: true
ruby-version: 3.4.5
bundler-cache: false

- name: Check Ruby Version
run: |
ruby -v
which ruby
gem env

- name: Setup Node.js
uses: actions/setup-node@v3
Expand All @@ -45,7 +59,10 @@ jobs:
run: |
gem update --system
gem install bundler:2.4.7
bundle install
bundle config set --local deployment 'false'
bundle config set --local without ''
bundle config set --local force_ruby_platform true
bundle install --verbose
- name: Setup database
run: |
bundle exec rails db:create RAILS_ENV=test
Expand Down
27 changes: 24 additions & 3 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,36 @@ jobs:
with:
fetch-depth: 0

- name: Clear Ruby cache
run: |
rm -rf ~/.ruby-version
rm -rf ~/.rbenv
rm -rf ~/.rvm
rm -rf /usr/local/rvm
rm -rf /opt/ruby

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.7'
ruby-version: '3.4.5'
bundler-cache: false

- name: Check Ruby Version
run: |
ruby -v
which ruby
gem env

- name: Install dependencies
run: bundle install
run: |
gem update --system
gem install bundler:2.4.7
bundle config set --local deployment 'false'
bundle config set --local without ''
bundle config set --local force_ruby_platform true
bundle install --verbose

- name: Run Danger
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger --verbose
run: bundle exec danger --verbose
24 changes: 19 additions & 5 deletions .github/workflows/danger_target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,40 @@ name: Danger
on:
pull_request_target:
types: [opened, synchronize, reopened]

jobs:
danger:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Remove .ruby-version if exists
run: |
if [ -f .ruby-version ]; then
echo "Removing .ruby-version file"
rm .ruby-version
fi

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.7'

- name: Install dependencies
run: bundle install
ruby-version: '3.4.5'
bundler-cache: true

- name: Verify Ruby Version
run: |
echo "Ruby version:"
ruby -v
echo "Ruby path:"
which ruby
echo "Gem environment:"
gem env

- name: Run Danger
env:
Expand Down
92 changes: 79 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,25 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Clear Ruby cache
run: |
rm -rf ~/.ruby-version
rm -rf ~/.rbenv
rm -rf ~/.rvm
rm -rf /usr/local/rvm
rm -rf /opt/ruby

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.7
bundler-cache: true
ruby-version: 3.4.5
bundler-cache: false

- name: Check Ruby Version
run: |
ruby -v
which ruby
gem env

- name: Setup Node.js
uses: actions/setup-node@v3
Expand All @@ -47,33 +61,86 @@ jobs:
run: |
gem update --system
gem install bundler:2.4.7
bundle install
bundle config set --local deployment 'false'
bundle config set --local without ''
bundle config set --local force_ruby_platform true
bundle install --verbose

- name: Setup database
run: |
bundle exec rails db:create RAILS_ENV=test
bundle exec rails db:schema:load RAILS_ENV=test

- name: Set up code climate test-reporter
- name: Set up code coverage
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
echo "SimpleCov coverage reporting is configured in spec_helper.rb"

- name: Run model tests
run: bundle exec rspec spec/models

- name: Run controller tests
run: bundle exec rspec spec/requests/

- name: Format code coverage report
run: ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.models.json" --debug
- name: Generate coverage report
run: |
echo "Coverage report generated in coverage/index.html"
ls -la coverage/ || echo "No coverage directory found"
if [ -f coverage/index.html ]; then
echo "✅ Coverage report generated successfully"
echo "📊 Coverage percentage:"
grep -o '[0-9]\+\.[0-9]\+%' coverage/index.html | head -1 || echo "Coverage percentage not found"
else
echo "❌ Coverage report not generated"
fi

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: code-coverage-artifacts
path: coverage/

- name: Comment coverage on PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');

try {
// Read coverage data
const coveragePath = 'coverage/coverage.json';
if (fs.existsSync(coveragePath)) {
const coverage = JSON.parse(fs.readFileSync(coveragePath, 'utf8'));
const percentage = coverage.metrics.covered_percent.toFixed(2);

const comment = `## 📊 Code Coverage Report

**Coverage: ${percentage}%**

- **Lines covered:** ${coverage.metrics.covered_lines}/${coverage.metrics.total_lines}
- **Branches covered:** ${coverage.metrics.covered_branches}/${coverage.metrics.total_branches}

📈 Coverage report generated with SimpleCov and Ruby 3.4.5

<details>
<summary>View detailed coverage report</summary>

Coverage artifacts are available in the workflow run.
</details>`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
} else {
console.log('Coverage file not found');
}
} catch (error) {
console.log('Error creating coverage comment:', error.message);
}


publish_code_coverage:
Expand All @@ -91,10 +158,9 @@ jobs:
- name: Upload code-coverage report to code-climate
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter sum-coverage coverage/codeclimate.*.json
./cc-test-reporter after-build -t simplecov -r ${{ secrets.CC_TEST_REPORTER_ID }}
gem install codeclimate-test-reporter
cc-test-reporter sum-coverage coverage/codeclimate.*.json
cc-test-reporter after-build -t simplecov -r ${{ secrets.CC_TEST_REPORTER_ID }}

docker:
needs: test
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.2.7
ruby-3.4.5
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"sqltools.connections": [
{
"mysqlOptions": {
"authProtocol": "default",
"enableSsl": "Disabled"
},
"previewLimit": 50,
"server": "0.0.0.0",
"port": 3307,
"driver": "MySQL",
"database": "reimplementation_development",
"username": "root",
"name": "devexpertiza"
}
]
}
12 changes: 6 additions & 6 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Dangerfile
# Helper to safely read files in UTF-8 and avoid "invalid byte sequence" errors
def safe_read(path)
File.read(path, encoding: "UTF-8", invalid: :replace, undef: :replace)
end

# --- PR Size Checks ---
warn("Pull request is too big (more than 500 LoC).") if git.lines_of_code > 500
Expand All @@ -14,7 +17,7 @@ warn("Pull request has duplicated commit messages.") if duplicated_commits.any?

# --- TODO/FIXME Checks ---
todo_fixme = (git.modified_files + git.added_files).any? do |file|
File.read(file).match?(/\b(TODO|FIXME)\b/i)
File.exist?(file) && safe_read(file).match?(/\b(TODO|FIXME)\b/i)
end
warn("Pull request contains TODO or FIXME comments.") if todo_fixme

Expand All @@ -25,7 +28,6 @@ warn("Pull request includes temp, tmp, or cache files.") if temp_files
# --- Missing Test Checks ---
warn("There are no test changes in this PR.") if (git.modified_files + git.added_files).none? { |f| f.include?('spec/') || f.include?('test/') }


# --- .md File Changes ---
md_changes = git.modified_files.any? { |file| file.end_with?('.md') }
warn("Pull request modifies markdown files (*.md). Make sure you have a good reason.") if md_changes
Expand All @@ -49,11 +51,9 @@ config_files = %w[
changed_config_files = git.modified_files.select { |file| config_files.include?(file) }
warn("Pull request modifies config or setup files: #{changed_config_files.join(', ')}.") if changed_config_files.any?


# --- Shallow Tests (RSpec) ---
# (Rules 37-41 — Shallow tests — assuming you want them included)
shallow_test_files = git.modified_files.select { |file| file.include?('spec/') }
shallow_test_warning = shallow_test_files.any? do |file|
File.read(file).match?(/\bit\b|\bspecify\b/)
File.exist?(file) && safe_read(file).match?(/\bit\b|\bspecify\b/)
end
warn("RSpec tests seem shallow (single `it` blocks or no context). Consider improving test structure.") if shallow_test_warning
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2.7
FROM ruby:3.4.5

LABEL maintainer="Ankur Mundra <[email protected]>"
# Install dependencies
Expand All @@ -21,4 +21,4 @@ RUN bundle install
EXPOSE 3002

# Set the entry point
ENTRYPOINT ["/app/setup.sh"]
ENTRYPOINT ["/app/setup.sh"]
24 changes: 21 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.2.7'
ruby '3.4.5'

gem 'mysql2', '~> 0.5.5'
gem 'puma', '~> 5.0'
gem 'mysql2', '~> 0.5.7'
gem 'sqlite3', '~> 1.4' # Alternative for development
gem 'puma', '~> 6.4'
gem 'rails', '~> 8.0', '>= 8.0.1'
gem 'mini_portile2', '~> 2.8' # Helps with native gem compilation
gem 'observer' # Required for Ruby 3.4.5 compatibility with Rails 8.0
gem 'mutex_m' # Required for Ruby 3.4.5 compatibility
gem 'faraday-retry' # Required for Faraday v2.0+ compatibility
gem 'bigdecimal' # Required for Ruby 3.4.5 compatibility
gem 'csv' # Required for Ruby 3.4.5 compatibility
gem 'date' # Required for Ruby 3.4.5 compatibility
gem 'delegate' # Required for Ruby 3.4.5 compatibility
gem 'forwardable' # Required for Ruby 3.4.5 compatibility
gem 'logger' # Required for Ruby 3.4.5 compatibility
gem 'monitor' # Required for Ruby 3.4.5 compatibility
gem 'ostruct' # Required for Ruby 3.4.5 compatibility
gem 'set' # Required for Ruby 3.4.5 compatibility
gem 'singleton' # Required for Ruby 3.4.5 compatibility
gem 'timeout' # Required for Ruby 3.4.5 compatibility
gem 'uri' # Required for Ruby 3.4.5 compatibility
gem 'rswag-api'
gem 'rswag-ui'
gem 'active_model_serializers', '~> 0.10.0'
gem 'psych', '~> 5.2' # Ensure compatible psych version for Ruby 3.4.5

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem "jbuilder"
Expand Down
Loading
Loading