-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: initial r/gh
realm
#1134
base: master
Are you sure you want to change the base?
feat: initial r/gh
realm
#1134
Conversation
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
8a8ea33
to
8760b6a
Compare
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #1134 +/- ##
=======================================
Coverage 47.08% 47.08%
=======================================
Files 365 365
Lines 61156 61156
=======================================
Hits 28793 28793
Misses 30011 30011
Partials 2352 2352
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -0,0 +1 @@ | |||
module gno.land/r/gh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing require
?
module gno.land/r/gh | |
module gno.land/r/gh | |
require "gno.land/p/demo/avl" v0.0.0-latest | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gno lint
should complain?
anyways gno mod tidy
implementation is complete. CI will start complaining about this soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harry-hov: We need a solution to eliminate those comments. The gno mod
process should be fully automated, from creation to clarity in CI feedback. Please ensure it's streamlined so you don't have to review this aspect in future PRs. Otherwise, we might just bypass the need for gno.mod and switch to automatic detection.
I really love this idea, it'll also give a home to some of the Python scripts that are being messed around with. I always figured everything would eventually need to be ported over to Gno, in Python we have GitHub CI calculating different averages and other additional metrics/statistics if that'd be helpful to try to bring over into this instead. Or after a certain point should pulling a wider range of stats like that be its own system? Maybe it'd be overkill to provide too many categories by default via an oracle? I also still agree that initially just creating a database itself based on both GitHub and blockchain metrics will be ideal, with point rewards staying largely manual. Could lead to a bunch of cool systems down the road and something like this would make facilitating and experimenting with all of that way easier. If nothing else it'll lead to some cool data study ideas! Maybe one day leading to further automations as enough training data is built up, and a great building block well before that. What are your thoughts in terms of how the metrics themselves/database should be stored or output for use elsewhere? Maybe even a Chainstack-style RPC that can return the data in a bunch of different formats? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure I'm reading it correctly, we'd be creating our own oracle from scratch and assigning it to an address within this code? Seems like it'd give us some really cool possibilities even beyond what I was initially thinking.
// Account represents a GitHub user account or organization. | ||
type Account struct { | ||
id string | ||
name string | ||
kind string | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. What about having types User, Organization, and type Handle interface { Name() string; URL() string; assertHandle() }
? Or Namespace
|
||
/* | ||
// IssueOrPR represents a GitHub issue or pull request | ||
type IssueOrPR struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this, I think we should have type Issue
and type PR
, which embeds Issue, Issue implements type Referencer interface { Reference() string }
, returns "#1134"
(feel free to ignore, I think the comment makes it clear that you want to tackle this in another PR)
|
||
// Account represents a GitHub user account or organization. | ||
type Account struct { | ||
id string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle?
} | ||
|
||
func (a Account) String() string { | ||
// XXX: better idea? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either @handle
or markdown representation?
|
||
func OracleLastUpdated() time.Time { return lastUpdateTime } | ||
|
||
func OracleUpsertAccount(id, name, kind string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upsert feels sql-y, when under the hood we just have a k-v. Can we not do Set
?
id string | ||
owner *Account | ||
name string | ||
isPrivate bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's private, the oracle probably shouldn't know about it, right?
parts := strings.Split(id, "/") | ||
if len(parts) != 2 { | ||
panic("invalid id") | ||
} | ||
ownerID := parts[0] | ||
name := parts[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add util func, de-duplicate from above?
accounts.Set(id, account) | ||
} | ||
|
||
func OracleUpsertRepo(id string, isPrivate, isFork bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/id/path/
accounts avl.Tree // uri -> Account | ||
repos avl.Tree // uri -> Repo | ||
issueOrPRs avl.Tree // uri -> IssueOrPR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they're not uris
Related with #1265 |
## Current Status ```console $ cd ./misc/list-gnophers $ ./main.sh ``` ```csv 1617467419,53785+jaekwon@users.noreply.github.com,./examples/gno.land/p/demo/flow/flow.gno 1651096034,94029+moul@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc721/igrc721.gno 1673524438,hariom.verma@tendermint.com,./examples/gno.land/p/demo/grc/grc721/basic_nft.gno 1677669053,100383075+Jammyaa@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc1155/basic_grc1155_token.gno 1678259597,350354+grepsuzette@users.noreply.github.com,./examples/gno.land/r/demo/deep/very/deep/render.gno 1678709422,pushkarshetye803@gmail.com,./examples/gno.land/r/demo/groups/group.gno 1684921090,contact@albttx.tech,./examples/gno.land/p/demo/merkle/merkle.gno 1687179019,nir1218@users.noreply.github.com,./examples/gno.land/r/x/nir1218_evaluation_proposal/category.gno 1687263124,zack.scholl@gmail.com,./examples/gno.land/p/demo/microblog/microblog.gno ``` ## Future Plans - Translate into GitHub usernames. - Share the gnopher list on `r/gh` (#1134). - Create a new `r/gnoland/gnophers` page with the following features: - Add a widget on `r/gnoland/home` displaying the "latest gnophers." - Create a helper function like `r/gnoland/gnophers.NumberByAddr("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq`) -> `(2 int)` to use this info on other meta profiles, such as the future "gnolinkedin" mixing facts and personal presentation (gnolang/game-of-realms#5). - Create a `r/gnoland/gnophers:username` route that returns a badge with the username, gnopher number, "gnopher since <date>," and a `gnoface` (#690). - Stop checking and order t-shirts for the first 100 official gnophers. ### Example Gnopher Badges ```markdown # @jaekwon proudly became the 1st gnopher on Oct 3, 2021. ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#1 ``` ```markdown # @moul proudly became the 2nd gnopher on May 24, 2022. ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#2 ``` cc @gnolang/devrels Signed-off-by: moul <94029+moul@users.noreply.github.com>
```console $ cd ./misc/list-gnophers $ ./main.sh ``` ```csv 1617467419,53785+jaekwon@users.noreply.github.com,./examples/gno.land/p/demo/flow/flow.gno 1651096034,94029+moul@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc721/igrc721.gno 1673524438,hariom.verma@tendermint.com,./examples/gno.land/p/demo/grc/grc721/basic_nft.gno 1677669053,100383075+Jammyaa@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc1155/basic_grc1155_token.gno 1678259597,350354+grepsuzette@users.noreply.github.com,./examples/gno.land/r/demo/deep/very/deep/render.gno 1678709422,pushkarshetye803@gmail.com,./examples/gno.land/r/demo/groups/group.gno 1684921090,contact@albttx.tech,./examples/gno.land/p/demo/merkle/merkle.gno 1687179019,nir1218@users.noreply.github.com,./examples/gno.land/r/x/nir1218_evaluation_proposal/category.gno 1687263124,zack.scholl@gmail.com,./examples/gno.land/p/demo/microblog/microblog.gno ``` - Translate into GitHub usernames. - Share the gnopher list on `r/gh` (gnolang#1134). - Create a new `r/gnoland/gnophers` page with the following features: - Add a widget on `r/gnoland/home` displaying the "latest gnophers." - Create a helper function like `r/gnoland/gnophers.NumberByAddr("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq`) -> `(2 int)` to use this info on other meta profiles, such as the future "gnolinkedin" mixing facts and personal presentation (gnolang/game-of-realms#5). - Create a `r/gnoland/gnophers:username` route that returns a badge with the username, gnopher number, "gnopher since <date>," and a `gnoface` (gnolang#690). - Stop checking and order t-shirts for the first 100 official gnophers. ```markdown ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#1 ``` ```markdown ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#2 ``` cc @gnolang/devrels Signed-off-by: moul <94029+moul@users.noreply.github.com> SetTokenURI wip
```console $ cd ./misc/list-gnophers $ ./main.sh ``` ```csv 1617467419,53785+jaekwon@users.noreply.github.com,./examples/gno.land/p/demo/flow/flow.gno 1651096034,94029+moul@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc721/igrc721.gno 1673524438,hariom.verma@tendermint.com,./examples/gno.land/p/demo/grc/grc721/basic_nft.gno 1677669053,100383075+Jammyaa@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc1155/basic_grc1155_token.gno 1678259597,350354+grepsuzette@users.noreply.github.com,./examples/gno.land/r/demo/deep/very/deep/render.gno 1678709422,pushkarshetye803@gmail.com,./examples/gno.land/r/demo/groups/group.gno 1684921090,contact@albttx.tech,./examples/gno.land/p/demo/merkle/merkle.gno 1687179019,nir1218@users.noreply.github.com,./examples/gno.land/r/x/nir1218_evaluation_proposal/category.gno 1687263124,zack.scholl@gmail.com,./examples/gno.land/p/demo/microblog/microblog.gno ``` - Translate into GitHub usernames. - Share the gnopher list on `r/gh` (gnolang#1134). - Create a new `r/gnoland/gnophers` page with the following features: - Add a widget on `r/gnoland/home` displaying the "latest gnophers." - Create a helper function like `r/gnoland/gnophers.NumberByAddr("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq`) -> `(2 int)` to use this info on other meta profiles, such as the future "gnolinkedin" mixing facts and personal presentation (gnolang/game-of-realms#5). - Create a `r/gnoland/gnophers:username` route that returns a badge with the username, gnopher number, "gnopher since <date>," and a `gnoface` (gnolang#690). - Stop checking and order t-shirts for the first 100 official gnophers. ```markdown ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#1 ``` ```markdown ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#2 ``` cc @gnolang/devrels Signed-off-by: moul <94029+moul@users.noreply.github.com> SetTokenURI wip
## Current Status ```console $ cd ./misc/list-gnophers $ ./main.sh ``` ```csv 1617467419,53785+jaekwon@users.noreply.github.com,./examples/gno.land/p/demo/flow/flow.gno 1651096034,94029+moul@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc721/igrc721.gno 1673524438,hariom.verma@tendermint.com,./examples/gno.land/p/demo/grc/grc721/basic_nft.gno 1677669053,100383075+Jammyaa@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc1155/basic_grc1155_token.gno 1678259597,350354+grepsuzette@users.noreply.github.com,./examples/gno.land/r/demo/deep/very/deep/render.gno 1678709422,pushkarshetye803@gmail.com,./examples/gno.land/r/demo/groups/group.gno 1684921090,contact@albttx.tech,./examples/gno.land/p/demo/merkle/merkle.gno 1687179019,nir1218@users.noreply.github.com,./examples/gno.land/r/x/nir1218_evaluation_proposal/category.gno 1687263124,zack.scholl@gmail.com,./examples/gno.land/p/demo/microblog/microblog.gno ``` ## Future Plans - Translate into GitHub usernames. - Share the gnopher list on `r/gh` (gnolang#1134). - Create a new `r/gnoland/gnophers` page with the following features: - Add a widget on `r/gnoland/home` displaying the "latest gnophers." - Create a helper function like `r/gnoland/gnophers.NumberByAddr("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq`) -> `(2 int)` to use this info on other meta profiles, such as the future "gnolinkedin" mixing facts and personal presentation (gnolang/game-of-realms#5). - Create a `r/gnoland/gnophers:username` route that returns a badge with the username, gnopher number, "gnopher since <date>," and a `gnoface` (gnolang#690). - Stop checking and order t-shirts for the first 100 official gnophers. ### Example Gnopher Badges ```markdown # @jaekwon proudly became the 1st gnopher on Oct 3, 2021. ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#1 ``` ```markdown # @moul proudly became the 2nd gnopher on May 24, 2022. ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#2 ``` cc @gnolang/devrels Signed-off-by: moul <94029+moul@users.noreply.github.com>
## Current Status ```console $ cd ./misc/list-gnophers $ ./main.sh ``` ```csv 1617467419,53785+jaekwon@users.noreply.github.com,./examples/gno.land/p/demo/flow/flow.gno 1651096034,94029+moul@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc721/igrc721.gno 1673524438,hariom.verma@tendermint.com,./examples/gno.land/p/demo/grc/grc721/basic_nft.gno 1677669053,100383075+Jammyaa@users.noreply.github.com,./examples/gno.land/p/demo/grc/grc1155/basic_grc1155_token.gno 1678259597,350354+grepsuzette@users.noreply.github.com,./examples/gno.land/r/demo/deep/very/deep/render.gno 1678709422,pushkarshetye803@gmail.com,./examples/gno.land/r/demo/groups/group.gno 1684921090,contact@albttx.tech,./examples/gno.land/p/demo/merkle/merkle.gno 1687179019,nir1218@users.noreply.github.com,./examples/gno.land/r/x/nir1218_evaluation_proposal/category.gno 1687263124,zack.scholl@gmail.com,./examples/gno.land/p/demo/microblog/microblog.gno ``` ## Future Plans - Translate into GitHub usernames. - Share the gnopher list on `r/gh` (gnolang#1134). - Create a new `r/gnoland/gnophers` page with the following features: - Add a widget on `r/gnoland/home` displaying the "latest gnophers." - Create a helper function like `r/gnoland/gnophers.NumberByAddr("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq`) -> `(2 int)` to use this info on other meta profiles, such as the future "gnolinkedin" mixing facts and personal presentation (gnolang/game-of-realms#5). - Create a `r/gnoland/gnophers:username` route that returns a badge with the username, gnopher number, "gnopher since <date>," and a `gnoface` (gnolang#690). - Stop checking and order t-shirts for the first 100 official gnophers. ### Example Gnopher Badges ```markdown # @jaekwon proudly became the 1st gnopher on Oct 3, 2021. ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#1 ``` ```markdown # @moul proudly became the 2nd gnopher on May 24, 2022. ||||||| ////////\ | | | ~ . | )| X X |. | | | C | | | | __/ | | | \~~~~~~~/ Gnopher#2 ``` cc @gnolang/devrels Signed-off-by: moul <94029+moul@users.noreply.github.com>
This PR initiates the new r/github realm, overseen by an oracle to transition offchain information onchain.
While this is foundational and will be augmented with new features, I welcome feedback on the codebase. Reviewers, please advise if we should merge as is and refine later, or if it would be preferable to transition this to a draft PR for continued development.
Addresses #1133
Related with gnolang/game-of-realms#3
cc @gnolang/devrels @gnolang/tokenomics
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description