diff --git a/.Rbuildignore b/.Rbuildignore index 2db40db..58893a7 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,6 @@ ^_pkgdown\.yml$ ^docs$ ^pkgdown$ + +r_bugzilla.sql +mysql_rbugs.R diff --git a/DESCRIPTION b/DESCRIPTION index 8e733e1..cb4e340 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Type: Package Package: bugRzilla -Title: Interact with Bugzilla +Title: Interact with Bugzilla Version: 0.0.90001 Authors@R: person(given = "Lluís", @@ -8,7 +8,7 @@ Authors@R: role = c("aut", "cre", "cph"), email = "lluis.revilla@gmail.com", comment = c(ORCID = "0000-0001-9747-2570")) -Description: Provides data from bugzilla and allows to post. +Description: Uses the Bugzilla API to retrieve bug and allows to post. License: GPL (>= 3) URL: https://github.com/llrs/bugRzilla BugReports: https://github.com/llrs/bugRzilla/issues @@ -24,10 +24,10 @@ Suggests: reprex, rmarkdown, testthat (>= 3.0.0), - vcr + vcr (>= 1.2.0) VignetteBuilder: knitr Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.1 diff --git a/NAMESPACE b/NAMESPACE index 640d2d6..87f28ba 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -12,6 +12,7 @@ export(get_history) export(get_user) export(post_bug) export(post_comment) +export(post_r_bug) export(set_key) export(use_key) importFrom(cli,cat_rule) diff --git a/R/api.R b/R/api.R index 1049e78..85fb4b6 100644 --- a/R/api.R +++ b/R/api.R @@ -10,7 +10,7 @@ missing_key <- function(key) { #' Obtain an API key or check if it can fine one that works for this host and #' the version of the bugzilla provided works with this package. #' @param host URL of the bugzilla instance if missing the R bugzilla is assumed. -#' @param key API key to check. +#' @param key API key name to check. By default R_BUGZILLA. #' @return TRUE invisibly if the actions are performed. #' @seealso set_key() if you want to temporary use an API key. #' @rdname authentication @@ -106,20 +106,6 @@ app_file <- function() { file.path(normalizePath(path), ".Renviron") } - -# use_key <- function(){ -# path <- app_file() -# file <- strsplit(readLines(path), split = "=", fixed = TRUE) -# key <- vector("characer", length(file)) -# value <- vector("character", length(file)) -# for (i in seq_along(file)) { -# key[i] <- file[[i]][1] -# value[i] <- file[[i]][2] -# } -# message("choose a key:") -# key[tools::menu(key)] -# } - write_renviron <- function(key, value, file) { if (!dir.exists(dirname(file))) { dir.create(dirname(file), showWarnings = FALSE, recursive = TRUE) diff --git a/R/bugRzilla.R b/R/bugRzilla.R index 6f1164c..4f37e30 100644 --- a/R/bugRzilla.R +++ b/R/bugRzilla.R @@ -14,6 +14,5 @@ #' Consider if this has been reported on the mailing list (R-devel) or on the #' issue tracker itself. #' -#' @docType package #' @name bugRzilla -NULL +"_PACKAGE" diff --git a/R/get_bug.R b/R/get_bug.R index 737661a..48ecdc5 100644 --- a/R/get_bug.R +++ b/R/get_bug.R @@ -15,6 +15,7 @@ get_bug <- function(issue, host) { url <- paste0(host, "rest/bug?id=", issues) bugs <- httr::GET(url, .state$headers) httr::stop_for_status(bugs) + bugs <- httr::content(bugs) if ("error" %in% names(bugs)) { diff --git a/R/get_comments.R b/R/get_comments.R index 19c57c6..4d22e7f 100644 --- a/R/get_comments.R +++ b/R/get_comments.R @@ -17,7 +17,7 @@ get_comment <- function(issue, comment, host) { stop("Provide an issue or a comment to retrieve from.", call. = FALSE) } if (!missing(issue) && !missing(comment)) { - warning("Issue ID is ignored", call. = FALSE) + warning("Comment ID is ignored", call. = FALSE) } host <- missing_host(host) if (missing(issue)) { @@ -70,15 +70,28 @@ get_commenti <- function(issue, host) { #' @param comment The text you want to post. #' @inheritParams create_bugzilla_key #' @return The ID of the comment posted. +#' @seealso `post_bug()`, `get_comment()` +#' See the API reference: #' @export -post_comment <- function(issue, comment, is_markdown, host, key) { - stopifnot(!is.logical(is_markdown)) +post_comment <- function(issue, comment, is_markdown = TRUE, host, key) { + stopifnot(is.logical(is_markdown)) host <- missing_host(host) + comment <- paste0(comment, "\n\nPosted via bugRzilla package.") headers <- set_headers(key) url <- paste0(host, "rest/bug/", issue, "/comment") - # comments <- httr::POST(url, - # comment = comment, is_markdown = is_markdown, - # headers) - # httr::content(comments)$id + comment_resp <- httr::POST(url, + body = list( + comment = comment, + is_markdown = is_markdown), + encode = "json", + + headers) + if (httr::http_error(comment_resp)) { + stop("You probably didn't use the right columns or values.\n", + " Check the API documentation as it says:\n\t", + httr::content(comment_resp)$message, call. = FALSE) + } + bugs <- httr::content(comment_resp) + bugs$id } diff --git a/R/post_bug.R b/R/post_bug.R index 8eebc36..e84d392 100644 --- a/R/post_bug.R +++ b/R/post_bug.R @@ -7,34 +7,78 @@ components <- c("Accuracy", "Add-ons", "Analyses", "Documentation", "Graphics", #' Open an issue. #' #' Guides through the process of creating an issue. -#' Requires an user and an API key. +#' Requires an user and an API key, see the vignette to know how to obtain that. +#' `post_r_bug()` is a helper with some checks +#' and advice before submitting issues to the R Bugzilla database. +#' +#' Many arguments can be passed, read the documentation on the reference to +#' know what can be added. #' @param text A character vector with the text of the bug you want to #' open. #' @param title A character vector with the title of the bug. #' @param component A character with the component of R you want to fill an issue with. -#' @param version A character of the Version you want to use eg "R 4.0.0". +#' If you omit it while using the `post_r_bug` you will be prompted to fill it. +#' @param version A character of the version you want to use eg "R 4.0.0". +#' If omitted on post_r_bug it will be automatically assumed to be from the version of R being used. #' @param product A character of the product you want to use if missing "R" is #' automatically filled. -#' @param ... Named arguments passed to the API [check documentation](https://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html) +#' @param is_markdown Is using markdown formatting? True by default. +#' @param ... Named arguments passed to the API [check documentation](https://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#create-bug) #' @inheritParams create_bugzilla_key #' @importFrom utils menu #' @importFrom cli cli_alert #' @export -#' @seealso To obtain and use the API key see create_bugzilla_key(). -#' [Webpage](https://bugs.r-project.org/bugzilla/enter_bug.cgi) for manual entry -#' @return The ID of the issue posted. -post_bug <- function(text, title, component, ..., - version, product, host, key) { +#' @seealso To obtain and use the API key see `create_bugzilla_key()`. +#' +#' [Webpage](https://bugs.r-project.org/bugzilla/enter_bug.cgi) for manual entry for the R project. +#' @return The ID of the issue posted. NULL if the user doesn't follow the advice. +#' @references API parameters: +#' Markdown allowed: +post_bug <- function(title, text, component, version, product, ..., is_markdown = TRUE, + host, key) { + title <- paste("BugRzilla:", title) + if (Sys.getenv("RBUGZILLA") == "" & product == "R") { + stop("To post to the R bugzilla use the post_r_bug function.", + call. = FALSE) + } else if (Sys.getenv("RBUGZILLA") != "" & product == "R") { + ask_final_confirmation() + } else { + ask_confirmation("Are you really sure?") + } + url <- paste0(host, "rest/bug") + bugs <- httr::POST(url, + body = list( + description = text, + product = product, + component = component, + summary = title, + version = version, + is_markdown = is_markdown, + ...), + encode = "json", + config = set_headers(key)) + if (httr::http_error(bugs)) { + stop("You probably didn't use the right columns or values.\n", + " Check the API documentation as it says:\n\t", + httr::content(bugs)$message, call. = FALSE) + } + bugs <- httr::content(bugs) + bugs$id +} + +#' @export +#' @rdname post_bug +post_r_bug <- function(title, text, component, version, ..., key) { # Provide some checks/questions to the users # Fill description, version and summary if (missing(component)) { cli::cli_alert("Please, pick a component:") component <- menu(components) + component <- components[component] } - component <- components[component] version <- missing_version(version) - host <- missing_host(host) - product <- missing_product(product) + Sys.setenv("RBUGZILLA" = "a") + on.exit(Sys.unsetenv("RBUGZILLA"), add = TRUE) if (read_documentation() == "Cancel") { return() } @@ -44,15 +88,16 @@ post_bug <- function(text, title, component, ..., if (about_content() == "Cancel") { return() } - ask_final_confirmation() - url <- paste0(host, "rest/bug") - # bugs <- httr::POST(url, - # description = text, - # product = product, - # component = component, - # summary = title, - # version = version, - # ..., - # headers) - # bugs <- httr::content(bugs) + post_bug(title = title, + text = text, + component = component, + version = version, + product = "R", + # To replace when going into production by: "https://bugs.r-project.org/bugzilla/" + host = "https://rbugs-devel.urbanek.info/", + key = missing_key(key), + ...) } + + +# Markdown formatting is conserved (copying content from bug 18231 and directly posting it accepts markdown) diff --git a/R/post_help.R b/R/post_help.R index 072fc98..1120da8 100644 --- a/R/post_help.R +++ b/R/post_help.R @@ -60,7 +60,6 @@ about_content <- function() { ask_final_confirmation <- function(message) { cli::cli_alert_warning("This notification will reach the R-core volunteers and many more") - cli::cli_ul("Are you sure to open a bug0 - ?") + cli::cli_ul("Are you sure to open a bug?") ask_confirmation() } diff --git a/R/utils.R b/R/utils.R index 8aef92b..26a7fe9 100644 --- a/R/utils.R +++ b/R/utils.R @@ -20,7 +20,7 @@ missing_version <- function(version) { } version <- paste0(ver, collapse = ".") } - version + paste("R", version) } missing_product <- function(product) { @@ -30,6 +30,22 @@ missing_product <- function(product) { product } +missing_hardware <- function(hardware) { + if (missing(hardware)) { + arch <- R.Version()[["arch"]] + } + if (arch == "x86_64") { + arch <- "x86_64/x64/amd64" + } else { + arch <- "Other" + } + arch +} + +missing_system <- function(system) { + +} + flatten_list <- function(x) { x[lengths(x) == 0] <- list(NA) diff --git a/_pkgdown.yml b/_pkgdown.yml index bbe3be4..2f96224 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,3 +1,9 @@ url: https://bugrzilla.llrs.dev development: mode: auto +template: + bootstrap: 5 + opengraph: + twitter: + creator: "@Lluis_Revilla" + card: summary_large_image diff --git a/man/authentication.Rd b/man/authentication.Rd index a9251a2..5e54324 100644 --- a/man/authentication.Rd +++ b/man/authentication.Rd @@ -12,7 +12,7 @@ check_authentication(key = Sys.getenv("R_BUGZILLA"), host) \arguments{ \item{host}{URL of the bugzilla instance if missing the R bugzilla is assumed.} -\item{key}{API key to check.} +\item{key}{API key name to check. By default R_BUGZILLA.} } \value{ TRUE invisibly if the actions are performed. diff --git a/man/bugRzilla.Rd b/man/bugRzilla.Rd index 6b5f6b4..d6fede7 100644 --- a/man/bugRzilla.Rd +++ b/man/bugRzilla.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/bugRzilla.R \docType{package} \name{bugRzilla} +\alias{bugRzilla-package} \alias{bugRzilla} \title{bugRzilla: A package to interact with Bugzilla.} \description{ @@ -22,3 +23,15 @@ Consider if this has been reported on the mailing list (R-devel) or on the issue tracker itself. } +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/llrs/bugRzilla} + \item Report bugs at \url{https://github.com/llrs/bugRzilla/issues} +} + +} +\author{ +\strong{Maintainer}: Lluís Revilla Sancho \email{lluis.revilla@gmail.com} (\href{https://orcid.org/0000-0001-9747-2570}{ORCID}) [copyright holder] + +} diff --git a/man/post_bug.Rd b/man/post_bug.Rd index 7d03940..a149588 100644 --- a/man/post_bug.Rd +++ b/man/post_bug.Rd @@ -2,37 +2,65 @@ % Please edit documentation in R/post_bug.R \name{post_bug} \alias{post_bug} +\alias{post_r_bug} \title{Open an issue.} \usage{ -post_bug(text, title, component, ..., version, product, host, key) +post_bug( + title, + text, + component, + version, + product, + ..., + is_markdown = TRUE, + host, + key +) + +post_r_bug(title, text, component, version, ..., key) } \arguments{ -\item{text}{A character vector with the text of the bug you want to -open.} - \item{title}{A character vector with the title of the bug.} -\item{component}{A character with the component of R you want to fill an issue with.} +\item{text}{A character vector with the text of the bug you want to +open.} -\item{...}{Named arguments passed to the API \href{https://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html}{check documentation}} +\item{component}{A character with the component of R you want to fill an issue with. +If you omit it while using the \code{post_r_bug} you will be prompted to fill it.} -\item{version}{A character of the Version you want to use eg "R 4.0.0".} +\item{version}{A character of the version you want to use eg "R 4.0.0". +If omitted on post_r_bug it will be automatically assumed to be from the version of R being used.} \item{product}{A character of the product you want to use if missing "R" is automatically filled.} +\item{...}{Named arguments passed to the API \href{https://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#create-bug}{check documentation}} + +\item{is_markdown}{Is using markdown formatting? True by default.} + \item{host}{URL of the bugzilla instance if missing the R bugzilla is assumed.} -\item{key}{API key to check.} +\item{key}{API key name to check. By default R_BUGZILLA.} } \value{ -The ID of the issue posted. +The ID of the issue posted. NULL if the user doesn't follow the advice. } \description{ Guides through the process of creating an issue. -Requires an user and an API key. +Requires an user and an API key, see the vignette to know how to obtain that. +\code{post_r_bug()} is a helper with some checks +and advice before submitting issues to the R Bugzilla database. +} +\details{ +Many arguments can be passed, read the documentation on the reference to +know what can be added. +} +\references{ +API parameters: \url{https://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#create-bug} +Markdown allowed: \url{https://bugs.r-project.org/page.cgi?id=markdown.html} } \seealso{ -To obtain and use the API key see create_bugzilla_key(). -\href{https://bugs.r-project.org/bugzilla/enter_bug.cgi}{Webpage} for manual entry +To obtain and use the API key see \code{create_bugzilla_key()}. + +\href{https://bugs.r-project.org/bugzilla/enter_bug.cgi}{Webpage} for manual entry for the R project. } diff --git a/man/post_comment.Rd b/man/post_comment.Rd index aea6862..283cc92 100644 --- a/man/post_comment.Rd +++ b/man/post_comment.Rd @@ -4,7 +4,7 @@ \alias{post_comment} \title{Post a comment} \usage{ -post_comment(issue, comment, is_markdown, host, key) +post_comment(issue, comment, is_markdown = TRUE, host, key) } \arguments{ \item{issue}{A numeric value of the issue ID where the comment should be @@ -16,7 +16,7 @@ posted.} \item{host}{URL of the bugzilla instance if missing the R bugzilla is assumed.} -\item{key}{API key to check.} +\item{key}{API key name to check. By default R_BUGZILLA.} } \value{ The ID of the comment posted. @@ -24,3 +24,7 @@ The ID of the comment posted. \description{ Add information to a bug report. } +\seealso{ +\code{post_bug()}, \code{get_comment()} +See the API reference: \url{https://bugzilla.readthedocs.io/en/latest/api/core/v1/comment.html#create-comments} +} diff --git a/tests/fixtures/check_last_audit.json b/tests/fixtures/check_last_audit.json new file mode 100644 index 0000000..6e6417b --- /dev/null +++ b/tests/fixtures/check_last_audit.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/last_audit_time","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*"}},"response":{"status":{"status_code":200,"category":"Success","reason":"OK","message":"Success: (200) OK"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 09:59:42 GMT","content-type":"application/json; charset=UTF-8","content-length":"42","etag":"SK+xqNB3PXvZRomN8PJEhQ","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-password, x-bugzilla-api-key, x-bugzilla-login, x-bugzilla-token","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"last_audit_time\":\"2022-11-12T21:22:57Z\"}"}},"recorded_at":"2022-11-18 09:59:42 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/check_last_audit.yml b/tests/fixtures/check_last_audit.yml deleted file mode 100644 index c37d5ef..0000000 --- a/tests/fixtures/check_last_audit.yml +++ /dev/null @@ -1,35 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/last_audit_time - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - Authorization: My bearer token is safe - X-BUGZILLA-API-KEY: Removing this header too just in case - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - date: Fri, 18 Jun 2021 20:57:31 GMT - server: gazelle - etag: nuyzry+9UExbGXwyRTkrfQ - content-length: '42' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-api-key, x-bugzilla-login, x-bugzilla-token, x-bugzilla-password - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"last_audit_time":"2021-06-18T20:47:32Z"}' - recorded_at: 2021-06-18 20:57:31 GMT - recorded_with: vcr/0.6.0, webmockr/0.8.0 diff --git a/tests/fixtures/get_attachment_fails.json b/tests/fixtures/get_attachment_fails.json new file mode 100644 index 0000000..24a20db --- /dev/null +++ b/tests/fixtures/get_attachment_fails.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/2/attachment","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 09:59:43 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-api-key, x-bugzilla-password, x-bugzilla-login, x-bugzilla-token","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"error\":true,\"code\":\"306\"}"}},"recorded_at":"2022-11-18 09:59:43 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_attachment_fails.yml b/tests/fixtures/get_attachment_fails.yml deleted file mode 100644 index f84c573..0000000 --- a/tests/fixtures/get_attachment_fails.yml +++ /dev/null @@ -1,37 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug/2/attachment - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 404 - category: Client error - reason: Not Found - message: 'Client error: (404) Not Found' - headers: - date: Mon, 15 Feb 2021 18:58:19 GMT - server: gazelle - etag: +T5OLgUvQpBMFyo+y7Jixw - content-length: '128' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-login, x-bugzilla-password, x-bugzilla-token, x-bugzilla-api-key - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"documentation":"https://bugzilla.readthedocs.org/en/latest/api/","message":"Bug - #2 does not exist.","error":true,"code":"101"}' - recorded_at: 2021-02-15 18:58:20 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_attachmenta.json b/tests/fixtures/get_attachmenta.json new file mode 100644 index 0000000..6fd3ad7 --- /dev/null +++ b/tests/fixtures/get_attachmenta.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/attachment/1","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 09:59:43 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-login, x-bugzilla-token, x-bugzilla-api-key, x-bugzilla-password","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"error\":true}"}},"recorded_at":"2022-11-18 09:59:43 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_attachmenta.yml b/tests/fixtures/get_attachmenta.yml deleted file mode 100644 index 9daf1ee..0000000 --- a/tests/fixtures/get_attachmenta.yml +++ /dev/null @@ -1,37 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug/attachment/1 - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - date: Mon, 15 Feb 2021 18:58:19 GMT - server: gazelle - etag: p7uMfPg2Y0GxFHR4SuNj9Q - content-length: '510' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-api-key, x-bugzilla-login, x-bugzilla-password, x-bugzilla-token - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"bugs":{},"attachments":{"1":{"size":134,"data":"I2luY2x1ZGUgPFJpbnRlcm5hbHMuaD4KClNFWFAgbXlFdmFsKFNFWFAgRk4sIFNFWFAgZmlyc3RfYXJnKSB7CiAgcmV0dXJuIGV2YWwoTENPTlMoRk4sIENPTlMoZmlyc3RfYXJnLCBSX05pbFZhbHVlKSksIFJfR2xvYmFsRW52KTsKfQo=","summary":"test - attachment ...","is_private":false,"last_change_time":"2010-02-16T17:43:29Z","is_obsolete":false,"creator":"admin@urbanek.info","id":1,"is_patch":false,"bug_id":1,"file_name":"ed.c","flags":[],"creation_time":"2010-02-16T17:42:59Z","content_type":"text/plain"}}}' - recorded_at: 2021-02-15 18:58:19 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_attachmenti.json b/tests/fixtures/get_attachmenti.json new file mode 100644 index 0000000..58cccdc --- /dev/null +++ b/tests/fixtures/get_attachmenti.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/1/attachment","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 09:59:43 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-api-key, x-bugzilla-password, x-bugzilla-token, x-bugzilla-login","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"error\":true,\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"code\":\"306\"}"}},"recorded_at":"2022-11-18 09:59:43 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_attachmenti.yml b/tests/fixtures/get_attachmenti.yml deleted file mode 100644 index 676cac7..0000000 --- a/tests/fixtures/get_attachmenti.yml +++ /dev/null @@ -1,37 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug/1/attachment - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - date: Mon, 15 Feb 2021 18:58:19 GMT - server: gazelle - etag: WxXZmC8Ede9OX7f/Y3Q4Gw - content-length: '512' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-api-key, x-bugzilla-token, x-bugzilla-password, x-bugzilla-login - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"bugs":{"1":[{"id":1,"creator":"admin@urbanek.info","is_obsolete":false,"last_change_time":"2010-02-16T17:43:29Z","summary":"test - attachment ...","is_private":false,"size":134,"data":"I2luY2x1ZGUgPFJpbnRlcm5hbHMuaD4KClNFWFAgbXlFdmFsKFNFWFAgRk4sIFNFWFAgZmlyc3RfYXJnKSB7CiAgcmV0dXJuIGV2YWwoTENPTlMoRk4sIENPTlMoZmlyc3RfYXJnLCBSX05pbFZhbHVlKSksIFJfR2xvYmFsRW52KTsKfQo=","content_type":"text/plain","creation_time":"2010-02-16T17:42:59Z","flags":[],"file_name":"ed.c","is_patch":false,"bug_id":1}]},"attachments":{}}' - recorded_at: 2021-02-15 18:58:19 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_bug.json b/tests/fixtures/get_bug.json new file mode 100644 index 0000000..0122f55 --- /dev/null +++ b/tests/fixtures/get_bug.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug?id=1","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 09:59:44 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-token, x-bugzilla-login, x-bugzilla-password, x-bugzilla-api-key","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"error\":true}"}},"recorded_at":"2022-11-18 09:59:44 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_bug.yml b/tests/fixtures/get_bug.yml deleted file mode 100644 index 7bf3c37..0000000 --- a/tests/fixtures/get_bug.yml +++ /dev/null @@ -1,42 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug?id=1 - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - date: Mon, 15 Feb 2021 18:58:20 GMT - server: gazelle - etag: IjESs3XlLqr6eZ3WcucqpA - content-length: '1012' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-login, x-bugzilla-password, x-bugzilla-token, x-bugzilla-api-key - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"bugs":[{"creator_detail":{"id":1,"name":"admin@urbanek.info","real_name":"Simon - Urbanek"},"qa_contact":"","creation_time":"2010-02-15T18:29:54Z","flags":[],"assigned_to":"admin@urbanek.info","component":"Misc","assigned_to_detail":{"real_name":"Simon - Urbanek","name":"admin@urbanek.info","id":1},"id":1,"summary":"Test bug report - - summary","priority":"P5","groups":[],"resolution":"FIXED","whiteboard":"","deadline":null,"product":"R","cc":["simon.urbanek@r-project.org"],"is_open":false,"version":"R - 2.y.z","last_change_time":"2018-01-16T16:21:14Z","dupe_of":null,"platform":"PowerPC","url":"http://url.com/","target_milestone":"---","classification":"Unclassified","severity":"normal","is_confirmed":true,"is_creator_accessible":true,"cc_detail":[{"real_name":"Simon - Urbanek","name":"simon.urbanek@r-project.org","id":5}],"alias":[],"is_cc_accessible":true,"status":"CLOSED","op_sys":"Mac - OS X v10.4","blocks":[],"see_also":[],"creator":"admin@urbanek.info","keywords":[],"depends_on":[15763,15764,15862]}]}' - recorded_at: 2021-02-15 18:58:20 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_bug_fails.json b/tests/fixtures/get_bug_fails.json new file mode 100644 index 0000000..7c78a93 --- /dev/null +++ b/tests/fixtures/get_bug_fails.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug?id=2","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 09:59:44 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-api-key, x-bugzilla-password, x-bugzilla-token, x-bugzilla-login","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"error\":true}"}},"recorded_at":"2022-11-18 09:59:44 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_bug_fails.yml b/tests/fixtures/get_bug_fails.yml deleted file mode 100644 index dc92513..0000000 --- a/tests/fixtures/get_bug_fails.yml +++ /dev/null @@ -1,36 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug?id=2 - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - date: Mon, 15 Feb 2021 18:58:20 GMT - server: gazelle - etag: pMWo7bbXHLt7aRw/o6a9Hw - content-length: '11' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-api-key, x-bugzilla-login, x-bugzilla-password, x-bugzilla-token - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"bugs":[]}' - recorded_at: 2021-02-15 18:58:20 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_comment_fails.json b/tests/fixtures/get_comment_fails.json new file mode 100644 index 0000000..9746939 --- /dev/null +++ b/tests/fixtures/get_comment_fails.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/2/comment","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 09:59:46 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-password, x-bugzilla-api-key, x-bugzilla-login, x-bugzilla-token","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"error\":true,\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\"}"}},"recorded_at":"2022-11-18 09:59:46 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_comment_fails.yml b/tests/fixtures/get_comment_fails.yml deleted file mode 100644 index 01a1cc1..0000000 --- a/tests/fixtures/get_comment_fails.yml +++ /dev/null @@ -1,37 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug/2/comment - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 404 - category: Client error - reason: Not Found - message: 'Client error: (404) Not Found' - headers: - date: Sat, 27 Feb 2021 15:27:16 GMT - server: gazelle - etag: +T5OLgUvQpBMFyo+y7Jixw - content-length: '128' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-token, x-bugzilla-password, x-bugzilla-login, x-bugzilla-api-key - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"documentation":"https://bugzilla.readthedocs.org/en/latest/api/","message":"Bug - #2 does not exist.","error":true,"code":"101"}' - recorded_at: 2021-02-27 15:27:16 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_commentc.json b/tests/fixtures/get_commentc.json new file mode 100644 index 0000000..900f54d --- /dev/null +++ b/tests/fixtures/get_commentc.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/comment/1","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 09:59:45 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-token, x-bugzilla-login, x-bugzilla-password, x-bugzilla-api-key","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"error\":true}"}},"recorded_at":"2022-11-18 09:59:45 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_commentc.yml b/tests/fixtures/get_commentc.yml deleted file mode 100644 index 6862223..0000000 --- a/tests/fixtures/get_commentc.yml +++ /dev/null @@ -1,37 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug/comment/1 - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - date: Mon, 15 Feb 2021 18:58:21 GMT - server: gazelle - etag: UESSd+KY0BLnO5bXQ0ff8w - content-length: '283' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-api-key, x-bugzilla-token, x-bugzilla-password, x-bugzilla-login - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"comments":{"1":{"is_private":false,"count":0,"time":"2010-02-15T18:29:54Z","creator":"admin@urbanek.info","tags":[],"id":1,"bug_id":1,"is_markdown":false,"creation_time":"2010-02-15T18:29:54Z","text":"Bug - report description.\n\nAnother paragraph.","attachment_id":null}},"bugs":{}}' - recorded_at: 2021-02-15 18:58:21 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_commenti.json b/tests/fixtures/get_commenti.json new file mode 100644 index 0000000..824447f --- /dev/null +++ b/tests/fixtures/get_commenti.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/1/comment","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 09:59:45 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-token, x-bugzilla-login, x-bugzilla-api-key, x-bugzilla-password","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"error\":true}"}},"recorded_at":"2022-11-18 09:59:45 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_commenti.yml b/tests/fixtures/get_commenti.yml deleted file mode 100644 index cbb182b..0000000 --- a/tests/fixtures/get_commenti.yml +++ /dev/null @@ -1,41 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug/1/comment - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - date: Mon, 15 Feb 2021 18:58:20 GMT - server: gazelle - etag: MSekdCtqGyPeOozR7kEd7A - content-length: '1321' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-api-key, x-bugzilla-password, x-bugzilla-token, x-bugzilla-login - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"comments":{},"bugs":{"1":{"comments":[{"text":"Bug report description.\n\nAnother - paragraph.","attachment_id":null,"is_markdown":false,"creation_time":"2010-02-15T18:29:54Z","bug_id":1,"time":"2010-02-15T18:29:54Z","id":1,"creator":"admin@urbanek.info","tags":[],"is_private":false,"count":0},{"count":1,"is_private":false,"tags":[],"id":2,"creator":"admin@urbanek.info","time":"2010-02-15T18:33:25Z","bug_id":1,"attachment_id":null,"text":"Another - response ...","creation_time":"2010-02-15T18:33:25Z","is_markdown":false},{"count":2,"is_private":false,"tags":[],"id":3,"creator":"admin@urbanek.info","time":"2010-02-16T17:42:59Z","bug_id":1,"attachment_id":1,"text":"Created - attachment 1\ntest attachment ...\n\nAttaching a test file ...","creation_time":"2010-02-16T17:42:59Z","is_markdown":false},{"bug_id":1,"attachment_id":null,"is_markdown":false,"creation_time":"2010-03-09T18:14:23Z","text":"Additional - comment ... test, as you may guess ...","is_private":false,"count":3,"time":"2010-03-09T18:14:23Z","creator":"simon.urbanek@r-project.org","tags":[],"id":83214},{"bug_id":1,"is_markdown":false,"attachment_id":null,"text":"Msrking - the test bug as fixed.","creation_time":"2010-03-10T16:54:39Z","is_private":false,"count":4,"time":"2010-03-10T16:54:39Z","creator":"admin@urbanek.info","id":83218,"tags":[]}]}}}' - recorded_at: 2021-02-15 18:58:21 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_fields.json b/tests/fixtures/get_fields.json new file mode 100644 index 0000000..f4c0120 --- /dev/null +++ b/tests/fixtures/get_fields.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/field/bug","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*"}},"response":{"status":{"status_code":200,"category":"Success","reason":"OK","message":"Success: (200) OK"},"headers":{"server":"nginx","date":"Sat, 27 Apr 2024 09:48:09 GMT","content-type":"application/json; charset=UTF-8","content-length":"24177","etag":"NtCZ/WnWI+y/fqwDmj1EQA","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-password, x-bugzilla-api-key, x-bugzilla-token, x-bugzilla-login","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"fields\":[{\"name\":\"bug_id\",\"is_mandatory\":false,\"is_custom\":false,\"id\":1,\"display_name\":\"Bug #\",\"is_on_bug_entry\":false,\"type\":0,\"visibility_values\":[],\"visibility_field\":null},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Summary\",\"is_custom\":false,\"id\":2,\"is_mandatory\":true,\"name\":\"short_desc\",\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null,\"id\":3,\"values\":[{\"visibility_values\":[],\"sortkey\":0,\"name\":\"Unclassified\",\"sort_key\":0}],\"is_custom\":false,\"name\":\"classification\",\"is_mandatory\":false,\"type\":2,\"is_on_bug_entry\":false,\"display_name\":\"Classification\"},{\"visibility_values\":[],\"visibility_field\":null,\"id\":4,\"is_custom\":false,\"is_mandatory\":true,\"name\":\"product\",\"is_on_bug_entry\":false,\"type\":2,\"display_name\":\"Product\"},{\"is_custom\":false,\"id\":5,\"values\":[{\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 2.10.x\"},{\"name\":\"old\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"name\":\"R 2.12.0\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 2.x\"},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 2.11.1\",\"sort_key\":0},{\"sort_key\":0,\"name\":\"R-devel (trunk)\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false,\"name\":\"R 2.12.1\",\"sort_key\":0},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false,\"name\":\"R 2.12.2\",\"sort_key\":0},{\"sort_key\":0,\"name\":\"R 2.13.0\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"R 2.13.1\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 2.13.2\",\"sort_key\":0},{\"name\":\"R 2.14.0\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"name\":\"R 2.14.2\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"name\":\"R 2.15.0\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"sort_key\":0,\"name\":\"R 2.15.x\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"sort_key\":0,\"name\":\"R 2.15.1\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"sort_key\":0,\"name\":\"R 3.0.0\",\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"sort_key\":0,\"name\":\"R 3.0.1\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"R 3.0.2\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 3.0.3\",\"sort_key\":0},{\"name\":\"R 3.1.0\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 3.1.1\"},{\"sort_key\":0,\"name\":\"R 3.1.2\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 3.1.3\"},{\"sort_key\":0,\"name\":\"R 3.2.0\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 3.2.1\",\"sort_key\":0},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 3.2.2\",\"sort_key\":0},{\"name\":\"R 3.2.3\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false,\"name\":\"R 3.2.4\",\"sort_key\":0},{\"name\":\"R 3.2.4 revised\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 3.3.*\"},{\"name\":\"R 3.4.0\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 3.4.1\",\"sort_key\":0},{\"name\":\"R 3.4.3\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"name\":\"R 2.y.z\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 3.4.4\"},{\"sort_key\":0,\"name\":\"R 3.5.0\",\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"sort_key\":0,\"name\":\"R 3.5.1\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"R 3.5.2\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"sort_key\":0,\"name\":\"R 3.5.3\",\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"R 3.6.xx\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"is_active\":false,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 4.0.0\"},{\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":false,\"name\":\"R 4.0.x\",\"sort_key\":0},{\"name\":\"R 4.1.0\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":false},{\"is_active\":false,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"R 4.1.x\"},{\"sortkey\":0,\"visibility_values\":[\"Rtools\"],\"is_active\":true,\"name\":\"4.2\",\"sort_key\":0},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 4.2.x\"},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 4.3.x\"},{\"sort_key\":0,\"name\":\"4.3\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"Rtools\"]},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"R 4.4.x\"}],\"name\":\"version\",\"is_mandatory\":true,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Version\",\"visibility_values\":[],\"value_field\":\"product\",\"visibility_field\":null},{\"is_mandatory\":false,\"name\":\"rep_platform\",\"id\":6,\"is_on_bug_entry\":false,\"type\":2,\"visibility_values\":[],\"is_custom\":false,\"values\":[{\"sort_key\":100,\"name\":\"All\",\"visibility_values\":[],\"sortkey\":100},{\"sort_key\":250,\"name\":\"x86_64/x64/amd64 (64-bit)\",\"sortkey\":250,\"visibility_values\":[]},{\"sortkey\":260,\"visibility_values\":[],\"sort_key\":260,\"name\":\"arm64/M1\"},{\"sort_key\":280,\"name\":\"ix86 (32-bit)\",\"visibility_values\":[],\"sortkey\":280},{\"name\":\"PowerPC\",\"sort_key\":300,\"sortkey\":300,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":350,\"sort_key\":350,\"name\":\"Sparc\"},{\"name\":\"SGI\",\"sort_key\":360,\"sortkey\":360,\"visibility_values\":[]},{\"name\":\"Other\",\"sort_key\":400,\"visibility_values\":[],\"sortkey\":400}],\"display_name\":\"Platform\",\"value_field\":null,\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"bug_file_loc\",\"id\":7,\"is_custom\":false,\"display_name\":\"URL\",\"type\":0,\"is_on_bug_entry\":false},{\"display_name\":\"OS/Version\",\"values\":[{\"sortkey\":100,\"visibility_values\":[],\"sort_key\":100,\"name\":\"All\"},{\"visibility_values\":[],\"sortkey\":200,\"sort_key\":200,\"name\":\"Windows 32-bit\"},{\"name\":\"Windows 64-bit\",\"sort_key\":210,\"sortkey\":210,\"visibility_values\":[]},{\"sortkey\":308,\"visibility_values\":[],\"name\":\"Mac OS X v10.4\",\"sort_key\":308},{\"sort_key\":309,\"name\":\"Mac OS X v10.5\",\"sortkey\":309,\"visibility_values\":[]},{\"sort_key\":310,\"name\":\"Mac OS X v10.6\",\"visibility_values\":[],\"sortkey\":310},{\"sort_key\":311,\"name\":\"Mac OS X v10.7\",\"sortkey\":311,\"visibility_values\":[]},{\"name\":\"Mac OS X v10.8\",\"sort_key\":312,\"visibility_values\":[],\"sortkey\":312},{\"sortkey\":313,\"visibility_values\":[],\"name\":\"OS X Mavericks\",\"sort_key\":313},{\"sort_key\":314,\"name\":\"OS X Yosemite\",\"visibility_values\":[],\"sortkey\":314},{\"sortkey\":315,\"visibility_values\":[],\"name\":\"OS X El Capitan\",\"sort_key\":315},{\"sortkey\":340,\"visibility_values\":[],\"sort_key\":340,\"name\":\"macOS\"},{\"visibility_values\":[],\"sortkey\":400,\"sort_key\":400,\"name\":\"Linux\"},{\"name\":\"Linux-Debian\",\"sort_key\":405,\"sortkey\":405,\"visibility_values\":[]},{\"sortkey\":407,\"visibility_values\":[],\"sort_key\":407,\"name\":\"Linux-Ubuntu\"},{\"name\":\"Linux-Fedora\",\"sort_key\":410,\"sortkey\":410,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":411,\"name\":\"Linux-RHEL\",\"sort_key\":411},{\"sortkey\":420,\"visibility_values\":[],\"name\":\"Linux-Gentoo\",\"sort_key\":420},{\"sort_key\":430,\"name\":\"FreeBSD\",\"sortkey\":430,\"visibility_values\":[]},{\"name\":\"Solaris\",\"sort_key\":450,\"sortkey\":450,\"visibility_values\":[]},{\"sort_key\":470,\"name\":\"IRIX\",\"sortkey\":470,\"visibility_values\":[]},{\"name\":\"AIX\",\"sort_key\":475,\"visibility_values\":[],\"sortkey\":475},{\"visibility_values\":[],\"sortkey\":480,\"sort_key\":480,\"name\":\"unix-other\"},{\"sort_key\":500,\"name\":\"Other\",\"sortkey\":500,\"visibility_values\":[]}],\"is_custom\":false,\"visibility_field\":null,\"value_field\":null,\"type\":2,\"is_on_bug_entry\":false,\"name\":\"op_sys\",\"is_mandatory\":false,\"id\":8,\"visibility_values\":[]},{\"name\":\"bug_status\",\"is_mandatory\":false,\"values\":[{\"sort_key\":0,\"name\":null,\"is_open\":true,\"sortkey\":0,\"visibility_values\":[],\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"NEW\"}]},{\"is_open\":true,\"sortkey\":100,\"visibility_values\":[],\"can_change_to\":[{\"name\":\"CONFIRMED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"ASSIGNED\"},{\"name\":\"CLOSED\",\"comment_required\":false}],\"name\":\"UNCONFIRMED\",\"sort_key\":100},{\"visibility_values\":[],\"sortkey\":200,\"is_open\":true,\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"name\":\"CONFIRMED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"ASSIGNED\"},{\"comment_required\":false,\"name\":\"CLOSED\"}],\"sort_key\":200,\"name\":\"NEW\"},{\"can_change_to\":[{\"name\":\"ASSIGNED\",\"comment_required\":false},{\"name\":\"CLOSED\",\"comment_required\":false}],\"is_open\":true,\"sortkey\":201,\"visibility_values\":[],\"name\":\"CONFIRMED\",\"sort_key\":201},{\"visibility_values\":[],\"sortkey\":300,\"is_open\":true,\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"name\":\"CLOSED\",\"comment_required\":false}],\"sort_key\":300,\"name\":\"ASSIGNED\"},{\"is_open\":true,\"sortkey\":400,\"visibility_values\":[],\"can_change_to\":[{\"comment_required\":false,\"name\":\"UNCONFIRMED\"},{\"comment_required\":false,\"name\":\"CONFIRMED\"},{\"name\":\"ASSIGNED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"CLOSED\"}],\"sort_key\":400,\"name\":\"REOPENED\"},{\"sort_key\":500,\"name\":\"RESOLVED\",\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"name\":\"REOPENED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"VERIFIED\"},{\"name\":\"CLOSED\",\"comment_required\":false}],\"is_open\":false,\"visibility_values\":[],\"sortkey\":500},{\"is_open\":false,\"visibility_values\":[],\"sortkey\":600,\"can_change_to\":[{\"name\":\"UNCONFIRMED\",\"comment_required\":false},{\"comment_required\":false,\"name\":\"REOPENED\"},{\"comment_required\":false,\"name\":\"CLOSED\"}],\"name\":\"VERIFIED\",\"sort_key\":600},{\"sort_key\":700,\"name\":\"CLOSED\",\"visibility_values\":[],\"sortkey\":700,\"is_open\":false,\"can_change_to\":[{\"name\":\"REOPENED\",\"comment_required\":false},{\"name\":\"VERIFIED\",\"comment_required\":false}]}],\"id\":9,\"is_custom\":false,\"display_name\":\"Status\",\"type\":2,\"is_on_bug_entry\":false,\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null},{\"is_mandatory\":false,\"name\":\"status_whiteboard\",\"id\":10,\"is_custom\":false,\"display_name\":\"Status Whiteboard\",\"type\":0,\"is_on_bug_entry\":false,\"visibility_values\":[],\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null,\"is_mandatory\":false,\"name\":\"keywords\",\"id\":11,\"values\":[{\"description\":\"A well tested patch would help resolve this bug.\",\"name\":\"HELPWANTED\"}],\"is_custom\":false,\"display_name\":\"Keywords\",\"type\":8,\"is_on_bug_entry\":false},{\"value_field\":null,\"visibility_field\":null,\"display_name\":\"Resolution\",\"is_custom\":false,\"values\":[{\"name\":\"\",\"sort_key\":100,\"sortkey\":100,\"visibility_values\":[]},{\"sortkey\":200,\"visibility_values\":[],\"sort_key\":200,\"name\":\"FIXED\"},{\"sortkey\":300,\"visibility_values\":[],\"name\":\"INVALID\",\"sort_key\":300},{\"sort_key\":350,\"name\":\"NOT REPRODUCIBLE\",\"sortkey\":350,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":370,\"name\":\"SPAM\",\"sort_key\":370},{\"sort_key\":400,\"name\":\"WONTFIX\",\"visibility_values\":[],\"sortkey\":400},{\"sortkey\":425,\"visibility_values\":[],\"sort_key\":425,\"name\":\"Works as documented\"},{\"visibility_values\":[],\"sortkey\":450,\"sort_key\":450,\"name\":\"WISHLIST\"},{\"visibility_values\":[],\"sortkey\":500,\"name\":\"DUPLICATE\",\"sort_key\":500},{\"name\":\"WORKSFORME\",\"sort_key\":600,\"sortkey\":600,\"visibility_values\":[]},{\"sort_key\":650,\"name\":\"CONTRIBUTED PACKAGE\",\"visibility_values\":[],\"sortkey\":650},{\"sortkey\":700,\"visibility_values\":[],\"sort_key\":700,\"name\":\"MOVED\"}],\"visibility_values\":[],\"type\":2,\"is_on_bug_entry\":false,\"id\":12,\"is_mandatory\":false,\"name\":\"resolution\"},{\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null,\"id\":13,\"values\":[{\"sort_key\":100,\"name\":\"blocker\",\"sortkey\":100,\"visibility_values\":[]},{\"sortkey\":200,\"visibility_values\":[],\"sort_key\":200,\"name\":\"critical\"},{\"visibility_values\":[],\"sortkey\":300,\"name\":\"major\",\"sort_key\":300},{\"visibility_values\":[],\"sortkey\":400,\"name\":\"normal\",\"sort_key\":400},{\"visibility_values\":[],\"sortkey\":500,\"sort_key\":500,\"name\":\"minor\"},{\"sort_key\":600,\"name\":\"trivial\",\"sortkey\":600,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":700,\"name\":\"enhancement\",\"sort_key\":700}],\"is_custom\":false,\"is_mandatory\":false,\"name\":\"bug_severity\",\"type\":2,\"is_on_bug_entry\":false,\"display_name\":\"Severity\"},{\"name\":\"priority\",\"is_mandatory\":false,\"id\":14,\"values\":[{\"name\":\"P1\",\"sort_key\":100,\"visibility_values\":[],\"sortkey\":100},{\"sort_key\":200,\"name\":\"P2\",\"sortkey\":200,\"visibility_values\":[]},{\"name\":\"P3\",\"sort_key\":300,\"sortkey\":300,\"visibility_values\":[]},{\"visibility_values\":[],\"sortkey\":400,\"sort_key\":400,\"name\":\"P4\"},{\"name\":\"P5\",\"sort_key\":500,\"visibility_values\":[],\"sortkey\":500}],\"is_custom\":false,\"display_name\":\"Priority\",\"is_on_bug_entry\":false,\"type\":2,\"visibility_values\":[],\"visibility_field\":null,\"value_field\":null},{\"is_mandatory\":true,\"name\":\"component\",\"is_custom\":false,\"id\":15,\"values\":[{\"sort_key\":0,\"name\":\"Accuracy\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"Add-ons\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"sort_key\":0,\"name\":\"Analyses\",\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"name\":\"Documentation\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"sort_key\":0,\"name\":\"Graphics\",\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"sort_key\":0,\"name\":\"I/O\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"Installation\"},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true,\"name\":\"Language\",\"sort_key\":0},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"Low-level\"},{\"sort_key\":0,\"name\":\"Mac GUI / Mac specific\",\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"]},{\"name\":\"Misc\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"sort_key\":0,\"name\":\"Models\",\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0},{\"name\":\"S4methods\",\"sort_key\":0,\"visibility_values\":[\"R\"],\"sortkey\":0,\"is_active\":true},{\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"Startup\"},{\"name\":\"System-specific\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"is_active\":true,\"sortkey\":0,\"visibility_values\":[\"R\"],\"sort_key\":0,\"name\":\"Translations\"},{\"is_active\":true,\"visibility_values\":[\"R\"],\"sortkey\":0,\"sort_key\":0,\"name\":\"Windows GUI / Window specific\"},{\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true,\"name\":\"Wishlist\",\"sort_key\":0},{\"sortkey\":0,\"visibility_values\":[\"Rtools\"],\"is_active\":true,\"name\":\"Installer\",\"sort_key\":0},{\"sortkey\":0,\"visibility_values\":[\"Rtools\"],\"is_active\":true,\"name\":\"Toolchain and libraries\",\"sort_key\":0}],\"display_name\":\"Component\",\"is_on_bug_entry\":false,\"type\":2,\"visibility_values\":[],\"value_field\":\"product\",\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"assigned_to\",\"is_custom\":false,\"id\":16,\"display_name\":\"AssignedTo\",\"is_on_bug_entry\":false,\"type\":0},{\"display_name\":\"ReportedBy\",\"is_on_bug_entry\":false,\"type\":0,\"name\":\"reporter\",\"is_mandatory\":false,\"is_custom\":false,\"id\":17,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"Votes\",\"type\":0,\"is_on_bug_entry\":false,\"name\":\"votes\",\"is_mandatory\":false,\"is_custom\":false,\"id\":18},{\"visibility_field\":null,\"visibility_values\":[],\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"QAContact\",\"is_custom\":false,\"id\":19,\"is_mandatory\":false,\"name\":\"qa_contact\"},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"CC\",\"type\":0,\"is_on_bug_entry\":false,\"name\":\"cc\",\"is_mandatory\":false,\"id\":20,\"is_custom\":false},{\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Depends on\",\"is_custom\":false,\"id\":21,\"name\":\"dependson\",\"is_mandatory\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"id\":22,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"blocked\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Blocks\",\"visibility_values\":[],\"visibility_field\":null},{\"is_custom\":false,\"id\":23,\"name\":\"attachments.description\",\"is_mandatory\":false,\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Attachment description\",\"visibility_values\":[],\"visibility_field\":null},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Attachment filename\",\"id\":24,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"attachments.filename\",\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"attachments.mimetype\",\"is_custom\":false,\"id\":25,\"display_name\":\"Attachment mime type\",\"type\":0,\"is_on_bug_entry\":false},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"attachments.ispatch\",\"id\":26,\"is_custom\":false,\"display_name\":\"Attachment is patch\",\"is_on_bug_entry\":false,\"type\":0},{\"visibility_values\":[],\"visibility_field\":null,\"is_custom\":false,\"id\":27,\"is_mandatory\":false,\"name\":\"attachments.isobsolete\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Attachment is obsolete\"},{\"visibility_values\":[],\"visibility_field\":null,\"name\":\"attachments.isprivate\",\"is_mandatory\":false,\"is_custom\":false,\"id\":28,\"display_name\":\"Attachment is private\",\"is_on_bug_entry\":false,\"type\":0},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Attachment creator\",\"id\":29,\"is_custom\":false,\"name\":\"attachments.submitter\",\"is_mandatory\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"type\":0,\"is_on_bug_entry\":false,\"is_mandatory\":false,\"name\":\"target_milestone\",\"id\":30,\"visibility_values\":[],\"display_name\":\"Target Milestone\",\"values\":[{\"name\":\"---\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"R\"],\"is_active\":true},{\"name\":\"---\",\"sort_key\":0,\"sortkey\":0,\"visibility_values\":[\"Rtools\"],\"is_active\":true}],\"is_custom\":false,\"visibility_field\":null,\"value_field\":\"product\"},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Creation date\",\"id\":31,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"creation_ts\",\"visibility_field\":null,\"visibility_values\":[]},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Last changed date\",\"id\":32,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"delta_ts\",\"visibility_field\":null,\"visibility_values\":[]},{\"id\":33,\"is_custom\":false,\"name\":\"longdesc\",\"is_mandatory\":false,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Comment\",\"visibility_values\":[],\"visibility_field\":null},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"Comment is private\",\"is_on_bug_entry\":false,\"type\":0,\"name\":\"longdescs.isprivate\",\"is_mandatory\":false,\"is_custom\":false,\"id\":34},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Alias\",\"id\":35,\"is_custom\":false,\"name\":\"alias\",\"is_mandatory\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"everconfirmed\",\"id\":36,\"is_custom\":false,\"display_name\":\"Ever Confirmed\",\"is_on_bug_entry\":false,\"type\":0},{\"visibility_values\":[],\"visibility_field\":null,\"is_custom\":false,\"id\":37,\"name\":\"reporter_accessible\",\"is_mandatory\":false,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Reporter Accessible\"},{\"id\":38,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"cclist_accessible\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"CC Accessible\",\"visibility_values\":[],\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"id\":39,\"is_custom\":false,\"name\":\"bug_group\",\"is_mandatory\":false,\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Group\"},{\"is_custom\":false,\"id\":40,\"is_mandatory\":false,\"name\":\"estimated_time\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Estimated Hours\",\"visibility_values\":[],\"visibility_field\":null},{\"display_name\":\"Remaining Hours\",\"is_on_bug_entry\":false,\"type\":0,\"is_mandatory\":false,\"name\":\"remaining_time\",\"id\":41,\"is_custom\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"display_name\":\"Deadline\",\"type\":5,\"is_on_bug_entry\":false,\"name\":\"deadline\",\"is_mandatory\":false,\"is_custom\":false,\"id\":42,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_field\":null,\"visibility_values\":[],\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Commenter\",\"id\":43,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"commenter\"},{\"display_name\":\"Flags\",\"type\":0,\"is_on_bug_entry\":false,\"name\":\"flagtypes.name\",\"is_mandatory\":false,\"id\":44,\"is_custom\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"Flag Requestee\",\"is_on_bug_entry\":false,\"type\":0,\"is_mandatory\":false,\"name\":\"requestees.login_name\",\"is_custom\":false,\"id\":45},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Flag Setter\",\"is_custom\":false,\"id\":46,\"is_mandatory\":false,\"name\":\"setters.login_name\",\"visibility_field\":null,\"visibility_values\":[]},{\"display_name\":\"Hours Worked\",\"is_on_bug_entry\":false,\"type\":0,\"name\":\"work_time\",\"is_mandatory\":false,\"is_custom\":false,\"id\":47,\"visibility_field\":null,\"visibility_values\":[]},{\"is_mandatory\":false,\"name\":\"percentage_complete\",\"is_custom\":false,\"id\":48,\"display_name\":\"Percentage Complete\",\"is_on_bug_entry\":false,\"type\":0,\"visibility_values\":[],\"visibility_field\":null},{\"is_custom\":false,\"id\":49,\"name\":\"content\",\"is_mandatory\":false,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Content\",\"visibility_values\":[],\"visibility_field\":null},{\"visibility_values\":[],\"visibility_field\":null,\"name\":\"attach_data.thedata\",\"is_mandatory\":false,\"is_custom\":false,\"id\":50,\"display_name\":\"Attachment data\",\"is_on_bug_entry\":false,\"type\":0},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"owner_idle_time\",\"id\":52,\"is_custom\":false,\"display_name\":\"Time Since Assignee Touched\",\"type\":0,\"is_on_bug_entry\":false},{\"visibility_values\":[],\"visibility_field\":null,\"id\":53,\"is_custom\":false,\"name\":\"days_elapsed\",\"is_mandatory\":false,\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Days since bug changed\"},{\"visibility_field\":null,\"visibility_values\":[],\"is_on_bug_entry\":false,\"type\":7,\"display_name\":\"See Also\",\"id\":54,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"see_also\"},{\"visibility_values\":[],\"visibility_field\":null,\"id\":55,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"longdescs.count\",\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"Number of Comments\"},{\"visibility_values\":[],\"visibility_field\":null,\"name\":\"tag\",\"is_mandatory\":false,\"is_custom\":false,\"id\":56,\"display_name\":\"Personal Tags\",\"type\":8,\"is_on_bug_entry\":false},{\"visibility_values\":[],\"visibility_field\":null,\"is_custom\":false,\"id\":57,\"name\":\"assigned_to_realname\",\"is_mandatory\":false,\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"AssignedToName\"},{\"visibility_values\":[],\"visibility_field\":null,\"is_mandatory\":false,\"name\":\"reporter_realname\",\"is_custom\":false,\"id\":58,\"display_name\":\"ReportedByName\",\"type\":0,\"is_on_bug_entry\":false},{\"type\":0,\"is_on_bug_entry\":false,\"display_name\":\"QAContactName\",\"id\":59,\"is_custom\":false,\"is_mandatory\":false,\"name\":\"qa_contact_realname\",\"visibility_field\":null,\"visibility_values\":[]},{\"display_name\":\"Last Visit\",\"is_on_bug_entry\":false,\"type\":5,\"is_mandatory\":false,\"name\":\"last_visit_ts\",\"id\":60,\"is_custom\":false,\"visibility_field\":null,\"visibility_values\":[]},{\"visibility_field\":null,\"visibility_values\":[],\"display_name\":\"Comment Tag\",\"is_on_bug_entry\":false,\"type\":0,\"is_mandatory\":false,\"name\":\"comment_tag\",\"is_custom\":false,\"id\":61},{\"is_on_bug_entry\":false,\"type\":0,\"display_name\":\"Duplicate of\",\"is_custom\":false,\"id\":62,\"name\":\"dupe_of\",\"is_mandatory\":false,\"visibility_field\":null,\"visibility_values\":[]}]}"}},"recorded_at":"2024-04-27 09:48:09 GMT","recorded_with":"vcr/1.2.2, webmockr/0.9.0"}]} diff --git a/tests/fixtures/get_fields.yml b/tests/fixtures/get_fields.yml deleted file mode 100644 index 179e2f3..0000000 --- a/tests/fixtures/get_fields.yml +++ /dev/null @@ -1,113 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla//rest/field/bug - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - Authorization: My bearer token is safe - X-BUGZILLA-API-KEY: Removing this header too just in case - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - date: Sat, 20 Feb 2021 09:20:28 GMT - server: gazelle - etag: LwqxIAsQ4u++SM005ZNA6g - content-length: '23361' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-api-key, x-bugzilla-login, x-bugzilla-token, x-bugzilla-password - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - set-cookie: Bugzilla_login_request_cookie=2bTGxpSe0o; domain=bugs.r-project.org; - path=/bugzilla/; secure; HttpOnly - body: - encoding: UTF-8 - file: no - string: '{"fields":[{"is_on_bug_entry":false,"id":1,"visibility_field":null,"name":"bug_id","is_custom":false,"type":0,"is_mandatory":false,"visibility_values":[],"display_name":"Bug - #"},{"id":2,"is_on_bug_entry":false,"visibility_field":null,"name":"short_desc","is_custom":false,"type":0,"is_mandatory":true,"visibility_values":[],"display_name":"Summary"},{"display_name":"Classification","visibility_values":[],"is_mandatory":false,"is_custom":false,"type":2,"values":[{"name":"Unclassified","visibility_values":[],"sort_key":0,"sortkey":0}],"visibility_field":null,"name":"classification","is_on_bug_entry":false,"id":3,"value_field":null},{"type":2,"is_custom":false,"visibility_field":null,"name":"product","id":4,"is_on_bug_entry":false,"display_name":"Product","is_mandatory":true,"visibility_values":[]},{"id":5,"is_on_bug_entry":false,"value_field":"product","name":"version","visibility_field":null,"type":0,"is_custom":false,"values":[{"name":"R - 2.10.x","is_active":false,"visibility_values":["R"],"sort_key":0,"sortkey":0},{"name":"old","is_active":true,"visibility_values":["R"],"sortkey":0,"sort_key":0},{"visibility_values":["R"],"is_active":false,"name":"R - 2.12.0","sort_key":0,"sortkey":0},{"visibility_values":["R"],"is_active":false,"name":"R - 2.x","sortkey":0,"sort_key":0},{"name":"R 2.11.1","visibility_values":["R"],"is_active":false,"sortkey":0,"sort_key":0},{"sort_key":0,"sortkey":0,"visibility_values":["R"],"is_active":true,"name":"R-devel - (trunk)"},{"name":"R 2.12.1","is_active":false,"visibility_values":["R"],"sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"name":"R - 2.12.2","visibility_values":["R"],"is_active":false},{"is_active":false,"visibility_values":["R"],"name":"R - 2.13.0","sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"name":"R 2.13.1","visibility_values":["R"],"is_active":false},{"sort_key":0,"sortkey":0,"is_active":false,"visibility_values":["R"],"name":"R - 2.13.2"},{"visibility_values":["R"],"is_active":false,"name":"R 2.14.0","sort_key":0,"sortkey":0},{"is_active":false,"visibility_values":["R"],"name":"R - 2.14.2","sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"visibility_values":["R"],"is_active":false,"name":"R - 2.15.0"},{"sortkey":0,"sort_key":0,"name":"R 2.15.x","is_active":false,"visibility_values":["R"]},{"sort_key":0,"sortkey":0,"name":"R - 2.15.1","is_active":false,"visibility_values":["R"]},{"sort_key":0,"sortkey":0,"name":"R - 3.0.0","visibility_values":["R"],"is_active":false},{"name":"R 3.0.1","is_active":false,"visibility_values":["R"],"sortkey":0,"sort_key":0},{"sortkey":0,"sort_key":0,"name":"R - 3.0.2","visibility_values":["R"],"is_active":false},{"name":"R 3.0.3","visibility_values":["R"],"is_active":false,"sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"is_active":false,"visibility_values":["R"],"name":"R - 3.1.0"},{"name":"R 3.1.1","visibility_values":["R"],"is_active":false,"sort_key":0,"sortkey":0},{"sort_key":0,"sortkey":0,"name":"R - 3.1.2","is_active":false,"visibility_values":["R"]},{"sortkey":0,"sort_key":0,"visibility_values":["R"],"is_active":false,"name":"R - 3.1.3"},{"sort_key":0,"sortkey":0,"name":"R 3.2.0","is_active":false,"visibility_values":["R"]},{"sort_key":0,"sortkey":0,"visibility_values":["R"],"is_active":false,"name":"R - 3.2.1"},{"is_active":false,"visibility_values":["R"],"name":"R 3.2.2","sort_key":0,"sortkey":0},{"visibility_values":["R"],"is_active":false,"name":"R - 3.2.3","sort_key":0,"sortkey":0},{"sort_key":0,"sortkey":0,"name":"R 3.2.4","visibility_values":["R"],"is_active":false},{"name":"R - 3.2.4 revised","visibility_values":["R"],"is_active":false,"sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"is_active":false,"visibility_values":["R"],"name":"R - 3.3.*"},{"visibility_values":["R"],"is_active":false,"name":"R 3.4.0","sortkey":0,"sort_key":0},{"sortkey":0,"sort_key":0,"visibility_values":["R"],"is_active":false,"name":"R - 3.4.1"},{"is_active":false,"visibility_values":["R"],"name":"R 3.4.3","sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"name":"R - 2.y.z","is_active":false,"visibility_values":["R"]},{"sortkey":0,"sort_key":0,"name":"R - 3.4.4","is_active":false,"visibility_values":["R"]},{"is_active":false,"visibility_values":["R"],"name":"R - 3.5.0","sort_key":0,"sortkey":0},{"visibility_values":["R"],"is_active":false,"name":"R - 3.5.1","sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"name":"R 3.5.2","visibility_values":["R"],"is_active":false},{"sortkey":0,"sort_key":0,"name":"R - 3.5.3","is_active":false,"visibility_values":["R"]},{"visibility_values":["R"],"is_active":false,"name":"R - 3.6.xx","sortkey":0,"sort_key":0},{"sortkey":0,"sort_key":0,"visibility_values":["R"],"is_active":false,"name":"R - 3.6.x"},{"name":"R 4.0.0","visibility_values":["R"],"is_active":true,"sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"is_active":true,"visibility_values":["R"],"name":"R - 4.0.x"}],"visibility_values":[],"is_mandatory":true,"display_name":"Version"},{"visibility_values":[],"is_mandatory":false,"display_name":"Platform","id":6,"is_on_bug_entry":false,"value_field":null,"visibility_field":null,"name":"rep_platform","type":2,"is_custom":false,"values":[{"visibility_values":[],"name":"All","sort_key":100,"sortkey":100},{"visibility_values":[],"name":"ix86 - (32-bit)","sortkey":200,"sort_key":200},{"visibility_values":[],"name":"x86_64/x64/amd64 - (64-bit)","sortkey":250,"sort_key":250},{"sortkey":300,"sort_key":300,"visibility_values":[],"name":"PowerPC"},{"sort_key":350,"sortkey":350,"visibility_values":[],"name":"Sparc"},{"visibility_values":[],"name":"SGI","sort_key":360,"sortkey":360},{"visibility_values":[],"name":"Other","sortkey":400,"sort_key":400}]},{"type":0,"is_custom":false,"visibility_field":null,"name":"bug_file_loc","is_on_bug_entry":false,"id":7,"display_name":"URL","is_mandatory":false,"visibility_values":[]},{"display_name":"OS/Version","visibility_values":[],"is_mandatory":false,"type":2,"is_custom":false,"values":[{"name":"All","visibility_values":[],"sortkey":100,"sort_key":100},{"name":"Windows - 32-bit","visibility_values":[],"sort_key":200,"sortkey":200},{"name":"Windows - 64-bit","visibility_values":[],"sortkey":210,"sort_key":210},{"name":"Mac - OS X v10.4","visibility_values":[],"sortkey":308,"sort_key":308},{"visibility_values":[],"name":"Mac - OS X v10.5","sort_key":309,"sortkey":309},{"sortkey":310,"sort_key":310,"visibility_values":[],"name":"Mac - OS X v10.6"},{"visibility_values":[],"name":"Mac OS X v10.7","sortkey":311,"sort_key":311},{"sort_key":312,"sortkey":312,"visibility_values":[],"name":"Mac - OS X v10.8"},{"sort_key":313,"sortkey":313,"name":"OS X Mavericks","visibility_values":[]},{"sortkey":314,"sort_key":314,"name":"OS - X Yosemite","visibility_values":[]},{"visibility_values":[],"name":"OS X El - Capitan","sort_key":315,"sortkey":315},{"sortkey":340,"sort_key":340,"visibility_values":[],"name":"macOS"},{"visibility_values":[],"name":"Linux","sortkey":400,"sort_key":400},{"name":"Linux-Debian","visibility_values":[],"sortkey":405,"sort_key":405},{"sortkey":407,"sort_key":407,"visibility_values":[],"name":"Linux-Ubuntu"},{"visibility_values":[],"name":"Linux-Fedora","sort_key":410,"sortkey":410},{"visibility_values":[],"name":"Linux-RHEL","sort_key":411,"sortkey":411},{"name":"Linux-Gentoo","visibility_values":[],"sort_key":420,"sortkey":420},{"name":"FreeBSD","visibility_values":[],"sort_key":430,"sortkey":430},{"name":"Solaris","visibility_values":[],"sortkey":450,"sort_key":450},{"sort_key":470,"sortkey":470,"name":"IRIX","visibility_values":[]},{"name":"AIX","visibility_values":[],"sort_key":475,"sortkey":475},{"sortkey":480,"sort_key":480,"visibility_values":[],"name":"unix-other"},{"name":"Other","visibility_values":[],"sortkey":500,"sort_key":500}],"visibility_field":null,"name":"op_sys","id":8,"is_on_bug_entry":false,"value_field":null},{"value_field":null,"id":9,"is_on_bug_entry":false,"name":"bug_status","visibility_field":null,"values":[{"name":null,"visibility_values":[],"sortkey":0,"is_open":true,"can_change_to":[{"name":"UNCONFIRMED","comment_required":false},{"name":"NEW","comment_required":false},{"comment_required":false,"name":"ASSIGNED"}],"sort_key":0},{"sortkey":100,"is_open":true,"can_change_to":[{"comment_required":false,"name":"NEW"},{"name":"CONFIRMED","comment_required":false},{"name":"ASSIGNED","comment_required":false},{"comment_required":false,"name":"CLOSED"}],"sort_key":100,"name":"UNCONFIRMED","visibility_values":[]},{"name":"NEW","visibility_values":[],"is_open":true,"can_change_to":[{"comment_required":false,"name":"UNCONFIRMED"},{"comment_required":false,"name":"ASSIGNED"},{"name":"CLOSED","comment_required":false}],"sort_key":200,"sortkey":200},{"name":"CONFIRMED","visibility_values":[],"is_open":true,"can_change_to":[{"comment_required":false,"name":"ASSIGNED"},{"comment_required":false,"name":"CLOSED"}],"sort_key":201,"sortkey":201},{"sortkey":300,"is_open":true,"can_change_to":[{"name":"UNCONFIRMED","comment_required":false},{"name":"NEW","comment_required":false},{"name":"CLOSED","comment_required":false}],"sort_key":300,"name":"ASSIGNED","visibility_values":[]},{"sortkey":400,"sort_key":400,"is_open":true,"can_change_to":[{"name":"UNCONFIRMED","comment_required":false},{"comment_required":false,"name":"NEW"},{"name":"ASSIGNED","comment_required":false},{"name":"CLOSED","comment_required":false}],"visibility_values":[],"name":"REOPENED"},{"name":"RESOLVED","visibility_values":[],"can_change_to":[{"comment_required":false,"name":"UNCONFIRMED"},{"comment_required":false,"name":"REOPENED"},{"name":"VERIFIED","comment_required":false},{"name":"CLOSED","comment_required":false}],"is_open":false,"sort_key":500,"sortkey":500},{"sortkey":600,"is_open":false,"can_change_to":[{"comment_required":false,"name":"UNCONFIRMED"},{"name":"REOPENED","comment_required":false},{"name":"CLOSED","comment_required":false}],"sort_key":600,"name":"VERIFIED","visibility_values":[]},{"sort_key":700,"can_change_to":[{"name":"REOPENED","comment_required":false},{"name":"VERIFIED","comment_required":false}],"is_open":false,"sortkey":700,"visibility_values":[],"name":"CLOSED"}],"is_custom":false,"type":2,"is_mandatory":false,"visibility_values":[],"display_name":"Status"},{"visibility_field":null,"name":"status_whiteboard","is_on_bug_entry":false,"id":10,"is_custom":false,"type":0,"is_mandatory":false,"visibility_values":[],"display_name":"Status - Whiteboard"},{"type":8,"is_custom":false,"values":[{"description":"A well - tested patch would help resolve this bug.","name":"HELPWANTED"}],"name":"keywords","visibility_field":null,"is_on_bug_entry":false,"id":11,"value_field":null,"display_name":"Keywords","visibility_values":[],"is_mandatory":false},{"display_name":"Resolution","visibility_values":[],"is_mandatory":false,"type":2,"is_custom":false,"values":[{"visibility_values":[],"name":"","sortkey":100,"sort_key":100},{"visibility_values":[],"name":"FIXED","sort_key":200,"sortkey":200},{"sort_key":300,"sortkey":300,"name":"INVALID","visibility_values":[]},{"sort_key":350,"sortkey":350,"visibility_values":[],"name":"NOT - REPRODUCIBLE"},{"name":"SPAM","visibility_values":[],"sort_key":370,"sortkey":370},{"sortkey":400,"sort_key":400,"visibility_values":[],"name":"WONTFIX"},{"sort_key":425,"sortkey":425,"name":"Works - as documented","visibility_values":[]},{"sort_key":450,"sortkey":450,"visibility_values":[],"name":"WISHLIST"},{"name":"DUPLICATE","visibility_values":[],"sort_key":500,"sortkey":500},{"name":"WORKSFORME","visibility_values":[],"sort_key":600,"sortkey":600},{"visibility_values":[],"name":"CONTRIBUTED - PACKAGE","sort_key":650,"sortkey":650},{"visibility_values":[],"name":"MOVED","sortkey":700,"sort_key":700}],"is_on_bug_entry":false,"id":12,"value_field":null,"visibility_field":null,"name":"resolution"},{"is_mandatory":false,"visibility_values":[],"display_name":"Severity","value_field":null,"is_on_bug_entry":false,"id":13,"visibility_field":null,"name":"bug_severity","values":[{"name":"blocker","visibility_values":[],"sort_key":100,"sortkey":100},{"sortkey":200,"sort_key":200,"name":"critical","visibility_values":[]},{"sort_key":300,"sortkey":300,"visibility_values":[],"name":"major"},{"name":"normal","visibility_values":[],"sortkey":400,"sort_key":400},{"visibility_values":[],"name":"minor","sort_key":500,"sortkey":500},{"name":"trivial","visibility_values":[],"sortkey":600,"sort_key":600},{"sortkey":700,"sort_key":700,"visibility_values":[],"name":"enhancement"}],"is_custom":false,"type":2},{"values":[{"name":"P1","visibility_values":[],"sort_key":100,"sortkey":100},{"visibility_values":[],"name":"P2","sort_key":200,"sortkey":200},{"sortkey":300,"sort_key":300,"name":"P3","visibility_values":[]},{"sortkey":400,"sort_key":400,"visibility_values":[],"name":"P4"},{"sort_key":500,"sortkey":500,"visibility_values":[],"name":"P5"}],"type":2,"is_custom":false,"name":"priority","visibility_field":null,"value_field":null,"id":14,"is_on_bug_entry":false,"display_name":"Priority","is_mandatory":false,"visibility_values":[]},{"type":2,"is_custom":false,"values":[{"name":"Accuracy","is_active":true,"visibility_values":["R"],"sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"visibility_values":["R"],"is_active":true,"name":"Add-ons"},{"sortkey":0,"sort_key":0,"name":"Analyses","visibility_values":["R"],"is_active":true},{"sortkey":0,"sort_key":0,"visibility_values":["R"],"is_active":true,"name":"Documentation"},{"sortkey":0,"sort_key":0,"name":"Graphics","visibility_values":["R"],"is_active":true},{"sort_key":0,"sortkey":0,"is_active":true,"visibility_values":["R"],"name":"I/O"},{"sort_key":0,"sortkey":0,"name":"Installation","is_active":true,"visibility_values":["R"]},{"visibility_values":["R"],"is_active":true,"name":"Language","sortkey":0,"sort_key":0},{"name":"Low-level","is_active":true,"visibility_values":["R"],"sort_key":0,"sortkey":0},{"name":"Mac - GUI / Mac specific","visibility_values":["R"],"is_active":true,"sortkey":0,"sort_key":0},{"sort_key":0,"sortkey":0,"name":"Misc","visibility_values":["R"],"is_active":true},{"visibility_values":["R"],"is_active":true,"name":"Models","sortkey":0,"sort_key":0},{"is_active":true,"visibility_values":["R"],"name":"S4methods","sortkey":0,"sort_key":0},{"name":"Startup","visibility_values":["R"],"is_active":true,"sortkey":0,"sort_key":0},{"is_active":true,"visibility_values":["R"],"name":"System-specific","sortkey":0,"sort_key":0},{"name":"Translations","visibility_values":["R"],"is_active":true,"sort_key":0,"sortkey":0},{"sortkey":0,"sort_key":0,"name":"Windows - GUI / Window specific","visibility_values":["R"],"is_active":true},{"sortkey":0,"sort_key":0,"name":"Wishlist","visibility_values":["R"],"is_active":true}],"name":"component","visibility_field":null,"is_on_bug_entry":false,"id":15,"value_field":"product","display_name":"Component","visibility_values":[],"is_mandatory":true},{"visibility_values":[],"is_mandatory":false,"display_name":"AssignedTo","visibility_field":null,"name":"assigned_to","id":16,"is_on_bug_entry":false,"type":0,"is_custom":false},{"display_name":"ReportedBy","visibility_values":[],"is_mandatory":false,"type":0,"is_custom":false,"is_on_bug_entry":false,"id":17,"name":"reporter","visibility_field":null},{"display_name":"Votes","visibility_values":[],"is_mandatory":false,"type":0,"is_custom":false,"is_on_bug_entry":false,"id":18,"name":"votes","visibility_field":null},{"type":0,"is_custom":false,"id":19,"is_on_bug_entry":false,"visibility_field":null,"name":"qa_contact","display_name":"QAContact","is_mandatory":false,"visibility_values":[]},{"id":20,"is_on_bug_entry":false,"name":"cc","visibility_field":null,"is_custom":false,"type":0,"visibility_values":[],"is_mandatory":false,"display_name":"CC"},{"display_name":"Depends - on","is_mandatory":false,"visibility_values":[],"is_custom":false,"type":0,"is_on_bug_entry":false,"id":21,"name":"dependson","visibility_field":null},{"is_custom":false,"type":0,"is_on_bug_entry":false,"id":22,"name":"blocked","visibility_field":null,"display_name":"Blocks","is_mandatory":false,"visibility_values":[]},{"display_name":"Attachment - description","visibility_values":[],"is_mandatory":false,"type":0,"is_custom":false,"visibility_field":null,"name":"attachments.description","id":23,"is_on_bug_entry":false},{"is_custom":false,"type":0,"id":24,"is_on_bug_entry":false,"name":"attachments.filename","visibility_field":null,"display_name":"Attachment - filename","visibility_values":[],"is_mandatory":false},{"visibility_values":[],"is_mandatory":false,"display_name":"Attachment - mime type","id":25,"is_on_bug_entry":false,"visibility_field":null,"name":"attachments.mimetype","type":0,"is_custom":false},{"display_name":"Attachment - is patch","visibility_values":[],"is_mandatory":false,"is_custom":false,"type":0,"name":"attachments.ispatch","visibility_field":null,"is_on_bug_entry":false,"id":26},{"display_name":"Attachment - is obsolete","is_mandatory":false,"visibility_values":[],"type":0,"is_custom":false,"name":"attachments.isobsolete","visibility_field":null,"is_on_bug_entry":false,"id":27},{"visibility_values":[],"is_mandatory":false,"display_name":"Attachment - is private","id":28,"is_on_bug_entry":false,"visibility_field":null,"name":"attachments.isprivate","type":0,"is_custom":false},{"visibility_field":null,"name":"attachments.submitter","id":29,"is_on_bug_entry":false,"type":0,"is_custom":false,"is_mandatory":false,"visibility_values":[],"display_name":"Attachment - creator"},{"name":"target_milestone","visibility_field":null,"value_field":"product","id":30,"is_on_bug_entry":false,"values":[{"sortkey":0,"sort_key":0,"name":"---","visibility_values":["R"],"is_active":true}],"type":0,"is_custom":false,"is_mandatory":false,"visibility_values":[],"display_name":"Target - Milestone"},{"visibility_values":[],"is_mandatory":false,"display_name":"Creation - date","id":31,"is_on_bug_entry":false,"name":"creation_ts","visibility_field":null,"type":0,"is_custom":false},{"visibility_values":[],"is_mandatory":false,"display_name":"Last - changed date","name":"delta_ts","visibility_field":null,"id":32,"is_on_bug_entry":false,"is_custom":false,"type":0},{"display_name":"Comment","visibility_values":[],"is_mandatory":false,"is_custom":false,"type":0,"name":"longdesc","visibility_field":null,"id":33,"is_on_bug_entry":false},{"is_custom":false,"type":0,"is_on_bug_entry":false,"id":34,"visibility_field":null,"name":"longdescs.isprivate","display_name":"Comment - is private","visibility_values":[],"is_mandatory":false},{"type":0,"is_custom":false,"name":"alias","visibility_field":null,"is_on_bug_entry":false,"id":35,"display_name":"Alias","is_mandatory":false,"visibility_values":[]},{"display_name":"Ever - Confirmed","is_mandatory":false,"visibility_values":[],"is_custom":false,"type":0,"visibility_field":null,"name":"everconfirmed","is_on_bug_entry":false,"id":36},{"display_name":"Reporter - Accessible","is_mandatory":false,"visibility_values":[],"is_custom":false,"type":0,"visibility_field":null,"name":"reporter_accessible","id":37,"is_on_bug_entry":false},{"type":0,"is_custom":false,"is_on_bug_entry":false,"id":38,"visibility_field":null,"name":"cclist_accessible","display_name":"CC - Accessible","is_mandatory":false,"visibility_values":[]},{"display_name":"Group","is_mandatory":false,"visibility_values":[],"type":0,"is_custom":false,"visibility_field":null,"name":"bug_group","is_on_bug_entry":false,"id":39},{"visibility_values":[],"is_mandatory":false,"display_name":"Estimated - Hours","is_on_bug_entry":false,"id":40,"visibility_field":null,"name":"estimated_time","is_custom":false,"type":0},{"display_name":"Remaining - Hours","is_mandatory":false,"visibility_values":[],"is_custom":false,"type":0,"visibility_field":null,"name":"remaining_time","id":41,"is_on_bug_entry":false},{"is_custom":false,"type":5,"name":"deadline","visibility_field":null,"is_on_bug_entry":false,"id":42,"display_name":"Deadline","visibility_values":[],"is_mandatory":false},{"visibility_field":null,"name":"commenter","is_on_bug_entry":false,"id":43,"type":0,"is_custom":false,"is_mandatory":false,"visibility_values":[],"display_name":"Commenter"},{"display_name":"Flags","is_mandatory":false,"visibility_values":[],"type":0,"is_custom":false,"is_on_bug_entry":false,"id":44,"name":"flagtypes.name","visibility_field":null},{"display_name":"Flag - Requestee","is_mandatory":false,"visibility_values":[],"is_custom":false,"type":0,"visibility_field":null,"name":"requestees.login_name","id":45,"is_on_bug_entry":false},{"visibility_values":[],"is_mandatory":false,"display_name":"Flag - Setter","is_on_bug_entry":false,"id":46,"visibility_field":null,"name":"setters.login_name","is_custom":false,"type":0},{"visibility_values":[],"is_mandatory":false,"display_name":"Hours - Worked","name":"work_time","visibility_field":null,"id":47,"is_on_bug_entry":false,"is_custom":false,"type":0},{"visibility_values":[],"is_mandatory":false,"display_name":"Percentage - Complete","is_on_bug_entry":false,"id":48,"visibility_field":null,"name":"percentage_complete","is_custom":false,"type":0},{"type":0,"is_custom":false,"id":49,"is_on_bug_entry":false,"name":"content","visibility_field":null,"display_name":"Content","is_mandatory":false,"visibility_values":[]},{"is_mandatory":false,"visibility_values":[],"display_name":"Attachment - data","id":50,"is_on_bug_entry":false,"name":"attach_data.thedata","visibility_field":null,"type":0,"is_custom":false},{"is_custom":false,"type":0,"visibility_field":null,"name":"owner_idle_time","id":52,"is_on_bug_entry":false,"display_name":"Time - Since Assignee Touched","is_mandatory":false,"visibility_values":[]},{"visibility_values":[],"is_mandatory":false,"display_name":"Days - since bug changed","visibility_field":null,"name":"days_elapsed","is_on_bug_entry":false,"id":53,"is_custom":false,"type":0},{"is_mandatory":false,"visibility_values":[],"display_name":"See - Also","is_on_bug_entry":false,"id":54,"name":"see_also","visibility_field":null,"is_custom":false,"type":7},{"is_mandatory":false,"visibility_values":[],"display_name":"Number - of Comments","name":"longdescs.count","visibility_field":null,"id":55,"is_on_bug_entry":false,"type":0,"is_custom":false},{"is_mandatory":false,"visibility_values":[],"display_name":"Personal - Tags","name":"tag","visibility_field":null,"is_on_bug_entry":false,"id":56,"type":8,"is_custom":false},{"is_on_bug_entry":false,"id":57,"visibility_field":null,"name":"assigned_to_realname","type":0,"is_custom":false,"visibility_values":[],"is_mandatory":false,"display_name":"AssignedToName"},{"display_name":"ReportedByName","is_mandatory":false,"visibility_values":[],"type":0,"is_custom":false,"is_on_bug_entry":false,"id":58,"visibility_field":null,"name":"reporter_realname"},{"display_name":"QAContactName","is_mandatory":false,"visibility_values":[],"type":0,"is_custom":false,"visibility_field":null,"name":"qa_contact_realname","is_on_bug_entry":false,"id":59},{"is_custom":false,"type":5,"name":"last_visit_ts","visibility_field":null,"is_on_bug_entry":false,"id":60,"display_name":"Last - Visit","visibility_values":[],"is_mandatory":false},{"visibility_values":[],"is_mandatory":false,"display_name":"Comment - Tag","name":"comment_tag","visibility_field":null,"id":61,"is_on_bug_entry":false,"is_custom":false,"type":0},{"is_custom":false,"type":0,"is_on_bug_entry":false,"id":62,"name":"dupe_of","visibility_field":null,"display_name":"Duplicate - of","is_mandatory":false,"visibility_values":[]}]}' - recorded_at: 2021-02-20 09:20:28 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_history.json b/tests/fixtures/get_history.json new file mode 100644 index 0000000..188fc4f --- /dev/null +++ b/tests/fixtures/get_history.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/1/history","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Sat, 27 Apr 2024 09:48:09 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-password, x-bugzilla-api-key, x-bugzilla-login, x-bugzilla-token","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"error\":true}"}},"recorded_at":"2024-04-27 09:48:09 GMT","recorded_with":"vcr/1.2.2, webmockr/0.9.0"}]} diff --git a/tests/fixtures/get_history.yml b/tests/fixtures/get_history.yml deleted file mode 100644 index 75389f1..0000000 --- a/tests/fixtures/get_history.yml +++ /dev/null @@ -1,37 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug/1/history - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - date: Mon, 15 Feb 2021 18:58:21 GMT - server: gazelle - etag: P77lijcRhgnDxbKQvkQKRQ - content-length: '1253' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-login, x-bugzilla-token, x-bugzilla-password, x-bugzilla-api-key - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"bugs":[{"id":1,"history":[{"when":"2010-02-16T17:43:29Z","who":"admin@urbanek.info","changes":[{"field_name":"attachments.mimetype","removed":"application/octet-stream","added":"text/plain","attachment_id":1}]},{"when":"2010-03-09T18:14:23Z","changes":[{"added":"simon.urbanek@r-project.org","field_name":"cc","removed":""}],"who":"simon.urbanek@r-project.org"},{"changes":[{"field_name":"status","removed":"NEW","added":"RESOLVED"},{"added":"FIXED","removed":"","field_name":"resolution"}],"who":"admin@urbanek.info","when":"2010-03-10T16:54:39Z"},{"when":"2014-04-19T11:23:06Z","changes":[{"added":"15763","field_name":"depends_on","removed":""}],"who":"shanghaihuinanzhen@163.com"},{"who":"shanghaihuinanzhen@163.com","changes":[{"added":"15764","removed":"","field_name":"depends_on"}],"when":"2014-04-19T11:25:51Z"},{"when":"2014-07-08T07:00:35Z","changes":[{"removed":"","field_name":"depends_on","added":"15862"}],"who":"kaushjaiswal@gmail.com"},{"changes":[{"removed":"RESOLVED","field_name":"status","added":"CLOSED"}],"who":"maechler@stat.math.ethz.ch","when":"2015-12-14T13:44:54Z"},{"when":"2018-01-16T16:21:14Z","who":"maechler@stat.math.ethz.ch","changes":[{"field_name":"version","removed":"R - 2.11.0","added":"R 2.y.z"}]}],"alias":[]}]}' - recorded_at: 2021-02-15 18:58:22 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_history_fails.json b/tests/fixtures/get_history_fails.json new file mode 100644 index 0000000..9a17376 --- /dev/null +++ b/tests/fixtures/get_history_fails.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/bug/2/history","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Sat, 27 Apr 2024 09:48:10 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-login, x-bugzilla-token, x-bugzilla-api-key, x-bugzilla-password","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"code\":\"306\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"error\":true}"}},"recorded_at":"2024-04-27 09:48:10 GMT","recorded_with":"vcr/1.2.2, webmockr/0.9.0"}]} diff --git a/tests/fixtures/get_history_fails.yml b/tests/fixtures/get_history_fails.yml deleted file mode 100644 index f5766a8..0000000 --- a/tests/fixtures/get_history_fails.yml +++ /dev/null @@ -1,37 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/bugzilla/rest/bug/2/history - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - Authorization: My bearer token is safe - response: - status: - status_code: 404 - category: Client error - reason: Not Found - message: 'Client error: (404) Not Found' - headers: - date: Sat, 27 Feb 2021 15:27:17 GMT - server: gazelle - etag: +T5OLgUvQpBMFyo+y7Jixw - content-length: '128' - content-type: application/json; charset=UTF-8 - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-api-key, x-bugzilla-password, x-bugzilla-token, x-bugzilla-login - access-control-allow-origin: '*' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"code":"101","documentation":"https://bugzilla.readthedocs.org/en/latest/api/","error":true,"message":"Bug - #2 does not exist."}' - recorded_at: 2021-02-27 15:27:17 GMT - recorded_with: vcr/0.6.0, webmockr/0.7.4 diff --git a/tests/fixtures/get_user.json b/tests/fixtures/get_user.json new file mode 100644 index 0000000..6a9bc24 --- /dev/null +++ b/tests/fixtures/get_user.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/user/2","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 10:00:00 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-api-key, x-bugzilla-password, x-bugzilla-token, x-bugzilla-login","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","set-cookie":"Bugzilla_login_request_cookie=sMrKpYec7v; domain=bugs.r-project.org; path=/; secure; HttpOnly","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"error\":true,\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"code\":\"306\"}"}},"recorded_at":"2022-11-18 10:00:00 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_user.yml b/tests/fixtures/get_user.yml deleted file mode 100644 index de62c51..0000000 --- a/tests/fixtures/get_user.yml +++ /dev/null @@ -1,42 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/rest/user/2 - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - server: nginx - date: Sat, 06 Nov 2021 16:05:59 GMT - content-type: application/json; charset=UTF-8 - content-length: '121' - etag: 6poHRz3to1elvvFf5cDdKQ - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-api-key, x-bugzilla-password, x-bugzilla-login, x-bugzilla-token - access-control-allow-origin: '*' - content-security-policy: default-src 'self'; script-src 'self' 'unsafe-inline' - 'unsafe-eval'; style-src 'self' 'unsafe-inline' - x-content-security-policy: default-src 'self'; script-src 'self' 'unsafe-inline' - 'unsafe-eval'; style-src 'self' 'unsafe-inline' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-webkit-csp: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; - style-src 'self' 'unsafe-inline' - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"users":[{"id":2,"can_login":true,"name":"jitterbug-import","real_name":"Jitterbug - compatibility account","groups":[]}]}' - recorded_at: 2021-11-06 16:05:59 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/get_user2.json b/tests/fixtures/get_user2.json new file mode 100644 index 0000000..e3ae1a5 --- /dev/null +++ b/tests/fixtures/get_user2.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://bugs.r-project.org/rest/user?ids=1&ids=2","body":{"encoding":"","string":""},"headers":{"Accept":"application/json, text/xml, application/xml, */*","X-BUGZILLA-API-KEY":"Removing this header too just in case","User-Agent":"https://github.com/llrs/bugRzilla/"}},"response":{"status":{"status_code":400,"category":"Client error","reason":"Bad Request","message":"Client error: (400) Bad Request"},"headers":{"server":"nginx","date":"Fri, 18 Nov 2022 10:00:00 GMT","content-type":"application/json; charset=UTF-8","content-length":"185","etag":"1oNltT0syPlwGjTgxxVL6g","access-control-allow-headers":"accept, content-type, origin, user-agent, x-requested-with, x-bugzilla-login, x-bugzilla-token, x-bugzilla-api-key, x-bugzilla-password","access-control-allow-origin":"*","content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-security-policy":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-webkit-csp":"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'","x-xss-protection":"1; mode=block"},"body":{"encoding":"","file":false,"string":"{\"error\":true,\"message\":\"The API key you specified is invalid. Please check that you typed it correctly.\",\"documentation\":\"https://bugzilla.readthedocs.org/en/latest/api/\",\"code\":\"306\"}"}},"recorded_at":"2022-11-18 10:00:01 GMT","recorded_with":"vcr/1.2.0, webmockr/0.8.2"}]} diff --git a/tests/fixtures/get_user2.yml b/tests/fixtures/get_user2.yml deleted file mode 100644 index 4da8ed3..0000000 --- a/tests/fixtures/get_user2.yml +++ /dev/null @@ -1,42 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://bugs.r-project.org/rest/user?ids=1&ids=2 - body: - encoding: '' - string: '' - headers: - Accept: application/json, text/xml, application/xml, */* - X-BUGZILLA-API-KEY: Removing this header too just in case - User-Agent: https://github.com/llrs/bugRzilla/ - response: - status: - status_code: 200 - category: Success - reason: OK - message: 'Success: (200) OK' - headers: - server: nginx - date: Sat, 06 Nov 2021 16:05:59 GMT - content-type: application/json; charset=UTF-8 - content-length: '215' - etag: mz+olahE9YOtDw3P3RaKZg - access-control-allow-headers: accept, content-type, origin, user-agent, x-requested-with, - x-bugzilla-login, x-bugzilla-token, x-bugzilla-password, x-bugzilla-api-key - access-control-allow-origin: '*' - content-security-policy: default-src 'self'; script-src 'self' 'unsafe-inline' - 'unsafe-eval'; style-src 'self' 'unsafe-inline' - x-content-security-policy: default-src 'self'; script-src 'self' 'unsafe-inline' - 'unsafe-eval'; style-src 'self' 'unsafe-inline' - x-content-type-options: nosniff - x-frame-options: SAMEORIGIN - x-webkit-csp: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; - style-src 'self' 'unsafe-inline' - x-xss-protection: 1; mode=block - body: - encoding: UTF-8 - file: no - string: '{"users":[{"real_name":"Simon Urbanek","groups":[],"can_login":true,"name":"admin@urbanek.info","id":1},{"name":"jitterbug-import","can_login":true,"id":2,"real_name":"Jitterbug - compatibility account","groups":[]}]}' - recorded_at: 2021-11-06 16:05:59 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/testthat/_snaps/api.md b/tests/testthat/_snaps/api.md index a92d085..ac8f063 100644 --- a/tests/testthat/_snaps/api.md +++ b/tests/testthat/_snaps/api.md @@ -2,34 +2,34 @@ Code create_bugzilla_key() - Message - i Reading cached keys on '/home/lluis/.cache/R/bugRzilla/.Renviron'. + Message + i Reading cached keys on '~/.cache/R/bugRzilla/.Renviron'. v Found key `R_BUGZILLA`. v Using key `R_BUGZILLA`. - v Authenticated on this site! + x Not authenticated on this site. # create_bugzilla_key() works [unicode] Code create_bugzilla_key() - Message - ℹ Reading cached keys on '/home/lluis/.cache/R/bugRzilla/.Renviron'. + Message + ℹ Reading cached keys on '~/.cache/R/bugRzilla/.Renviron'. ✔ Found key `R_BUGZILLA`. ✔ Using key `R_BUGZILLA`. - ✔ Authenticated on this site! + ✖ Not authenticated on this site. # set_key works Code sk <- set_key() - Message - i Reading cached keys on '/home/data/.cache/R/bugRzilla/.Renviron'. + Message + i Reading cached keys on '~/.cache/R/bugRzilla/.Renviron'. v Found key `R_BUGZILLA`. v Using key `R_BUGZILLA`. Code expect_equal(write_renviron(key = sk, value = sk, file = app_file()), NULL) - Message - v Storing key on '/home/data/.cache/R/bugRzilla/.Renviron'. + Message + v Storing key on '~/.cache/R/bugRzilla/.Renviron'. # check_key() works [plain] @@ -49,14 +49,14 @@ Code use_key(missing_key()) - Message + Message v Using key `R_BUGZILLA`. # use_key() works [unicode] Code use_key(missing_key()) - Message + Message ✔ Using key `R_BUGZILLA`. # valid_key() works [plain] diff --git a/tests/testthat/_snaps/get_user.md b/tests/testthat/_snaps/get_user.md index 8b079b2..c13dcc6 100644 --- a/tests/testthat/_snaps/get_user.md +++ b/tests/testthat/_snaps/get_user.md @@ -2,13 +2,13 @@ Code use_key() - Message + Message v Using key `R_BUGZILLA`. # get_user multiple ids Code use_key() - Message + Message v Using key `R_BUGZILLA`. diff --git a/tests/testthat/setup-bugRzilla.R b/tests/testthat/helper-vcr.R similarity index 62% rename from tests/testthat/setup-bugRzilla.R rename to tests/testthat/helper-vcr.R index 76b34cc..c6ff449 100644 --- a/tests/testthat/setup-bugRzilla.R +++ b/tests/testthat/helper-vcr.R @@ -10,12 +10,14 @@ if (!nzchar(Sys.getenv("R_BUGZILLA"))) { } } -use_key() +use_key("R_BUGZILLA") invisible(vcr::vcr_configure( - dir = vcr_dir, - filter_request_headers = list( - "Authorization" = "My bearer token is safe", - "X-BUGZILLA-API-KEY" = "Removing this header too just in case") + dir = vcr_dir, + filter_request_headers = list( + "Authorization" = "My bearer token is safe", + "X-BUGZILLA-API-KEY" = "Removing this header too just in case"), + serialize_with = "json" )) vcr::check_cassette_names() + diff --git a/tests/testthat/test-api.R b/tests/testthat/test-api.R index 193b7f5..57b020f 100644 --- a/tests/testthat/test-api.R +++ b/tests/testthat/test-api.R @@ -3,7 +3,7 @@ cli::test_that_cli(configs = c("plain", "unicode"), "create_bugzilla_key() works skip_on_ci() expect_snapshot({ create_bugzilla_key() - }) + }, transform = function(x){gsub("/home/\\w+/", "~/", x)}) }) @@ -13,7 +13,7 @@ test_that("set_key works", { expect_snapshot({ sk <- set_key() expect_equal(write_renviron(key = sk, value = sk, file = app_file()), NULL) - }) + }, transform = function(x){gsub("/home/\\w+/", "~/", x)}) }) @@ -22,14 +22,14 @@ cli::test_that_cli(configs = c("plain", "unicode"), "check_key() works", { skip_on_ci() expect_snapshot({ check_key(key_name = missing_key(), verbose = FALSE) - }) + }, transform = function(x){gsub("/home/\\w+/", "~/", x)}) }) # This is to check the use_key function cli::test_that_cli(configs = c("plain", "unicode"), "use_key() works", { expect_snapshot({ use_key(missing_key()) - }) + }, transform = function(x){gsub("/home/\\w+/", "~/", x)}) }) @@ -46,5 +46,5 @@ test_that("check_last_audit works", { cli::test_that_cli("valid_key() works", { expect_snapshot({ valid_key(key = "hgfcchg12") - }) + }, transform = function(x){gsub("/home/\\w+/", "~/", x)}) }) diff --git a/tests/testthat/test-get_user.R b/tests/testthat/test-get_user.R index e669798..021de86 100644 --- a/tests/testthat/test-get_user.R +++ b/tests/testthat/test-get_user.R @@ -2,7 +2,7 @@ test_that("get_user works", { skip_on_cran() expect_snapshot({ use_key() - }) + }, transform = function(x){gsub("/home/\\w+/", "~/", x)}) vcr::use_cassette("get_user", { gu <- get_user(2) }) @@ -16,7 +16,7 @@ test_that("get_user multiple ids", { skip_on_cran() expect_snapshot({ use_key() - }) + }, transform = function(x){gsub("/home/\\w+/", "~/", x)}) vcr::use_cassette("get_user2", { gu <- get_user(c(1, 2)) }) diff --git a/tests/testthat/test-post_bug.R b/tests/testthat/test-post_bug.R new file mode 100644 index 0000000..c0c4980 --- /dev/null +++ b/tests/testthat/test-post_bug.R @@ -0,0 +1,14 @@ +test_that("post_bug works", { + skip("Test manually") + # Make sure the right one is on + check_key("R_DEV_BUGZILLA") + check_authentication(host = "https://rbugs-devel.urbanek.info/") + # Make the actual request + report <- post_r_bug(text = "testing 5", + title = "Posting bug from within R", + op_sys = "Other", # OS/Version + rep_platform = "Other", # GF Platform + key = "R_DEV_BUGZILLA") + # check the reports on https://rbugs-devel.urbanek.info/buglist.cgi?bug_status=__open__&list_id=18286&order=changeddate%20DESC%2Cpriority%2Cbug_severity&query_format=specific + stopifnot(is.numeric(report)) +}) diff --git a/tests/testthat/test-post_comment.R b/tests/testthat/test-post_comment.R index 364c2ac..e0ef7d4 100644 --- a/tests/testthat/test-post_comment.R +++ b/tests/testthat/test-post_comment.R @@ -1,3 +1,11 @@ -test_that("post_comment works", { - expect_equal(2 * 2, 4) -}) + +# Website is no longer available +# test_that("post_comment works", { +# vcr::use_cassette("post_comment", { +# pc <- post_comment(issue = 1, comment = "testing", +# host = "https://rbugs-devel.urbanek.info/", +# key = "R_DEV_BUGZILLA") +# }) +# expect_true(is.numeric(pc)) +# +# }) diff --git a/vignettes/bugRzilla.Rmd b/vignettes/bugRzilla.Rmd index 39f7a5b..1755156 100644 --- a/vignettes/bugRzilla.Rmd +++ b/vignettes/bugRzilla.Rmd @@ -22,20 +22,13 @@ library(bugRzilla) Some time ago the R core team [requested](https://developer.r-project.org/Blog/public/2019/10/09/r-can-use-your-help-reviewing-bug-reports/index.html) help with bugs in bugzilla. Some time later on a [thank you post](https://developer.r-project.org/Blog/public/2019/12/16/thanks-for-reviewing-bug-reports/index.html) they reported bugs closed over time. -Which pointed out that we, users, package developer might not be helping enough. -This packages tries to lower the barrier to improve R by finding bugs, testing and checking they are reproducible. +This packages tries to lower the barrier to improve R by helping filling and navigating bugs. -To do so this package is to support ease the interaction with bugzilla for a user who wants to: - -- see what happened/what's happening. - -- submit/validate/comment on existing issues. - -To do so it uses the Bugzilla API[^1] and sometimes the accessible xml files. +This package is to support ease the interaction with bugzilla for a user who wants to submit/validate/comment on existing issues using the Bugzilla API[^1]. [^1]: The full documentation of the API is [here](https://bugzilla.readthedocs.io/en/latest/api/index.html "API documentation"). -# The package +# Checking Bugzilla We can check if there has been an update recently with: @@ -50,7 +43,7 @@ check_last_audit() To get information about which issues exists you can call `get_bug()` : ```{r bugs} -bugs <- get_bug(1:100) +bugs <- get_bug(1:5) head(bugs) plot(bugs$id, bugs$creation_time, main = "Bug ID vs creation time", xlab = "ID",