How to use the sourcegraph.NotificationType function in sourcegraph

To help you get started, we’ve selected a few sourcegraph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / dependencyRules.ts View on Github external
.map(([depName, depStatus]) => ({
                                title:
                                    depStatus === DependencyStatus.Unreviewed
                                        ? `Unreviewed npm dependency in use: ${depName}`
                                        : `Forbidden npm dependency in use: ${depName}`,
                                type:
                                    depStatus === DependencyStatus.Unreviewed
                                        ? sourcegraph.NotificationType.Warning
                                        : sourcegraph.NotificationType.Error,
                            })),
                    }
github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / sampleStatus.ts View on Github external
import * as sourcegraph from 'sourcegraph'
import { Unsubscribable, Subscription } from 'rxjs'

const STATUSES: (sourcegraph.Status & { name: string })[] = [
    {
        name: 'code-churn',
        title: 'Code churn',
        state: {
            completion: sourcegraph.CheckResult.Completed,
            result: sourcegraph.CheckResult.ActionRequired,
            message: 'High code churn detected',
        },
        notifications: [
            { title: 'my notif1', type: sourcegraph.NotificationType.Info },
            { title: 'my notif2', type: sourcegraph.NotificationType.Error },
        ],
    },
]

export function registerSampleStatusProviders(): Unsubscribable {
    const subscriptions = new Subscription()
    for (const status of STATUSES) {
        subscriptions.add(
            sourcegraph.status.registerStatusProvider(status.name, {
                provideStatus: () => status,
            })
        )
    }
    return subscriptions
}
github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / travisGo.ts View on Github external
switchMap(async diagnostics => [
                        {
                            message: 'Build failures on default branch',
                            type: sourcegraph.NotificationType.Error,
                            actions: [
                                {
                                    command: {
                                        command: 'TODO!(sqs)',
                                        title: 'sourcegraph/codeintellify (31 minutes ago)',
                                    },
                                },
                                {
                                    command: {
                                        command: 'TODO!(sqs)',
                                        title: 'sourcegraph/go-diff (7 hours ago)',
                                    },
                                },
                                {
                                    command: {
                                        command: 'TODO!(sqs)',
github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / travisGo.ts View on Github external
],
                                              },
                                          },
                                          {
                                              command: {
                                                  command: 'TODO!(sqs)',
                                                  title: 'Change preferred Go version (1.13)',
                                              },
                                          },
                                      ],
                                  },
                              ]
                            : []) as sourcegraph.Notification[]),
                        {
                            message: 'Missing Travis CI configuration',
                            type: sourcegraph.NotificationType.Warning,
                            actions: [
                                {
                                    plan: {
                                        title: 'Infer .travis.yml (best-effort) for repositories lacking it',
                                        operations: [
                                            {
                                                command: {
                                                    command: 'TODO!(sqs)',
                                                },
                                            },
                                        ],
                                    },
                                },
                            ],
                        },
                    ])
github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / sampleStatus.ts View on Github external
import * as sourcegraph from 'sourcegraph'
import { Unsubscribable, Subscription } from 'rxjs'

const STATUSES: (sourcegraph.Status & { name: string })[] = [
    {
        name: 'code-churn',
        title: 'Code churn',
        state: {
            completion: sourcegraph.CheckResult.Completed,
            result: sourcegraph.CheckResult.ActionRequired,
            message: 'High code churn detected',
        },
        notifications: [
            { title: 'my notif1', type: sourcegraph.NotificationType.Info },
            { title: 'my notif2', type: sourcegraph.NotificationType.Error },
        ],
    },
]

export function registerSampleStatusProviders(): Unsubscribable {
    const subscriptions = new Subscription()
    for (const status of STATUSES) {
        subscriptions.add(
            sourcegraph.status.registerStatusProvider(status.name, {
                provideStatus: () => status,
            })
        )
    }
    return subscriptions
}
github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / eslint.ts View on Github external
.map(([ruleId, rulePolicy]) => ({
                                message: ruleId,
                                type:
                                    rulePolicy === RulePolicy.Default
                                        ? sourcegraph.NotificationType.Warning
                                        : sourcegraph.NotificationType.Error,
                            }))
                        return notifications