examiner

package
v0.0.0-...-b95a7b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDownloadedPackagesExaminer

func NewDownloadedPackagesExaminer(ctx context.Context, trustedScopes []string, httpClient *http.Client, dbClient types.NpmDB, projectMirror types.ProjectMirror, issueTrackerConfig *config.IssueTrackerConfig) (types.DownloadedPackagesExaminer, error)

NewDownloadedPackagesExaminer returns an instance of DownloadedPackagesExaminer.

Types

type DownloadedPackagesExaminer

type DownloadedPackagesExaminer struct {
	// contains filtered or unexported fields
}

DownloadedPackagesExaminer implements types.DownloadedPackagesExaminer

func (*DownloadedPackagesExaminer) StartExamination

func (dpe *DownloadedPackagesExaminer) StartExamination(ctx context.Context, pollInterval time.Duration)

StartExamination will examine all the downloaded packages of the mirror. For each downloaded package: * Check to see if it has a trusted scope. If it does then continue with next package. * Check the package against the global NPM registry to see if has been created less than a week ago. * If above check is true then:

  • Check in the DB to see if an examiner issue has been filed for this project+package.
  • If issue has not been filed:
  • File a new issue and add it to the DB.
  • Else if issue has been filed:
  • Check to see if the issue has been closed.
  • If issue is closed:
  • Check to see if the issue is closed more than fileExaminerIssueAfterThreshold duration ago.
  • If it is older then file a new issue and add it to the DB.
  • Else do nothing.
  • Else if issue is still open then do nothing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL