Comments (3)
I spend sometimes to GitHub API.
Maybe the reason is the default state
for the issue API is open?
curl -H "Authorization: token {private_token}" https://api.github.com/repos/JiaxiangBU/tutoring/issues?state=open -s
curl -H "Authorization: token {private_token}" https://api.github.com/repos/JiaxiangBU/tutoring/issues?state=closed -s
from projmgr.
Hi @JiaxiangBU - that's right! I didn't override any of the API's defaults for a consistent experience for anyone accessing the GitHub API through multiple tools.
To get closed issues, you can pass any of the API query parameters through the ...
s in the get_
functions. For example, in this case, we can do:
library(projmgr)
library(magrittr)
repo <- create_repo_ref("JiaxiangBU", "tutoring")
#> Requests will authenticate with GITHUB_PAT
issue_list <- get_issues(repo, state = "all") %>% parse_issues()
nrow(issue_list)
#> [1] 61
To know what query parameters are available, you can also use the help_{function name}
family of functions for the names of the query parameters for each endpoint. For example:
help_get_issues()
#> [1] "milestone" "state" "assignee" "creator" "mentioned" "labels" "sort" "direction" "since"
And for more details what each of these means, you can use the browse_docs
family to open up the correct page of GitHub API documentation. For example, browse_docs(action = "get", object= "issue")
should open this
Please let me know if that answers the question, and thanks for filing the issue! I will think about how I can highlight this better in the documentation.
from projmgr.
@emilyriederer thanks for your reply, I think it works for me with your reproducible example.
reproducible example works
library(projmgr)
library(magrittr)
repo <- create_repo_ref("JiaxiangBU", "tutoring")
#> Requests will authenticate with GITHUB_PAT
issue_list <- get_issues(repo, state = "all") %>% parse_issues()
nrow(issue_list)
#> [1] 61
Created on 2019-07-07 by the reprex package (v0.2.1)
further information is helpful
And for more details what each of these means, you can use the
browse_docs
family to open up the correct page of GitHub API documentation. For example,browse_docs(action = "get", object= "issue")
should open this
projmgr::help_get_issues()
#> [1] "milestone" "state" "assignee" "creator" "mentioned" "labels"
#> [7] "sort" "direction" "since"
Created on 2019-07-07 by the reprex package (v0.2.1)
projmgr::browse_docs(action = "get", object = "issue")
#> Open URL https://developer.github.com/v3/issues/#list-issues-for-a-repository
Created on 2019-07-07 by the reprex package (v0.2.1)
I see the arg description at this URL.
Name | Type | Description |
---|---|---|
state | string | Indicates the state of the issues to return. Can be either open, closed, or all. Default: open |
good to beginners
Please let me know if that answers the question, and thanks for filing the issue! I will think about how I can highlight this better in the documentation.
I agree with you, maybe other beginners of this package face a similar question.
Thanks a lot.
from projmgr.
Related Issues (20)
- Wrong order of arguments HOT 1
- bug in report_progress() - problem with aggregate() HOT 3
- new taskview_helper using number of commits HOT 6
- Ensure broader coverage of output in parse_issue_events HOT 1
- Support basic usage without PAT
- report_taskview() incorrect order and header HOT 4
- Add vignette on how to apply custom CSS to report_taskboard
- Add vignette on new labeling functions
- Error in post_plan: creates milestones but not issues and doesn't return data frame HOT 3
- typos in the examples HOT 1
- Wrapper for GitLab as well? HOT 3
- Add vignette comparing to GitHub Projects
- Test report_plan() total counts
- PATs need to have scopes HOT 1
- "per_page" is not a permitted key HOT 6
- Add taskboard_helper for has_comments
- Migrate to GitHub Actions and gh-pages branch for site
- Getting issues with multiple labels throws error
- Create update_issue()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from projmgr.