Skip to content

Better validate various backend parameters - #3555

Merged
emma-sg merged 3 commits into
mainfrom
backend-schedule-crawl-id-validation
Aug 1, 2026
Merged

Better validate various backend parameters#3555
emma-sg merged 3 commits into
mainfrom
backend-schedule-crawl-id-validation

Conversation

@emma-sg

@emma-sg emma-sg commented Aug 1, 2026

Copy link
Copy Markdown
Member

Changes

Implements some validations on the backend (some of which are present on the frontend) so that errors happen earlier. Primarily, crawl schedules are now properly validated! I ended up writing a little validator myself based on https://github.com/robfig/cron, the library that k8s uses.

This also better validates crawl IDs for the /pages/reAdd endpoints, and adds some constraints to the crawlFilenameTemplate parameter as well.

Testing

These changes should all be pretty well tested by the unit & integration tests added.

You can test the validation with API calls from your browser's dev tools (or curl, or whatever) with an invalid schedule to the create or update workflow endpoints.

@emma-sg
emma-sg marked this pull request as ready for review August 1, 2026 02:31
@emma-sg
emma-sg requested a review from ikreymer August 1, 2026 02:44

@ikreymer ikreymer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! Thank you for adding!
The cron schedule validator is perhaps more thorough than needed, but I guess can adjust later.

@emma-sg
emma-sg merged commit cd0577a into main Aug 1, 2026
46 checks passed
@emma-sg
emma-sg deleted the backend-schedule-crawl-id-validation branch August 1, 2026 05:12
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.

2 participants