Fix CourseBook term validation to accept uppercase semesters and reject partial matches
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
Línea de trabajo
Empieza por la declaración de termRegex y su llamada a MatchString en scrapers/coursebook.go, donde ScrapeCoursebook valida el término antes de la configuración. Lee el ejemplo del README que usa -term 24F para confirmar la entrada esperada. Está terminado cuando 24F, 24f, 26S y 26u se aceptan y se normalizan a minúsculas, y 4f, 124f, 24fextra, abc24f y 24X se rechazan con un error claro antes de que se inicie el navegador.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
CourseBook term validation uses the unanchored regex [0-9]{1,2}[sfu] in scrapers/coursebook.go.
This causes two problems:
- Uppercase terms such as
24F, as documented in the README, are rejected. - Malformed terms such as
4f,124f, and24fextrapass validation because the regex accepts a matching substring.
Expected behavior:
- Accept exactly two digits followed by
S,U, orF, case-insensitively. - Normalize accepted terms to the lowercase format used by the CourseBook scraper before further processing.
- Reject malformed terms with a clear error before initializing the browser or making requests.
Steps To Reproduce
- Build the executable with
make build(orbuild.bat buildon Windows). - Run the documented command:
./api-tools -scrape -coursebook -term 24F - Observe that validation rejects the uppercase semester.
- Inspect
termRegexand itsMatchStringcall inscrapers/coursebook.go: the pattern also accepts4f,124f, and24fextra.
Malformed values that pass validation proceed toward browser initialization, so inspecting the regex is sufficient to confirm that behavior without starting a scrape.
Additional Context
Starting points:
- scrapers/coursebook.go:
termRegexandScrapeCoursebook. - README.md: the scraping example uses
-term 24F.
Suggested manual checks:
- Accept
24F,24f,26S, and26u. - Reject
4f,124f,24fextra,abc24f, and24X. - Confirm accepted terms reach scraper setup in the same normalized format.
Keep this task limited to term validation and normalization. Broader scraper error handling is covered by #192.
Environment
Identified by source inspection of commit 3f3585e; not reproduced by executing the scraper. The regex behavior is platform-independent.
- Lenguaje dominante
- Go
- Estrellas
- 12
- Forks
- 54
- Merge medio
- 14 d 1 h
- PR fusionados (30 d)
- 1
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de UTDNebula/api-tools
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Improve unit tests in sectionParser_test.goPosiblemente ocupada @Sidd-Pelluru la tomó hace 42 días. AbiertoL1 recommended for recruits
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Improve unit tests in discountsParser_test.goQuizá libre de nuevo @LikithInam la tomó hace 28 días y no hay ningún pull request abierto. AbiertoL1 recommended for recruits
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
L1 recommended for recruits
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
Comet Calendar events with multiple locationsPosiblemente ocupada @azythromycin la tomó hace 22 días. AbiertoL1 Type: Bug Report
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Todos los issues de UTDNebula/api-tools
Issues similares
-
agent-butler-finding bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
jordansmall/spindrift#6414 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Icinga/icinga-kubernetes#294 ·
Los mantenedores suelen responder en 4 días
-
Cluster details: the Control Plane version field has a different border color than its icon boxAbiertokind/design sig/ui
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
kubermatic/dashboard#8449 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
filecoin-project/curio#1632 ·
Los mantenedores suelen responder en 1 día