-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
User story
At the moment the Issue type only accepts SourceFileLocation like follows:
const sourceFileLocationSchema = z.object(
{
file: filePathSchema.describe('Relative path to source file in Git repo'),
position: z
.object(
{
startLine: positiveIntSchema.describe('Start line'),
startColumn: positiveIntSchema.describe('Start column').optional(),
endLine: positiveIntSchema.describe('End line').optional(),
endColumn: positiveIntSchema.describe('End column').optional(),
},
{ description: 'Location in file' },
)
.optional(),
});
export const issueSchema = z.object(
{
// ...
source: sourceFileLocationSchema.optional(),
}
);As some of problems could be HTML under a rendered URL we could consider this format as additional issue location.
A example for the above described case could be CLS elements within a page measured by the cumulative-layout-shifts audit.
Acceptance criteria
- The
modelspackage extends the model for issue location withsourceUrlLocationSchema - The
clipackage uploads the new data to the backend - The
portaldisplays the new data
Implementation details
const sourceUrlLocationSchema = z.object(
{
url: urlSchema.describe('Url in the browser'),
snippet: z.string({ description: 'HTMl. snippet in rendered URL' })
});
export const issueSchema = z.object(
{
// ...
source: z.union([sourceFileLocationSchema, sourceUrlLocationSchema]).optional(),
}
);