Skip to content

#153 - deprecate Know Your Class and Section feature - #154

Closed
ndigvijay wants to merge 2 commits into
pesu-dev:mainfrom
ndigvijay:deprecate-kycas
Closed

#153 - deprecate Know Your Class and Section feature#154
ndigvijay wants to merge 2 commits into
pesu-dev:mainfrom
ndigvijay:deprecate-kycas

Conversation

@ndigvijay

Copy link
Copy Markdown
Contributor

📌 Description

This PR removes the deprecated knowYourClassAndSection feature because the corresponding PESU Academy endpoint, /Academy/a/getStudentClassInfo, no longer works.

The removal includes:

  • Removing knowYourClassAndSection from the authentication request schema.
  • Removing knowYourClassAndSection from the authentication response schema.
  • Removing the upstream API request and response parsing logic.
  • Removing the KYCAS response model and dedicated exception.
  • Removing KYCAS-only profile fields.
  • Removing related README and OpenAPI documentation.
  • Removing benchmark CLI and payload support.
  • Removing obsolete unit, functional, and integration tests.

Requests containing knowYourClassAndSection are now treated like any other unknown request field and return a 400 validation response.

ℹ️ Fixes / Related Issues
Fixes: #IssueNumber
Related: N/A

🧱 Type of Change

  • 🐛 Bug fix – Non-breaking fix for a functional/logic error
  • ✨ New feature – Adds functionality without breaking existing APIs
  • ⚠️ Breaking change – Introduces backward-incompatible changes (API, schema, etc.)
  • 📝 Documentation update – README, docstrings, OpenAPI tags, etc.
  • 🧪 Test suite change – Adds/updates unit, functional, or integration tests
  • ⚙️ CI/CD pipeline update – Modifies GitHub Actions, pre-commit, or Docker build
  • 🧹 Code quality / Refactor – Improves structure, readability, or style (no functional changes)
  • 🐢 Performance improvement – Speeds up auth, scraping, or reduces I/O
  • 🕵️ Debug/logging enhancement – Adds or improves logging/debug support
  • 🔧 Developer tooling – Scripts, benchmarks, local testing improvements
  • 🔒 Security fix – Addresses auth/session/data validation vulnerabilities
  • 🧰 Dependency update – Updates libraries in requirements.txt, pyproject.toml

🧪 How Has This Been Tested?

  • Unit Tests (tests/unit/)
  • Functional Tests (tests/functional/)
  • Integration Tests (tests/integration/)
  • Manual Testing

⚙️ Test Configuration:

  • OS: macOS
  • Python: 3.14.6 via uv
  • Docker build tested

Testing performed:

  • uv run pytest -m 'not secret_required'
    • 63 tests passed.
    • 11 secret-dependent tests were deselected because the required TEST_* credentials were unavailable.
  • Relevant request-model and integration tests:
    • 31 tests passed.
    • 6 secret-dependent tests were deselected.
  • uv run ruff check .
    • All checks passed.
  • Generated OpenAPI schemas were inspected to confirm knowYourClassAndSection is absent from both request and response models.
  • Repository searches confirmed there are no remaining references to the removed feature.

✅ Checklist

  • My code follows the CONTRIBUTING.md guidelines
  • I've performed a self-review of my changes
  • I've added/updated necessary comments and docstrings
  • I've updated relevant docs (README or endpoint docs)
  • No new warnings introduced
  • I've updated tests for the removed behavior
  • All tests pass locally (scripts/run_tests.py)
  • I've run linting and formatting (pre-commit run --all-files)
  • Docker image builds and runs correctly
  • Changes are backwards compatible (if applicable)
  • Feature flags or .env vars updated (if applicable)
  • I've tested across multiple environments (if applicable)
  • Benchmarks still meet expected performance (scripts/benchmark/benchmark_requests.py)

🛠️ Affected API Behaviour

  • app/app.py – Modified /authenticate route logic
  • app/pesu.py – Updated scraping or authentication handling

🧩 Models

  • app/models/request.py – Input validation or request schema changes
  • app/models/response.py – Authentication response formatting
  • app/models/profile.py – Profile extraction logic

🐳 DevOps & Config

  • Dockerfile – Changes to base image or build process
  • .github/workflows/*.yaml – CI/CD pipeline or deployment updates
  • pyproject.toml / requirements.txt – Dependency version changes
  • .pre-commit-config.yaml – Linting or formatting hook changes

📊 Benchmarks & Analysis

  • scripts/benchmark/benchmark_requests.py – Removed support for the deprecated request flag
  • scripts/benchmark/analyze_benchmark.py – Benchmark result analysis changes
  • scripts/run_tests.py – Custom test runner logic or behavior updates

📸 Screenshots / API Demos

Example response when a client continues to send the removed field:

{
  "status": false,
  "message": "Could not validate request data - body.knowYourClassAndSection: Extra inputs are not permitted"
}
The generated OpenAPI request and response schemas no longer include knowYourClassAndSection.
🧠 Additional Notes
This is a breaking API change.
Clients must remove knowYourClassAndSection from authentication requests and stop expecting it in authentication responses. Direct Python callers must also stop passing the know_your_class_and_section argument to PESUAcademy.authenticate().
The normal profile response continues to provide supported fields such as semester and section.

@ndigvijay
ndigvijay requested review from a team and aditeyabaral as code owners August 11, 2026 06:32
@ndigvijay ndigvijay closed this Aug 11, 2026
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