Skip to content

Chore: removed unused data-org-index & orgIndex field#2020

Merged
S3DFX-CYBER merged 1 commit into
S3DFX-CYBER:mainfrom
imayuss:fix/remove-unused-attribute
Jul 22, 2026
Merged

Chore: removed unused data-org-index & orgIndex field#2020
S3DFX-CYBER merged 1 commit into
S3DFX-CYBER:mainfrom
imayuss:fix/remove-unused-attribute

Conversation

@imayuss

@imayuss imayuss commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📝 Description

  • Removed orgIndex in recommender.js. Dead field as it is used only in handleCardActivation which now uses data-org-name instead.
  • Removed 'data-org-indexfrom therecommendation-ui.js`.
  • Updated tests/recommendation.test.js to drop the assert.ok('orgIndex' in rec) check since the field no longer exists.

Testing

  • grep -rn "orgIndex" shows no remaining references
Screenshot_2026-07-15-11-45-27 (Edit)
  • Full test suite passes
image

🔗 Related Issue

Closes #2013

🚀 Program Classification

  • GSSoC26
  • NSoC26
  • General Contribution

🔄 Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔍 SEO improvement
  • 🎨 Style / UI improvement
  • ♿ Accessibility improvement
  • 📝 Documentation
  • ⚙️ CI / configuration
  • 🧹 Refactor / cleanup

✅ Checklist

  • My code follows the project's existing style
  • I have tested my changes in a browser
  • I have linked the related issue above
  • My PR title follows Conventional Commits format (e.g. feat: add scroll button)
  • I have not introduced any new dependencies or build tools

Review in cubic

@imayuss
imayuss requested a review from S3DFX-CYBER as a code owner July 15, 2026 06:20
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@imayuss is attempting to deploy a commit to the s3dfx-cyber's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for opening a PR, @imayuss!

Your PR has entered the 🚦 PR Review Pipeline.

🟢 GSSOC PR detected — your PR will be routed through the GSSOC mentor review pipeline.

⚠️ Dual-label notice: Both GSSOC and NSOC signals were detected in your PR. GSSoC takes priority and your PR has been classified as a GSSoC PR only. If this is incorrect, please remove the unintended program keyword from your PR description and push a new commit.


🔄 Review Flow

Stage Reviewer Purpose
Stage 1 🤖 Automation Validation · Duplicate Detection · AI/Slop Checks · Formatting · PR Analysis
Stage 2 🧑‍🏫 GSSOC Mentor Code Review · Scope Validation · Quality Check
Stage 3 🔑 Project Admin / Maintainer Final Approval & Merge Decision

The automated PR analysis system will verify issue linkage, PR relevance, and contribution quality.

A pipeline status comment may appear automatically as your PR progresses.


✅ Contributor Checklist

  • Sign commits using git commit -s
  • Link a valid issue (Closes #123)
  • Keep changes focused and relevant
  • Do not include unrelated modifications
  • Ensure workflows/build/tests are passing
  • Read the appropriate contributor guide:

⚠️ Important Notes

  • Low-quality, spammy, or AI-generated PRs may be closed
  • PRs without linked issues may fail automated checks
  • Large unrelated PRs are likely to be rejected
  • Review times may vary depending on mentor/reviewer availability

Happy contributing 🚀

This message is posted automatically and only once.

@github-actions github-actions Bot added type:testing gssoc26 GirlScript Summer of Code 2026 labels Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Dual Program Label Detected

Hi @imayuss,

Your PR description mentions both GSSOC and NSOC.

Detected Labels Resolution
gssoc, nsoc GSSoC priority applied — classified as a GSSoC PR

ℹ️ Only one program label may be active at a time. GSSoC takes priority when both are present.

If this is incorrect, please:

  1. Remove the unintended program keyword from your PR description
  2. Push a new commit or re-open the PR to re-trigger classification

📖 See our Contributing Guide for labeling details.

@github-actions

Copy link
Copy Markdown
Contributor

💬 Faster Reviews & Assignments

Hi @imayuss, for faster coordination and smoother communication, consider joining our Discord community:

👉 https://discord.gg/MmZGG2ee

Useful Channels

  • #issue-links-for-assignment → Share issue links for assignment help
  • #pr-links-for-review → Share PR links for mentor/maintainer review

Please avoid spamming channels or repeatedly pinging mentors/maintainers.

@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Validation Passed

Hi @imayuss, automated PR validation checks passed.

Your PR is ready for review.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Sign-off Verified

Hi @imayuss 👋

All commits in this PR contain valid Signed-off-by lines.

Thank you for following the DCO requirements 🚀

@github-actions github-actions Bot added size/xs gssoc26 GirlScript Summer of Code 2026 and removed gssoc26 GirlScript Summer of Code 2026 labels Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 44d95fb2-5a36-49f6-88fe-b24b6ba244b8

📥 Commits

Reviewing files that changed from the base of the PR and between 464013f and a6f05e2.

📒 Files selected for processing (3)
  • src/js/recommendation-ui.js
  • src/js/recommender.js
  • tests/recommendation.test.js
💤 Files with no reviewable changes (2)
  • tests/recommendation.test.js
  • src/js/recommender.js
📜 Recent review details
⚠️ CI failures not shown inline (1)

Commit Status: Vercel: Vercel

Conclusion: failure

Authorization required to deploy.
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-06-15T18:15:28.688Z
Learnt from: arghya29
Repo: S3DFX-CYBER/GSoC-Org-Finder- PR: 1882
File: src/js/footer.js:33-33
Timestamp: 2026-06-15T18:15:28.688Z
Learning: In this repo’s JavaScript (e.g., footer.js), `globalThis` is intentionally preferred over `window` to keep code environment-agnostic and to satisfy SonarCloud static analysis. The project targets modern browsers (ES2021) with no transpilation, so `globalThis` is fully supported—do not flag `globalThis` usage as a browser compatibility concern or suggest replacing it with `window` during review.

Applied to files:

  • src/js/recommendation-ui.js
🔇 Additional comments (2)
src/js/recommendation-ui.js (2)

139-139: LGTM!

Also applies to: 207-212


104-106: 🗄️ Data Integrity & Integration

No action needed. openModal already accepts organization names, and this call matches the existing card handlers.

			> Likely an incorrect or invalid review comment.

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Fixed recommendation card activation so selecting a card reliably opens the correct organization’s details.
    • Updated recommendation card identification in the interface to use the organization name attribute.
    • Adjusted recommendation result output to remove the per-item index field, while still returning the organization reference and scoring/reason details.

Walkthrough

Recommendation results no longer include organization indexes. Recommendation cards now identify organizations with data-org-name, and tests validate the retained organization reference.

Changes

Recommendation identity cleanup

Layer / File(s) Summary
Recommendation result contract
src/js/recommender.js, tests/recommendation.test.js
Recommendation objects remove orgIndex, retain org, and update required-property assertions accordingly.
Organization-name card identity
src/js/recommendation-ui.js
Recommendation cards replace data-org-index with data-org-name using the organization name.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: quality:clean

Suggested reviewers: s3dfx-cyber, harshavardhan31012007

Poem

I’m a rabbit hopping through the cards,
Names now guide the modal stars.
Indexes rest beneath the clover,
Cleaner fields are hopping over.
Tests nod softly: “Change approved!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and directly describes removal of the unused data-org-index/orgIndex fields.
Description check ✅ Passed The PR description covers the required sections, including issue link, classification, change type, testing, and checklist details.
Linked Issues check ✅ Passed The changes match #2013 by removing data-org-index, dropping orgIndex, and updating tests to reflect the new contract.
Out of Scope Changes check ✅ Passed The diff stays focused on the requested cleanup and related test updates, with no unrelated changes detected.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 TENET Agent Review

📋 Summary

This pull request performs a cleanup by removing the orgIndex field from the recommendation data structure in recommender.js and its corresponding data-org-index attribute from the UI in recommendation-ui.js. The handleCardActivation function is updated to use data-org-name instead of data-org-index when calling openModal. Associated tests are also updated. The approach is sound for removing unused code and aligning the UI interaction with the orgName identifier.

🔐 Security Findings

  • [LOW] src/js/recommendation-ui.js - The handleCardActivation function previously validated idx using !isNaN(idx) && idx >= 0 before calling openModal(idx). The updated logic now passes name (a string) to openModal(name) with only a truthiness check (if (name)). While data-org-name is set using safeEscapeHtml, the change from a strictly validated integer identifier to a less strictly validated string identifier for openModal could introduce issues if openModal expects a specific format or performs sensitive operations based on the input name without its own robust validation or sanitization (e.g., URL construction, database queries). Ensure openModal is designed to securely handle arbitrary string inputs for name.

🧹 Code Quality

  • src/js/recommendation-ui.js - In handleCardActivation, the validation for name (if (name)) is less strict than the previous validation for idx (!isNaN(idx) && idx >= 0). While name is expected to be a string, an empty string '' would evaluate to false, preventing openModal from being called, which might be intended. However, if openModal can gracefully handle an empty string, the explicit check might not be strictly necessary, but it's a functional change in validation rigor.

✅ What's Done Well

  • Effective Code Cleanup: Successfully removes dead code and unused data fields, improving maintainability.
  • Thorough Verification: The PR description includes grep output and full test suite pass, demonstrating diligent verification of changes.
  • Clear Rationale: The description clearly explains why the fields are removed and how the functionality is adapted.

📝 Overall Verdict

[APPROVE] - The changes are a beneficial cleanup, and the identified security concern is a low-severity functional change that should be handled by the openModal function's implementation.


Review powered by TENET Agent 🛡️ | Triggered automatically on PR #2020

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant UI as recommendation-ui.js
    participant Card as DOM Card Element
    participant Recommender as recommender.js
    participant Modal as openModal Function

    Note over UI,Modal: Card Activation Flow

    UI->>Recommender: calculateScoreForOrg(org, index, ...)
    Recommender-->>UI: Returns { org, score, rawScore, details, ... }

    UI->>UI: buildCardHtml(rec, ...)
    Note over UI: Renders element with data-org-name attribute
    UI->>Card: Creates article with data-org-name="${name}"

    alt Card Clicked / Activated
        UI->>Card: Reads card.dataset.orgName
        UI->>UI: handleCardActivation(card)
        UI->>UI: Validates name exists (truthy check)
        UI->>Modal: openModal(name)
        Note over Modal: Modal displayed for org name
    end
Loading

Auto-approved: Removes unused orgIndex field and its references; updates test accordingly. Clean, verifiable dead code removal.

Re-trigger cubic

Signed-off-by: imayuss <ayushjoshi8445@gmail.com>
@imayuss
imayuss force-pushed the fix/remove-unused-attribute branch from 464013f to a6f05e2 Compare July 21, 2026 01:14

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions github-actions Bot added gssoc26 GirlScript Summer of Code 2026 and removed gssoc26 GirlScript Summer of Code 2026 labels Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 TENET Agent Review

📋 Summary

This pull request effectively removes the unused orgIndex field from the recommender.js module and its corresponding data-org-index attribute from the recommendation-ui.js component. The associated test assertion in recommendation.test.js has also been correctly updated. The approach is sound, cleaning up dead code and improving maintainability without introducing new functionality or risks.

🔐 Security Findings

No security issues found.

🧹 Code Quality

Code quality looks good.

✅ What's Done Well

  • Dead Code Removal: The PR successfully identifies and removes unused code, which improves the codebase's maintainability and reduces potential confusion.
  • Consistent Updates: Changes are applied consistently across the data model (recommender.js), UI (recommendation-ui.js), and tests (recommendation.test.js), demonstrating a thorough understanding of the field's usage.
  • Clear Justification & Testing: The PR description clearly explains the rationale for removal and provides evidence of testing, including a grep command output and full test suite pass.

📝 Overall Verdict

[APPROVE] - A clean and well-executed refactor that removes dead code and improves maintainability.


Review powered by TENET Agent 🛡️ | Triggered automatically on PR #2020

@sonarqubecloud

Copy link
Copy Markdown

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
g-so-c-org-finder Ready Ready Preview, Comment Jul 22, 2026 11:33am

@S3DFX-CYBER S3DFX-CYBER left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@github-project-automation github-project-automation Bot moved this from Todo to In progress in GSSOC 26 Jul 22, 2026
@S3DFX-CYBER
S3DFX-CYBER merged commit 9171930 into S3DFX-CYBER:main Jul 22, 2026
39 of 43 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚦 PR Review Pipeline

🟢 GSSOC PR

Stage Status
Stage 1 — Automated Checks ✅ All automated checks passed
Stage 2 — Mentor/Reviewer ⏳ Awaiting GSSOC mentor review
Stage 3 — Maintainer 🔒 Blocked until Stage 2 passes

No active issues


Last updated: Wed, 22 Jul 2026 11:35:59 GMT

@github-project-automation github-project-automation Bot moved this from In progress to Done in GSSOC 26 Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Pull Request Merged

Hi @imayuss! Here's your current ranking:

Rank User Merged PRs Score
4 prisha-sh @prisha-sh 7 70
5 imayuss @imayuss 6 61
6 angelina-2206 @angelina-2206 5 51

Congratulations on getting your PR merged 🚀

Current Rank: #5

Current Score: 61

Keep contributing to climb the leaderboard 📈

@github-actions

Copy link
Copy Markdown
Contributor

🏆 Mentor Review Leaderboard

Top mentor reviewers of all time:

Rank Mentor Reviews Score
🥇 @KumarNirupam1 39 173
🥈 @TarunyaProgrammer 23 92
🥉 @nitinog10 16 69
4 @Anushreebasics 20 52
5 @deepak0x 9 38

Review scoring:

  • Detailed review → 5 pts
  • Medium review → 3 pts
  • Quick review → 2 pts
  • Changes requested bonus → +1 pt

🔗 Leaderboard Update PR: #2027

Thank you to all mentors reviewing PRs! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

BUG: Remove unused data-org-index attribute from recommendation cards

2 participants