Skip to content

Commit

Permalink
Merge pull request #7 from fhdsl/cansavvy/polishing_auth
Browse files Browse the repository at this point in the history
Authentication for Google, Calendly, Youtube and GitHub works -- and other polishing
  • Loading branch information
cansavvy authored Nov 15, 2023
2 parents 8808647 + 67078d4 commit 06463ff
Show file tree
Hide file tree
Showing 44 changed files with 1,111 additions and 151 deletions.
6 changes: 6 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.httr-oauth$
.secrets/*
.httr-oauth
^.github/*
^_pkgdown\.yml$
^docs$
^pkgdown$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature Request
about: Suggest an idea for the course templates
title: ''
labels: ''
assignees: cansavvy

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/problem-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Problem Report
about: Create a report to help improve ottrpal and its documentation
title: problem
labels: bug
assignees: cansavvy

---

**Describe what is not working with the template or is unclear in the documentation**
A clear and concise description of what the bug is.

**Please link to the specific course repository you are working on**

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.
What does the render look like versus what did you write and supply to `ottrpal`?

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--This PR Template was modified from https://github.com/AlexsLemonade/OpenPBTA-analysis/blob/master/.github/PULL_REQUEST_TEMPLATE.md-->

### Purpose/implementation Section

#### What changes are being implemented in this Pull Request?



#### What was your approach?



#### What GitHub issue does your pull request address?



### Tell potential reviewers what kind of feedback you are soliciting.
86 changes: 86 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.DS_Store
.secrets/*
.httr-oauth
docs
27 changes: 16 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
Package: metricminer
Type: Package
Title: What the Package Does (Title Case)
Package: metricminer
Title: Mine metrics from common places on the web
Version: 0.1.0
Author: Who wrote it
Maintainer: The package maintainer <[email protected]>
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
BugReports: https://github.com/datatrail-jhu/rgoogleclassroom/issues
Authors@R: c(
person("Candace", "Savonen", ,
c("[email protected]","[email protected]"),
role = c("aut", "cre"))
)
Description: metricminer helps you mine places on the web through the power of their APIs.
It also helps make the data in a format that is easily used for a dashboard or other purposes.
License: GPL-3
URL: https://github.com/fhdsl/metricminer
BugReports: https://github.com/fhdsl/metricminer/issues
Imports:
attempt,
curl,
httr,
jsonlite
jsonlite,
assertthat,
openssl,
gh
Encoding: UTF-8
RoxygenNote: 7.2.3
LazyData: true
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

26 changes: 25 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
exportPattern("^[[:alpha:]]+")
# Generated by roxygen2: do not edit by hand

export(auth_from_secret)
export(authorize)
export(delete_creds)
export(get_calendly_user)
export(get_ga_user)
export(get_github_metrics)
export(get_github_repo)
export(get_github_user)
export(get_google_files)
export(get_youtube_stats)
importFrom(assertthat,assert_that)
importFrom(assertthat,is.string)
importFrom(gh,gh)
importFrom(httr,accept_json)
importFrom(httr,config)
importFrom(httr,content)
importFrom(httr,oauth2.0_token)
importFrom(httr,oauth_app)
importFrom(httr,oauth_endpoints)
importFrom(jsonlite,fromJSON)
importFrom(utils,browseURL)
importFrom(utils,installed.packages)
importFrom(utils,menu)
Loading

0 comments on commit 06463ff

Please sign in to comment.