-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated release blog post template and added script for generating co…
…ntributors. Contributors = non-Sourcegraphers that raised an issue.
- Loading branch information
1 parent
93e1d68
commit f94897f
Showing
5 changed files
with
146 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
yarn.lock | ||
.yarn-integrity | ||
docs/server/config/site.md | ||
.idea |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
// Generate a list of non-Sourcegraph contributors for this release | ||
// | ||
// Usage: GO111MODULE=on go run bin/generate_contributors.go | ||
// | ||
|
||
package main | ||
|
||
import ( | ||
"bufio" | ||
"context" | ||
"fmt" | ||
"log" | ||
"os" | ||
"time" | ||
|
||
"github.com/google/go-github/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) | ||
"golang.org/x/oauth2" | ||
) | ||
|
||
type IssueAuthorDetails struct { | ||
handle string | ||
url string | ||
} | ||
|
||
func main() { | ||
ctx := context.Background() | ||
ts := oauth2.StaticTokenSource( | ||
&oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")}, | ||
) | ||
tc := oauth2.NewClient(ctx, ts) | ||
client := github.NewClient(tc) | ||
repos := [...]string{"deploy-sourcegraph", "lang-typescript", "sourcegraph", "about", "go-langserver", "lang-go", "lang-python", "sourcegraph-basic-code-intel", "python-language-server"} | ||
|
||
// Date of last release | ||
fmt.Print("Last release date (yyyy-mm-dd): ") | ||
dateInput, _ := bufio.NewReader(os.Stdin).ReadString('\n') | ||
lastReleaseDate := fmt.Sprintf("%s%s", dateInput[:len(dateInput)-1], "T12:00:00.000Z") | ||
|
||
// (HACK): Generate list of Sourcegraphers to exclude from the list of contributors | ||
// | ||
// To manually re-generate the `sourcegraphers` map: | ||
// Go to https://github.com/orgs/sourcegraph/teams/team/members | ||
// Run this code in the console | ||
// | ||
// let sourcegraphers = []; | ||
// window.document.querySelectorAll('li.table-list-item').forEach( | ||
// el => sourcegraphers.push(`"${el.dataset.bulkActionsId.trim()}": "",`) | ||
// ) | ||
// copy(`sourcegraphers := map[string]string{\n${sourcegraphers.join('\n ')}\n}`) | ||
// | ||
// TODO: Replace with API call as part of the running of this script | ||
sourcegraphers := map[string]string{ | ||
"ryan-blunden": "", | ||
"felixfbecker": "", | ||
"attfarhan": "", | ||
"vanesa": "", | ||
"nicksnyder": "", | ||
"lguychard": "", | ||
"sqs": "", | ||
"renovate[bot]": "", | ||
"keegancsmith": "", | ||
"beyang": "", | ||
"chrismwendt": "", | ||
"dadlerj": "", | ||
"ggilmore": "", | ||
"KattMingMing": "", | ||
"slimsag": "", | ||
"tsenart": "", | ||
"kevinzliu": "", | ||
"ijt": "", | ||
"renovate": "", | ||
"bot": "", | ||
"todo": "", | ||
} | ||
|
||
issueDate, err := time.Parse(time.RFC3339, lastReleaseDate) | ||
if err != nil { | ||
log.Fatal("error parsing date", err) | ||
return | ||
} | ||
contributors := make(map[string]IssueAuthorDetails) | ||
page := 0 | ||
|
||
// First print via repo | ||
for _, repo := range repos { | ||
|
||
for page < 15 { | ||
opts := &github.IssueListByRepoOptions{Since: issueDate, ListOptions: github.ListOptions{PerPage: 100, Page: page}} | ||
issues, _, err := client.Issues.ListByRepo(ctx, "sourcegraph", repo, opts) | ||
if err != nil { | ||
log.Fatal("error fetching repo", err) | ||
return | ||
} | ||
|
||
if len(issues) == 0 { | ||
break | ||
} | ||
|
||
for _, issue := range issues { | ||
if _, ok := sourcegraphers[*issue.User.Login]; ok { | ||
continue | ||
} | ||
|
||
contributors[*issue.User.Login] = IssueAuthorDetails{handle: *issue.User.Login, url: *issue.User.HTMLURL} | ||
} | ||
page++ | ||
} | ||
} | ||
|
||
for _, contributor := range contributors { | ||
fmt.Println(fmt.Sprintf("- [@%s](%s)", contributor.handle, contributor.url)) | ||
} | ||
} |
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,9 @@ | ||
module github.com/sourcegraph/about | ||
|
||
go 1.12 | ||
|
||
require ( | ||
github.com/google/go-github v17.0.0+incompatible // indirect | ||
github.com/google/go-querystring v1.0.0 // indirect | ||
golang.org/x/oauth2 v0.0.0-20190517181255-950ef44c6e07 // indirect | ||
) |
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,14 @@ | ||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= | ||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | ||
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= | ||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= | ||
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= | ||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= | ||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= | ||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||
golang.org/x/oauth2 v0.0.0-20190517181255-950ef44c6e07 h1:XC1K3wNjuz44KaI+cj85C9TW85w/46RH7J+DTXNH5Wk= | ||
golang.org/x/oauth2 v0.0.0-20190517181255-950ef44c6e07/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | ||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= |