Task description
Define validation for the GitHub Node URL input form.
Background
Currently, the application throws an "Invalid GitHub URL" error when an invalid URL is entered in the GitHub Node's URL input form. This indicates a lack of proper input validation. We need to implement client-side validation to prevent these errors and provide a better user experience.
TODO (Optional)
Additional notes (Optional)
- The relevant file for the core logic seems to be:
studio.giselles.ai/../../packages/giselle-engine/src/core/github/url-to-object-id.ts.
- The error propagates through multiple layers of the application, highlighting the need for robust validation at both the input and processing stages.
- Consider using a library like
validator.js or zod for more complex validation scenarios, if necessary. A simple regular expression may be sufficient, however.
- Ensure the server-side error handling provides the user a clear, useful error response that helps them correct their input.
Sentry Error Messages:
Error: Invalid GitHub URL
File "studio.giselles.ai/../../packages/giselle-engine/src/core/github/url-to-object-id.ts", line 16, in urlToObjectID
throw new Error("Invalid GitHub URL");
File "studio.giselles.ai/../../packages/giselle-engine/src/core/index.ts", line 97, in <object>.githubUrlToObjectId
return await urlToObjectID({
File "studio.giselles.ai/../../packages/giselle-engine/src/http/router.ts", line 143, in <object>.handler
const objectId = await giselleEngine.githubUrlToObjectId(input.url);
File "studio.giselles.ai/../../packages/giselle-engine/src/http/create-handler.ts", line 52, in Object.githubUrlToObjectId
return await handler({
File "studio.giselles.ai/../../packages/giselle-engine/src/next/next-giselle-engine.ts", line 79, in <anonymous>
return await jsonRouter[routerPath]({
...
(5 additional frame(s) were not displayed)
Task description
Define validation for the GitHub Node URL input form.
Background
Currently, the application throws an "Invalid GitHub URL" error when an invalid URL is entered in the GitHub Node's URL input form. This indicates a lack of proper input validation. We need to implement client-side validation to prevent these errors and provide a better user experience.
TODO (Optional)
urlToObjectIDfunction ingiselle-engine/src/core/github/url-to-object-id.ts.Additional notes (Optional)
studio.giselles.ai/../../packages/giselle-engine/src/core/github/url-to-object-id.ts.validator.jsorzodfor more complex validation scenarios, if necessary. A simple regular expression may be sufficient, however.Sentry Error Messages: