Skip to content

Commit

Permalink
Merge pull request #15 from A2-ai/fix_remote_changes_bug
Browse files Browse the repository at this point in the history
fixes bug where remote changes don't cause error for assign and resolve
  • Loading branch information
wes-a2ai authored Oct 31, 2024
2 parents 14860df + ab726b0 commit 819ba62
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
^\.Rproj\.user$
^LICENSE\.md$
^README\.Rmd$
^.github$
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: ghqc.app
Title: Create QC Checklists in Github Issues
Version: 0.1.4
Version: 0.1.5
Authors@R: c(
person("Jenna", "Johnson", email = "[email protected]", role = c("aut", "cre")),
person("Anne", "Zheng", email = "[email protected]", role = c("aut")),
person("Janelle", "Lennie", email = "[email protected]", role = c("ctb")),
person("Devin", "Pastoor", email = "[email protected]", role = c("aut")),
person("Wes", "Cummings", email = "[email protected]", role = c("aut")))
Description: A QC tool with 3 major functions: creation and management of QC log, creation and management of QC record, perform semi-automated QC tasks.
License: GPL (>= 3)
License: GPL (>= 3) + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ importFrom(fs,dir_ls)
importFrom(fs,is_dir)
importFrom(fs,is_file)
importFrom(gert,git_ahead_behind)
importFrom(gert,git_fetch)
importFrom(gert,git_status)
importFrom(glue,glue)
importFrom(jsTreeR,jstree)
Expand Down
12 changes: 2 additions & 10 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ghqc.app 0.1.5

# ghqc.app (beta version)
- Fixes bug in assign and resolve apps - error checking did not catch remote changes to the directory because checks did not git fetch first

# ghqc.app 0.1.4

Expand All @@ -16,25 +17,16 @@

# ghqc.app 0.1.1

# Minor bug fixes

- In the case when someone sets the standard gh environment variable GITHUB_API_URL, each app checks if this URL matches the actual set remote URL. The function that gets the GITHUB_API_URL did not explicitly return a value.

- Small grammar fix in error message from apps in the case that the checklists directory isn't in the cloned info repo.


# ghqc.app (development version)

# ghqc.app 0.0.0.9011

## Minor improvements

- rename ghqc to ghqc.app and ghqc.launcher to ghqc

# ghqc 0.0.0.9010

## Minor improvements

- terminology changed to match GitHub terminology like "Issue" and "Milestone"

- git commit terminology changed from "reference" and "comparator" to "previous" and "current", respectively
Expand Down
4 changes: 2 additions & 2 deletions R/app_01_assign_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @importFrom log4r warn error info debug
#' @importFrom shinyjs enable disable addClass removeClass delay
#' @importFrom waiter Waiter spin_1 spin_2 waiter_hide
#' @importFrom gert git_ahead_behind git_status
#' @importFrom gert git_status
#' @importFrom rprojroot find_rstudio_root_file
NULL

Expand Down Expand Up @@ -256,7 +256,7 @@ return "<div><strong>" + escape(item.username) + "</div>"
{
file_names <- sapply(qc_items(), function(x) x$name)
uncommitted_git_files <- git_status()$file
git_sync_status <- git_ahead_behind()
git_sync_status <- check_ahead_behind()
untracked_selected_files <- Filter(function(file) check_if_qc_file_untracked(file), file_names)

issues_in_milestone <- tryCatch(
Expand Down
4 changes: 2 additions & 2 deletions R/app_02_resolve_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @importFrom dplyr %>%
#' @importFrom log4r warn error info debug
#' @importFrom purrr map_df
#' @importFrom gert git_status git_ahead_behind
#' @importFrom gert git_status
NULL

ghqc_resolve_server <- function(id, remote, org, repo, milestone_list) {
Expand Down Expand Up @@ -143,7 +143,7 @@ ghqc_resolve_server <- function(id, remote, org, repo, milestone_list) {
{
req(issue_parts()$issue_title)
uncommitted_git_files <- git_status()$file
git_sync_status <- git_ahead_behind()
git_sync_status <- check_ahead_behind()
untracked_selected_files <- Filter(function(file) check_if_qc_file_untracked(file), issue_parts()$issue_title)
commit_update_status <- check_if_updates_since_init(all_commits())
},
Expand Down
2 changes: 0 additions & 2 deletions R/app_03_record_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
#' @importFrom shinyjs enable disable addClass removeClass
#' @importFrom log4r warn error info debug
#' @importFrom purrr map_df
#' @importFrom gert git_status git_ahead_behind
#' @importFrom shinyjs enable disable addClass removeClass delay
#' @importFrom waiter Waiter spin_1 spin_2 waiter_hide
#' @importFrom gert git_ahead_behind git_status
#' @importFrom rprojroot find_rstudio_root_file
NULL

Expand Down
6 changes: 6 additions & 0 deletions R/error.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ check_if_updates_since_init <- function(commits_df) {
rlang::abort(e$message)
})
}

#' @importFrom gert git_ahead_behind git_fetch
check_ahead_behind <- function() {
fetch <- git_fetch(prune = TRUE) # need to fetch first to see if there are changes to be pulled (behind = 0)
git_ahead_behind()
}

0 comments on commit 819ba62

Please sign in to comment.