Skip to content
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

OSS Gate Workshop: tokyo: 2019-09-14: norinux: octokit.rb: Work log #1296

Closed
norinux opened this issue Sep 14, 2019 · 8 comments
Closed

OSS Gate Workshop: tokyo: 2019-09-14: norinux: octokit.rb: Work log #1296

norinux opened this issue Sep 14, 2019 · 8 comments

Comments

@norinux
Copy link
Contributor

norinux commented Sep 14, 2019

This is a work log of a "OSS Gate workshop".
"OSS Gate workshop" is an activity to increase OSS developers.
Here's been discussed in Japanese. Thanks.

作業ログ作成時の説明

以下のテンプレートを埋めてタイトルに設定します。埋め方例はスクロールすると見えてきます。

OSS Gate Workshop: ${LOCATION}: ${YEAR}-${MONTH}-${DAY}: ${ACCOUNT_NAME}: ${OSS_NAME}: Work log

タイトル例↓:

OSS Gate Workshop: Tokyo: 2017-01-16: kou: Rabbit: Work log

OSS Gateワークショップ関連情報

  • スライド:ワークショップの進行に使っているスライドがあります。
  • チャット:OSS開発に関することならなんでも相談できます。ワークショップが終わった後もオンラインで相談しながら継続的にOSSの開発に参加しましょう!
  • シナリオ:ワークショップの目的・内容・進め方の詳細が書いています。
  • 過去のビギナーの作業ログ:他の人の作業ログから学べることがいろいろあるはずです。

(サポーターで参加しましたが、サポーターの方が多かったのでビギナーに勝手に変更)

@norinux
Copy link
Contributor Author

norinux commented Sep 14, 2019

https://github.com/octokit/octokit.rb#quick-start の通りに進めてみる。
gem install octokit をする

nori$ gem install octokit
Successfully installed octokit-4.14.0
Parsing documentation for octokit-4.14.0
Done installing documentation for octokit after 1 seconds
1 gem installed

大丈夫そう
client.repos({}, query: {type: 'owner', sort: 'asc'})
で、自分のリポジトリのリストっぽいのはとれた
user = client.user 'swamp09'
swamp09さんのユーザ情報は覗き見できた
client.auto_paginate = true
これ入れたら便利そうだからいれた

repo = client.repo 'gaiax/Reactio-Issues'
rel = repo.rels[:issues]
p rel.get.data

ISSUEのリストはゲットできた、、が、、CLOSEしたISSUEがでてこない
quick-startには、これ以上の情報がないため、別のドキュメントを探る
http://octokit.github.io/octokit.rb/ のリンクがあったので、ここをみる

@norinux
Copy link
Contributor Author

norinux commented Sep 14, 2019

#create_issue(repo, title, body = nil, options = {}) ⇒ Sawyer::Resource
Also known as: open_issue

あとでつかえそうなの見つけたのでメモ

http://octokit.github.io/octokit.rb/Octokit/Client/Issues.html#close_issue-instance_method
ここで、ISSUEの操作のドキュメントをみつけた
p client.list_issues 'gaiax/Reactio-Issues' , {state: "all"}
これで、ISSUEの全件獲得できた

@norinux
Copy link
Contributor Author

norinux commented Sep 14, 2019

ISSUEの全件取得できたが、コメントが一緒に取得できない。困った。

@ryoon
Copy link
Contributor

ryoon commented Sep 14, 2019

  • GitHub APIで、list_issues methodの裏にあるAPIがcommentsを取得できるか見ておくと良いように思いました。
  • GitHub APIの構成とは別に、issuesの一覧を取得しつつ、comments を取得できる新しいmethodがあると便利なように思いました。

@norinux
Copy link
Contributor Author

norinux commented Sep 14, 2019

フィードバック

タイトル

ISSUEと、ISSUEのコメントを同時に取得したい

気持ち

リポジトリのISSUEをバックアップを取りたい。
ISSUEを取得するときに、一緒にコメントも取得したい。

問題点

list_issues でISSUEを取得してもコメントが含まれていないため、issue_comments を使って別に取得する実装を書かなければならず、非常に面倒

リクエスト

  • list_issues メソッドに、コメント付きのオプションを追加する
  • list_issues_with_comments という、ISSUEのコメントも一緒に取得できる便利な新しいメソッドを追加する

@norinux
Copy link
Contributor Author

norinux commented Sep 14, 2019

フィードバックの英語化

title

Get issue and issue comments in one request.

body

I want to get issue comments in issue lists.
Usecase is backup of repository data.

Becouse , list_issues method is not include issue comments.
So , It requires a lot of work to get of issue_comments.

feature request

  • add include comments option in list_issues method.
  • or. add new method list_issues_with_comments.

@norinux
Copy link
Contributor Author

norinux commented Sep 14, 2019

feedback done .
octokit/octokit.rb#1148

@oss-gate-issue-cleaner
Copy link

おつかれさまでした!

後日引き続きワークショップがある場合

後日のワークショップで再開する際に、issueタイトルの日付を更新してreopenしてください!

ワークショップ終了後に続きがしたい場合

issueはクローズしますが、その後も作業を続けていただいて大丈夫です!

是非このissueを活用なさってください。

今後のイベントの案内

現在以下のイベントの開催を予定しています。

参加をお待ちしてます!

@oss-gate-issue-cleaner oss-gate-issue-cleaner bot changed the title OSS Gate Workshop: tokyo: 2019-9-14: norinux: octokit.rb : Work log OSS Gate Workshoptokyo2019-09-14norinuxoctokit.rbWork log Nov 7, 2019
@knokmki612 knokmki612 changed the title OSS Gate Workshoptokyo2019-09-14norinuxoctokit.rbWork log OSS Gate Workshop: tokyo: 2019-09-14: norinuxoctokit.rb: Work log Nov 8, 2019
@knokmki612 knokmki612 changed the title OSS Gate Workshop: tokyo: 2019-09-14: norinuxoctokit.rb: Work log OSS Gate Workshop: tokyo: 2019-09-14: norinux: octokit.rb: Work log Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants