-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1792 from reviewdog/metadata-comment
Introduce comment metadata and fingerprint for identifying existing posted comments
- Loading branch information
Showing
12 changed files
with
336 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
protoc --proto_path=./rdf --go_out=./rdf --go_opt=paths=source_relative --jsonschema_out=./rdf/jsonschema ./rdf/reviewdog.proto | ||
protoc --proto_path=./metacomment --go_out=./metacomment --go_opt=paths=source_relative ./metacomment/metacomment.proto |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
syntax = "proto3"; | ||
package reviewdog.rdf; | ||
|
||
option go_package = "github.com/reviewdog/reviewdog/proto/metacomment"; | ||
|
||
// Represents a metadata of a diagnostic result. | ||
// It's expected to be base64 encoded and included into reporter comments such | ||
// as GitHub Pull Request Review comment. | ||
// | ||
// This metadata allow reviewdog to identify the same existing comment and | ||
// avoid posting duplicated comments. It can also be used for resolving or | ||
// deleting existing comments. | ||
message MetaComment { | ||
// An unique identity, or "fingerprint", of the diagnostic result. | ||
string fingerprint = 1; | ||
|
||
// Source (tool) name of the diagnostic result. | ||
// It's important to have source name so that reviewdog can handle existing | ||
// comments with the same source properly. | ||
string source_name = 2; | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
"github.com/reviewdog/reviewdog/service/github" | ||
) | ||
|
||
func main() { | ||
if len(os.Args) == 1 { | ||
log.Fatal("require one argument") | ||
} | ||
meta, err := github.DecodeMetaComment(os.Args[1]) | ||
if err != nil { | ||
log.Fatalf("failed to decode meta comment: %v", err) | ||
} | ||
fmt.Printf("%v\n", meta) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.