Skip to content

feat: enhance compliance check with content validation and category report

LOKESH MANCHALA requested to merge dev into main

What does this MR do?

This MR enhances the GitLab Project Compliance Checker to validate the content of key configuration files, not just their presence. It introduces:

  • AGPLv3 license validation: Ensures the LICENSE file is truly AGPLv3, not just named LICENSE.
  • .vscode/settings.json content checks: Validates that the file includes ruff for linting and uv for environment management.
  • Improved feedback: Uses yellow (🟠) status when a license is present but incorrect (e.g., MIT/Apache).
  • Better UX: Shows files.png only in suggestions, when template folders are missing.
  • Faster performance: Uses caching to avoid redundant GitLab API calls.
  • Enter key support: Pressing Enter in the project input now triggers the check.

This ensures projects meet organizational compliance standards at both structure and content levels.

Motivation / Use Case

Our team requires:

  • All open-source projects to use AGPLv3, not permissive licenses like MIT.
  • Standardized development environments using ruff (linter) and uv (Python installer).
  • Clear, actionable feedback when projects are non-compliant.

Previously, the tool only checked if files existed. This MR ensures they are correctly configured, preventing false positives and enforcing best practices.

Implementation Notes

  • Caching: Used @st.cache_data on file reads (read_file_content) to speed up checks.
  • Content Validation:
    • check_license_content() parses LICENSE and checks for AGPLv3-specific phrases.
    • check_vscode_settings_content() parses .vscode/settings.json and verifies ruff and uv usage.
  • Image Logic: files.png now shows only in suggestions and only if .gitlab/issue_templates or .gitlab/merge_request_templates is missing.
  • No Truncation: All .md files in template folders are shown in full (e.g., 5 file(s) (Bug.md, Default.md, Documentation.md, ...)).
  • Enter Key Support: Added on_change callback to trigger checks on Enter.
  • Backward Compatible: No breaking changes. Existing modes ("User Profile README", "Get User Info") are unchanged.

How to Test

  1. Pull the branch:
  • git fetch origin
  • git checkout your-branch-name
  1. Run the Streamlit app:
  • streamlit run app.py
  1. Test in "Check Project Compliance" mode:
  • Enter a project path/URL and press Enter or click "Check Compliance".
  • Verify:
    • If LICENSE is MIT/Apache → shows 🟠 LICENSE is AGPLv3.
    • If .vscode/settings.json lacks ruff/uv → shows ❌ .vscode/settings.json has Ruff/UV.
    • If template folders are missing → files.png appears in suggestions.
    • If all checks pass → shows 🎉 All Set!.
  • Test with projects that have:
    • AGPLv3 vs MIT license
    • .vscode/settings.json with and without ruff/uv
    • Missing or present template folders
  1. Verify other modes still work:
  • Switch to "Check User Profile README" and "Get User Info" — they should work as before.

Checklist

  • Feature is documented (in README or relevant doc files)
  • Code is clean, readable, and follows the project style
  • No breaking changes (or documented if there are)
  • Tests are added or updated
  • Feature works as intended in local testing

Related Issues or Discussions

  • Implements: feat(compliance): validate LICENSE and vscode settings content
  • Closes: #1 (closed)

Merge request reports

Loading