Skip to content

Feat/final refactoring - #6

Open
EishaMazhar wants to merge 20 commits into
developfrom
feat/final-refactoring
Open

Feat/final refactoring#6
EishaMazhar wants to merge 20 commits into
developfrom
feat/final-refactoring

Conversation

@EishaMazhar

@EishaMazhar EishaMazhar commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Changes:

Minor refactoring changes


Note

Medium Risk
Medium risk due to changes in dashboard data-loading behavior (local vs Hugging Face fallback and new failure handling) and modified devcontainer sudoers permissions that may affect developer workflows.

Overview
Adds a local-first with Hugging Face Hub fallback loader for the dashboard dataset, including clearer user-facing error guidance when data is unavailable.

Enhances the Streamlit narrative with data source/completeness breakdowns, feature definitions, safer Fisher odds-ratio handling, and updated concept selection for the topic association chart.

Expands model comparison by adding a majority-vote ensemble and richer metrics (AUC-ROC, rescaled MCC) across radar/summary tables, and makes the correlation-weighted method’s threshold read from correlation_weights.json for consistency.

Adds two new scripts/ utilities to generate static report figures (correlations.png and feature_distributions.png), and updates the devcontainer to remove passwordless sudo for the vscode user.

Reviewed by Cursor Bugbot for commit e66291c. Bugbot is set up for automated code reviews on this repo. Configure here.

EishaMazhar and others added 7 commits April 16, 2026 15:00
When users select a metric from the 'What Makes a Hackathon Repo?' dropdown,
they now see:
- Clear definition of what the feature measures
- Whether it's a raw GitHub feature or derived (calculated)
- For derived features: the calculation formula shown

FEATURE_METADATA dictionary added with:
- 12 features (Days with Code Changes through Watchers)
- User-friendly definitions suitable for non-technical audience
- Calculation formulas for 2 derived features:
  - Days with Code Changes: (last_commit_date − first_commit_date)
  - Repository Age: (pushed_at − created_at)
- Feature type indicator (Raw vs Derived with 📊 and 📐 icons)

Display integrated into render_features() with expandable info box
that shows automatically when feature is selected.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Changed st.expander expanded parameter from True to False so the
feature definition/calculation box is collapsed by default and only
expands when user clicks to read more.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Changed sudoers entry from 'vscode ALL=(ALL) NOPASSWD:ALL' to
'vscode ALL=(ALL) ALL' to require password authentication for sudo commands.
@EishaMazhar
EishaMazhar requested review from caviri and rmfranken April 16, 2026 14:39
- Enhanced load_predictions() with local-first pattern
- Comprehensive error guidance with 2 setup options
- Added 9 tests for loading logic
- Backward compatible with existing local files
… in repo_analysis notebook

- Implemented tests to verify the creation and upload of concept cache JSON to Hugging Face Hub.
- Added checks for the export workflow in the notebook, ensuring CSV and Parquet files are generated correctly.
- Verified the structure and serialization of the cache dictionary.
- Ensured that the upload function is correctly called and that the cache is included in the upload process.
- Created integration tests to confirm that the cache can be loaded and handles missing fields gracefully.
- Adjusted correlation weights in `correlation_weights.json` for `n_concepts` and updated threshold, score_min, and score_max values.
- Modified the `CorrelationWeights` class to reflect new threshold value.
- Updated the `train_correlation_weights` function to use the new threshold.
- Added comprehensive tests for cache lifecycle in `test_cache_lifecycle.py`, covering download, enrichment, persistence, and upload scenarios.
- Enhanced tests for correlation weights in `test_correlation_weighted.py` to ensure default values align with recent changes.
- Updated notebook tests to reflect changes in cell numbers and ensure proper functionality for data loading and cache export.
- Created new tests for notebook data loading logic to verify local-first and HF fallback strategies.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e66291c. Configure here.

Comment thread .devcontainer/Dockerfile
# Create non-root user for VS Code
RUN useradd -ms /bin/bash -u 1000 vscode \
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
&& echo "vscode ALL=(ALL) ALL" >> /etc/sudoers

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devcontainer sudo broken for passwordless user

High Severity

The NOPASSWD:ALL sudoers directive was changed to just ALL, but the vscode user is created via useradd without a password. Since the user has no password set, sudo will now prompt for a password that doesn't exist, effectively making sudo unusable inside the devcontainer. This breaks any workflow (package installs, file permission changes, devcontainer features) that depends on sudo.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e66291c. Configure here.

Comment thread app/hackathon_story.py
})

# Display as styled table
st.write(source_data.to_html(index=False, escape=False), unsafe_allow_html=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Markdown bold syntax won't render inside HTML table

Low Severity

The total row uses Markdown bold syntax (**Total**, **{total_all}**, etc.) inside a pandas to_html() output rendered via st.write(..., unsafe_allow_html=True). Streamlit's Markdown parser does not process Markdown formatting inside HTML block elements like <table>/<td>. The total row will display with literal asterisks (e.g. **Total**) instead of bold text. Using HTML tags like <b>Total</b> would work correctly with escape=False.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e66291c. Configure here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant