-
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
base: main
Are you sure you want to change the base?
Conversation
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.
I wonder if we should have one state function instead that returns the current state as a string, perhaps with verbosity option.
R/state.R
Outdated
ui_oops("pre_release(): CRAN-RELEASE already exists.") | ||
state = FALSE | ||
return(state) | ||
} else if (git2r::is_branch(sprintf("cran-%s", update_version_helper(which)))) { |
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.
update_version_helper()
has side effects, I wouldn't expect this from a checker.
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.
Because desc
is modified and avail in the GE? Isn't it recreated on every run?
We don't call $write()
.
Or is it more about naming and we should rename to update_version_helper_core()
or similar?
R/state.R
Outdated
|
||
# check version number | ||
if (length(strsplit(as.character(desc::desc_get_version()), "[.]|-")[[1]]) < 4) { | ||
ui_oops("pre_release(): Package versions needs to indicate a dev version before calling pre_release().") |
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.
Can we use ui_code()
inside ui_oops()
?
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.
Done. What about #38 ?
R/auto.R
Outdated
check_only_modified(character()) | ||
pre_release <- function(which = "patch", force = FALSE) { | ||
|
||
state = check_pre_release_state(which = which, force = force) |
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.
I prefer <-
in this repo.
New issue / PR? |
@krlmlr I've rebased your changes in |
R/update-version.R
Outdated
|
||
new_version <- desc$get_version() | ||
|
||
return(new_version) |
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.
Should this function return the modified desc
object, and be used in update_version_impl()
?
} | ||
|
||
# https://github.com/r-lib/desc/issues/93 | ||
suppressMessages(desc$bump_version(which)) |
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 call desc$set_version(which)
.
Maybe in a new PR?
This now has conflicts too. |
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.
Low priority for now.
R/state.R
Outdated
@@ -0,0 +1,29 @@ | |||
check_pre_release_state <- function(which, force = FALSE) { |
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.
Let's do one function that returns the current state:
- pre-release (the only state with 4 version number components)
- releasing, not ready
- ready to release
- submitted, waiting
- accepted
2f4a41f
to
3b5373c
Compare
3b5373c
to
5662a5b
Compare
8f024e2
to
e01ee18
Compare
Merge branch 'master' into prerelease-state # Conflicts: # DESCRIPTION # NAMESPACE # R/bump-version.R # R/finalize-version.R # R/import.R
check_release_state(): escape errors if package is not yet on CRAN
The merge conflicts look trivial, it might be worthwhile resolving them. Still, I'd rather do RC tagging first. |
State management for
pre_release()
for #27.Principle: Skip function execution and print why it happened. Users can still force execution with
force = TRUE
.