Skip to content

New Source Type for URLs #677

@BioPhoton

Description

@BioPhoton

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 models package extends the model for issue location with sourceUrlLocationSchema
  • The cli package uploads the new data to the backend
  • The portal displays 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(),
  }
);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions