Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions column.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
[
{
"url": "https://github.com/api/projects/columns/cards/71283249",
"project_url": "https://github.com/api/projects/12696765",
"id": 71283249,
"node_id": "PRC_lADOAjTo384Awby9zgQ_sjE",
"note": null,
"archived": false,
"creator": {
"login": "princerachit",
"id": 32481722,
"node_id": "MDQ6VXNlcjMyNDgxNzIy",
"avatar_url": "https://avatars.githubusercontent.com/u/32481722?u=638e24474e29bafde3ac9216349ad5ed2db80b03&v=4",
"gravatar_id": "",
"url": "https://github.com/api/users/princerachit",
"html_url": "https://github.com/princerachit",
"followers_url": "https://github.com/api/users/princerachit/followers",
"following_url": "https://github.com/api/users/princerachit/following{/other_user}",
"gists_url": "https://github.com/api/users/princerachit/gists{/gist_id}",
"starred_url": "https://github.com/api/users/princerachit/starred{/owner}{/repo}",
"subscriptions_url": "https://github.com/api/users/princerachit/subscriptions",
"organizations_url": "https://github.com/api/users/princerachit/orgs",
"repos_url": "https://github.com/api/users/princerachit/repos",
"events_url": "https://github.com/api/users/princerachit/events{/privacy}",
"received_events_url": "https://github.com/api/users/princerachit/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2021-10-21T09:48:27Z",
"updated_at": "2021-10-21T09:48:53Z",
"column_url": "https://github.com/api/projects/columns/14782120",
"content_url": "https://github.com/api/repos/gitpod-io/gitpod/issues/6332"
},
{
"url": "https://github.com/api/projects/columns/cards/71283442",
"project_url": "https://github.com/api/projects/12696765",
"id": 71283442,
"node_id": "PRC_lADOAjTo384Awby9zgQ_svI",
"note": null,
"archived": false,
"creator": {
"login": "princerachit",
"id": 32481722,
"node_id": "MDQ6VXNlcjMyNDgxNzIy",
"avatar_url": "https://avatars.githubusercontent.com/u/32481722?u=638e24474e29bafde3ac9216349ad5ed2db80b03&v=4",
"gravatar_id": "",
"url": "https://github.com/api/users/princerachit",
"html_url": "https://github.com/princerachit",
"followers_url": "https://github.com/api/users/princerachit/followers",
"following_url": "https://github.com/api/users/princerachit/following{/other_user}",
"gists_url": "https://github.com/api/users/princerachit/gists{/gist_id}",
"starred_url": "https://github.com/api/users/princerachit/starred{/owner}{/repo}",
"subscriptions_url": "https://github.com/api/users/princerachit/subscriptions",
"organizations_url": "https://github.com/api/users/princerachit/orgs",
"repos_url": "https://github.com/api/users/princerachit/repos",
"events_url": "https://github.com/api/users/princerachit/events{/privacy}",
"received_events_url": "https://github.com/api/users/princerachit/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2021-10-21T09:51:18Z",
"updated_at": "2021-10-21T09:51:24Z",
"column_url": "https://github.com/api/projects/columns/14782120",
"content_url": "https://github.com/api/repos/gitpod-io/gitpod/issues/6333"
},
{
"url": "https://github.com/api/projects/columns/cards/71295524",
"project_url": "https://github.com/api/projects/12696765",
"id": 71295524,
"node_id": "PRC_lADOAjTo384Awby9zgQ_4iQ",
"note": null,
"archived": false,
"creator": {
"login": "JanKoehnlein",
"id": 377752,
"node_id": "MDQ6VXNlcjM3Nzc1Mg==",
"avatar_url": "https://avatars.githubusercontent.com/u/377752?u=6e97b016434e7f4957702e03a4e63f116abc8576&v=4",
"gravatar_id": "",
"url": "https://github.com/api/users/JanKoehnlein",
"html_url": "https://github.com/JanKoehnlein",
"followers_url": "https://github.com/api/users/JanKoehnlein/followers",
"following_url": "https://github.com/api/users/JanKoehnlein/following{/other_user}",
"gists_url": "https://github.com/api/users/JanKoehnlein/gists{/gist_id}",
"starred_url": "https://github.com/api/users/JanKoehnlein/starred{/owner}{/repo}",
"subscriptions_url": "https://github.com/api/users/JanKoehnlein/subscriptions",
"organizations_url": "https://github.com/api/users/JanKoehnlein/orgs",
"repos_url": "https://github.com/api/users/JanKoehnlein/repos",
"events_url": "https://github.com/api/users/JanKoehnlein/events{/privacy}",
"received_events_url": "https://github.com/api/users/JanKoehnlein/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2021-10-21T12:53:24Z",
"updated_at": "2021-10-21T12:54:18Z",
"column_url": "https://github.com/api/projects/columns/14782120",
"content_url": "https://github.com/api/repos/gitpod-io/gitpod/issues/6320"
},
{
"url": "https://github.com/api/projects/columns/cards/71361247",
"project_url": "https://github.com/api/projects/12696765",
"id": 71361247,
"node_id": "PRC_lADOAjTo384Awby9zgRA4t8",
"note": null,
"archived": false,
"creator": {
"login": "csweichel",
"id": 3210701,
"node_id": "MDQ6VXNlcjMyMTA3MDE=",
"avatar_url": "https://avatars.githubusercontent.com/u/3210701?u=34b34ff0b896f1be0e5d1c8777210d1a995b762e&v=4",
"gravatar_id": "",
"url": "https://github.com/api/users/csweichel",
"html_url": "https://github.com/csweichel",
"followers_url": "https://github.com/api/users/csweichel/followers",
"following_url": "https://github.com/api/users/csweichel/following{/other_user}",
"gists_url": "https://github.com/api/users/csweichel/gists{/gist_id}",
"starred_url": "https://github.com/api/users/csweichel/starred{/owner}{/repo}",
"subscriptions_url": "https://github.com/api/users/csweichel/subscriptions",
"organizations_url": "https://github.com/api/users/csweichel/orgs",
"repos_url": "https://github.com/api/users/csweichel/repos",
"events_url": "https://github.com/api/users/csweichel/events{/privacy}",
"received_events_url": "https://github.com/api/users/csweichel/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2021-10-22T08:43:46Z",
"updated_at": "2021-10-22T08:43:52Z",
"column_url": "https://github.com/api/projects/columns/14782120",
"content_url": "https://github.com/api/repos/gitpod-io/gitpod/issues/4848"
},
{
"url": "https://github.com/api/projects/columns/cards/71361350",
"project_url": "https://github.com/api/projects/12696765",
"id": 71361350,
"node_id": "PRC_lADOAjTo384Awby9zgRA40Y",
"note": null,
"archived": false,
"creator": {
"login": "csweichel",
"id": 3210701,
"node_id": "MDQ6VXNlcjMyMTA3MDE=",
"avatar_url": "https://avatars.githubusercontent.com/u/3210701?u=34b34ff0b896f1be0e5d1c8777210d1a995b762e&v=4",
"gravatar_id": "",
"url": "https://github.com/api/users/csweichel",
"html_url": "https://github.com/csweichel",
"followers_url": "https://github.com/api/users/csweichel/followers",
"following_url": "https://github.com/api/users/csweichel/following{/other_user}",
"gists_url": "https://github.com/api/users/csweichel/gists{/gist_id}",
"starred_url": "https://github.com/api/users/csweichel/starred{/owner}{/repo}",
"subscriptions_url": "https://github.com/api/users/csweichel/subscriptions",
"organizations_url": "https://github.com/api/users/csweichel/orgs",
"repos_url": "https://github.com/api/users/csweichel/repos",
"events_url": "https://github.com/api/users/csweichel/events{/privacy}",
"received_events_url": "https://github.com/api/users/csweichel/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2021-10-22T08:44:51Z",
"updated_at": "2021-10-22T08:44:58Z",
"column_url": "https://github.com/api/projects/columns/14782120",
"content_url": "https://github.com/api/repos/gitpod-io/gitpod/issues/6352"
}
]
5 changes: 5 additions & 0 deletions config/projectmanager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ orgsRepos:
labels:
- "groundwork: awaiting deployment"
state: "closed"
- id: 14782155
org: "gitpod-io"
labels:
- "groundwork: deployed"
state: "closed"
"gitpod-io/gitpod-test-repo":
projects:
"Groundwork Test":
Expand Down
1 change: 1 addition & 0 deletions plugins/common/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
func FindCardByIssueURL(gh github.Client, org, repo string, number int, col int) (cardID *int, err error) {
issueURL := fmt.Sprintf("https://github.com/api/repos/%s/%s/issues/%v", org, repo, number)

// Funny fact: this also returns cards from other columns, even in other projects
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

inboxCards, err := gh.GetColumnProjectCards(org, col)
if err != nil {
return
Expand Down
2 changes: 1 addition & 1 deletion plugins/projectmanager/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex

export TAG=cw-dev
export TAG=dev

cp -rf ../common common
docker build -t eu.gcr.io/gitpod-core-dev/prow/projectmanager:$TAG .
Expand Down
7 changes: 6 additions & 1 deletion plugins/projectmanager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ func (s *server) updateMatchingColumn(ie github.IssueEvent, log *logrus.Entry) e

for projectName, managedProject := range managedOrgRepo.Projects {
for _, managedColumn := range managedProject.Columns {
log.Infof("Project %s Column: %d (%s)", projectName, *managedColumn.ID, managedColumn.Labels)
if managedColumn.ID == nil {
log.Infof("Ignoring column: {%v}, has no columnID", managedColumn, e.number, e.org)
continue
}
// Org is not specified or does not match we just ignore processing this column
if managedColumn.Org == "" || managedColumn.Org != e.org {
Expand All @@ -323,15 +325,18 @@ func (s *server) updateMatchingColumn(ie github.IssueEvent, log *logrus.Entry) e
continue
}

cardID, err := common.FindCardByIssueURL(gc, orgRepoName, projectName, e.number, *managedColumn.ID)
log.Infof("Searching for card for issue #%d for in column: %d", e.number, *managedColumn.ID)
cardID, err := common.FindCardByIssueURL(gc, orgRepoName, e.repo, e.number, *managedColumn.ID)
if err != nil {
log.Infof("Cannot add the issue/PR: %d to the project: %s, column: %s, error: %s", e.number, projectName, managedColumn.ID, err)
break
}

if cardID == nil {
log.Infof("No such card. Creating a new one")
err = addIssueToColumn(gc, *managedColumn.ID, e)
} else {
log.Infof("Found card %d, moving", cardID)
err = common.MoveProjectCard(s.githubTokenGenerator, e.org, *cardID, *managedColumn.ID, "bottom")
}
if err != nil {
Expand Down