#153 - deprecate Know Your Class and Section feature - #155
Open
ndigvijay wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the deprecated Know Your Class and Section (KYCAS) feature end-to-end from the PESUAuth API because the upstream PESU Academy endpoint no longer works, and updates tests/docs/tooling accordingly.
Changes:
- Removes the
knowYourClassAndSectionrequest flag and the corresponding response payload/model/exception. - Deletes all KYCAS scraping/parsing logic from
PESUAcademy.authenticate()and associated tests. - Updates docs and benchmark tooling to drop KYCAS references and CLI support.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_request_model.py | Removes request-model tests that covered the now-removed KYCAS request flag; retains extra-field rejection coverage. |
| tests/unit/test_pesu.py | Drops unit tests and imports related to KYCAS fetch/parsing behavior; minor formatting tweaks. |
| tests/integration/test_app_integration.py | Removes integration coverage for KYCAS request/response behavior and validation. |
| tests/functional/test_authenticate_functional.py | Removes functional tests that exercised KYCAS behavior. |
| scripts/benchmark/util.py | Removes KYCAS payload flag from benchmark request construction. |
| scripts/benchmark/benchmark_requests.py | Removes KYCAS CLI flag and propagation into benchmark requests. |
| README.md | Removes KYCAS from API request/response documentation and examples. |
| app/pesu.py | Removes KYCAS constants and the KYCAS fetch path from authenticate(). |
| app/models/response.py | Removes the KYCAS field from the response schema. |
| app/models/request.py | Removes the KYCAS field from the request schema so it becomes a forbidden extra input. |
| app/models/kycas.py | Deletes the KYCAS response model. |
| app/models/init.py | Removes KYCAS model export from the models package. |
| app/exceptions/authentication.py | Removes the dedicated KYCAS fetch exception type. |
| app/docs/authenticate.py | Removes OpenAPI examples and error examples related to KYCAS. |
| app/app.py | Stops passing the removed KYCAS flag through the /authenticate route into PESUAcademy.authenticate(). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| | `fields` | Yes | `list[str]` | `None` | Which fields to fetch from the profile information. If not provided, all fields will be fetched | | ||
| | **Parameter** | **Optional** | **Type** | **Default** | **Description** | | ||
| | ------------- | ------------ | ----------- | ----------- | ----------------------------------------------------------------------------------------------- | | ||
| | `username` | No | `str` | | The user's SRN or PRN | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Description
This PR removes the deprecated
knowYourClassAndSectionfeature because the corresponding PESU Academy endpoint,/Academy/a/getStudentClassInfo, no longer works.The removal includes:
knowYourClassAndSectionfrom the authentication request schema.knowYourClassAndSectionfrom the authentication response schema.Requests containing
knowYourClassAndSectionare now treated like any other unknown request field and return a400validation response.🧱 Type of Change
requirements.txt,pyproject.toml🧪 How Has This Been Tested?
tests/unit/)tests/functional/)tests/integration/)Testing performed:
uv run pytest -m 'not secret_required'TEST_*credentials were unavailable.uv run ruff check .knowYourClassAndSectionis absent from both request and response models.✅ Checklist
scripts/run_tests.py)pre-commit run --all-files).envvars updated (if applicable)scripts/benchmark/benchmark_requests.py)🛠️ Affected API Behaviour
app/app.py– Modified/authenticateroute logicapp/pesu.py– Updated scraping or authentication handling🧩 Models
app/models/request.py– Input validation or request schema changesapp/models/response.py– Authentication response formattingapp/models/profile.py– Profile extraction logic🐳 DevOps & Config
Dockerfile– Changes to base image or build process.github/workflows/*.yaml– CI/CD pipeline or deployment updatespyproject.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 flagscripts/benchmark/analyze_benchmark.py– Benchmark result analysis changesscripts/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.