-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add check_pre_release_state()
#40
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8bc85eb
add `check_pre_release_state()`
pat-s 4cef4b0
use ui_code()
pat-s d79dc6f
style
pat-s 9566c27
ensure desc object is present
pat-s 215d93c
return modified R6 `desc` object
pat-s 4d91e6e
refactor check_release_state()
pat-s 5662a5b
add unleash.R
pat-s 6ea0066
merge master
pat-s a972ec9
small fixes
pat-s 712b78a
fix update_version.R
pat-s 5c40a20
fixes after first release try
pat-s eb66dbb
re-add bump_version_to_dev_with_force()
pat-s 19e1927
Merge branch 'f-27-automate' into prerelease-state
pat-s ae131a0
push release version to main branch before bumping to dev again
pat-s 027d7be
merge f27-automate
pat-s 57cc71d
Merge branch 'prerelease-state' into push-release-ver
pat-s 35b97e1
- check_release_state(): escape errors if package is not yet on CRAN
pat-s ba6de1f
Merge pull request #65 from krlmlr/push-release-ver
pat-s e6f81b5
Merge pull request #67 from krlmlr/is-pkg-released
pat-s File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
check_release_state <- function(which) { | ||
|
||
# meta info | ||
new_version <- update_version_helper(which)$get_version() | ||
pkg <- desc::desc_get_field("Package") | ||
version_components <- length(strsplit(as.character(desc::desc_get_version()), "[.]|-")[[1]]) | ||
# mirrors do not seem to work (due to CRAN vacay?) | ||
cran_details <- withr::with_options( | ||
list(repos = structure(c(CRAN = "https://cloud.r-project.org/"))), | ||
tryCatch(foghorn::cran_details(pkg, src = "website"), error = function(e) { | ||
print("Package not yet on CRAN, skipping {foghorn} checks.") | ||
return(NULL) | ||
}) | ||
) | ||
if (!is.null(cran_details)) { | ||
cran_version <- as.character(cran_details[1, "version"]) | ||
} | ||
cran_inc <- withr::with_options( | ||
list(repos = structure(c(CRAN = "https://cloud.r-project.org/"))), | ||
{ | ||
incoming <- foghorn::cran_incoming( | ||
pkg, | ||
c("pretest", "inspect", "pending", "publish", "waiting", "recheck") | ||
) | ||
ifelse(nrow(incoming) == 0, FALSE, TRUE) | ||
} | ||
) | ||
|
||
# determine state | ||
if (version_components == 4) { | ||
return("pre-release") | ||
} else if (new_version == cran_version) { | ||
return("accepted") | ||
} else if (cran_inc) { | ||
return("submitted") | ||
} else if (is_cran_comments_good()) { | ||
return("ready-to-release") | ||
} else { | ||
return("running-release-checks") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Feature: allow to specify a numeric version in `which` | ||
unleash <- function(which, force = FALSE) { | ||
|
||
state <- check_release_state(which) | ||
|
||
switch(state, | ||
"pre-release" = pre_release(which, force), | ||
"ready-to-release" = release(), | ||
"accepted" = post_release(), | ||
"submitted" = TRUE, | ||
"running-release-checks" = TRUE | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We could also allow the user to specify a version in
which
, in this case we would calldesc$set_version(which)
.Maybe in a new PR?