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

pb_release_delete + testing revamp #85

Merged
merged 14 commits into from
Jul 18, 2022
Merged

pb_release_delete + testing revamp #85

merged 14 commits into from
Jul 18, 2022

Conversation

tanho63
Copy link
Collaborator

@tanho63 tanho63 commented Jul 15, 2022

This PR adds:

  • pb_release_delete() which deletes releases from a repository
  • Renames pb_new_release() to pb_release_create() to better match syntax with release_delete
  • Rewrites all tests and makes sure they run on GHA with the appropriate tokens.
  • Uses RETRY on all httr-based requests to defend against server-side errors.

rename "examples" to "archives" to make clear purpose of folder

remove maybe function since now unused

remove maybe function since now unused

remove old utility tests
test utilities

rm extraneous test on cran
split test_without_auth into test-download + test-info files

fix ci usethis testing

try using gert instead of usethis, to maybe elim need for usethis

minimize non-token calls

use latest rcmd-check-full.yaml from rlib/actions

archive old tests
fix interactive menu for pb_upload

clean up error message in creating release
rewrite testing with authentication

update description to no longer need usethis but instead suggest withr (which already is used by testthat)

inst files for uploading

cleanup root level

rm rlang for now

update tests to use tan_gh_token

use tanfork of piggyback as test loc

cleanups
add private download test

update tests to use github default token more explicitly

check upload files locaiton?

move inst into tests?

fixup private download

maybe fix with rbuildignore removal?

move files back, sigh

getting closer...

abandon testing for private repos for now?

continue messing with

change delete test to check for status code
@tanho63 tanho63 mentioned this pull request Jul 15, 2022
3 tasks
@tanho63
Copy link
Collaborator Author

tanho63 commented Jul 15, 2022

Okay, so this makes a lot of progress on testing - it looks like a good majority of the with auth tests are working on most platforms now, with the exception of macOS and ubuntu-R-devel.

macOS tests have failed mostly because of GH API limitations. Not sure if those could/should be caught more gracefully.

I'm not as sure about what's going on with the ubuntu-devel problem - it looks like there's some weird locale things going on in the runner setup? resolved

Either way, I think this gives a better basis of testing than before (where a lot of the tests weren't being run), so if we're in a hurry this version can be submitted to CRAN, perhaps? None of these tests will be run on CRAN because skip_if_offline never runs on CRAN.

@cboettig
Copy link
Member

🎉

@cboettig
Copy link
Member

This looks good, going to go ahead and merge so we can proceed with the next release.

Just a few thoughts/questions here about token use down the road that I couldn't tell from a quick read through:

Looks like this is using a custom token you have minted? I think it should be possible to use the GITHUB_TOKEN that GH-Actions auto-generates for the repo instead? Also, do the failing tests on mac have a GITHUB_TOKEN available?

@cboettig cboettig merged commit 0beb265 into master Jul 18, 2022
@cboettig cboettig deleted the release-delete branch July 18, 2022 20:21
@tanho63
Copy link
Collaborator Author

tanho63 commented Jul 18, 2022

I think it should be possible to use the GITHUB_TOKEN that GH-Actions auto-generates for the repo instead?

The GITHUB_TOKEN did not seem to allow creating new releases or uploading them? There's a scoping problem within the runner token I think. Needed to switch to a private repo token and so I decided to switch to uploading to my fork of piggyback rather than the main one - reduces likelihood of garbage being added to this repo's releases, and also lets us better track package version history here (rather than having it diluted with data upload/download)

Also, do the failing tests on mac have a GITHUB_TOKEN available?

I wrote some tests to make sure that we could download without a GITHUB_TOKEN available (seeing as there've been some past errors), e.g.

This helps make sure that the desired behaviour will still work, but does expose us a bit to GH rate limits. Since this only runs here on GitHub Actions, we'd need to rerun any failures but it won't have any effect on CRAN (all tests skipped)

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

Successfully merging this pull request may close these issues.

None yet

2 participants