How to use the sourcegraph.status 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 / travisGo.ts View on Github external
function registerStatusProvider(
    diagnostics: Observable<[URL, sourcegraph.Diagnostic[]][]>,
    diagnosticCollection: sourcegraph.DiagnosticCollection
): Unsubscribable {
    const subscriptions = new Subscription()
    subscriptions.add(
        sourcegraph.status.registerStatusProvider('travis-ci', {
            provideStatus: (scope): sourcegraph.Subscribable => {
                // TODO!(sqs): dont ignore scope
                return diagnostics.pipe(
                    switchMap<[URL, sourcegraph.Diagnostic[]][], Promise>(async diagnostics => ({
                        title: 'Travis CI',
                        state: {
                            completion: sourcegraph.CheckResult.Completed,
                            result: sourcegraph.CheckResult.Success,
                            message: 'All builds passing, all repository configuration valid and up-to-date',
                        },
                        sections: {
                            settings: {
                                kind: sourcegraph.MarkupKind.Markdown,
                                value: `Require all projects to configure Travis CI`,
                            },
                            notifications: {
github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / dependencyRules.ts View on Github external
export function registerDependencyRules(): Unsubscribable {
    const subscriptions = new Subscription()
    subscriptions.add(startDiagnostics())
    subscriptions.add(
        sourcegraph.status.registerStatusProvider('npm-dependency-security', createStatusProvider(diagnostics))
    )
    subscriptions.add(sourcegraph.languages.registerCodeActionProvider(['*'], createCodeActionProvider()))
    return subscriptions
}
github sourcegraph / sourcegraph / extensions / enterprise / check-search / src / sampleStatus.ts View on Github external
export function registerSampleStatusProviders(): Unsubscribable {
    const subscriptions = new Subscription()
    for (const status of STATUSES) {
        subscriptions.add(
            sourcegraph.status.registerStatusProvider(status.name, {
                provideStatus: () => status,
            })
        )
    }
    return subscriptions
}