Skip to content

Update identifier validation logic for run method #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Apr 17, 2023

Replicate validates owner and model names using the naming rules for Docker images.

The current regex pattern used to validate identifiers passed to run doesn't account for hyphens (-) or full stops (.), and incorrectly throws an error for valid identifiers like cjwbw/anything-v4.0:42a996d39a96aedc57b2e0aa8105dea39c9c89d9d266caf6bb4327a1c191b061.

This PR updates the regex pattern to be in line with Replicate naming rules, and adds test coverage to ensure correct behavior.

@mattt mattt merged commit f1c725f into main Apr 17, 2023
@mattt mattt deleted the mattt/fix-run-identifier-validation branch April 17, 2023 13:35
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