AleKoure / Rigma

R client to Figma API
https://alekoure.github.io/Rigma
Other
9 stars 2 forks source link

Error in `req_perform(., error_call = call)`: unused argument (error_call = call) #22

Open AleKoure opened 1 year ago

AleKoure commented 1 year ago

@elipousson I moved your commits to develop.

You can check out from develop and try to resolve the bugs. req_perform() looks like it has an unused argument.

Also, I see that we do two additional changes:

Please try to move this to separate pull requests.

Error (test-add_color.R:4:3): Add color to style data
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
     ▆
  1. ├─... %>% add_color() at test-add_color.R:4:2
  2. ├─Rigma::add_color(.)
  3. ├─Rigma::as_design_tibble(., message = FALSE) at Rigma/R/add_color.R:38:2
  4. ├─Rigma::get_file_styles(file_key = file_key) at Rigma/R/as_design_tibble.R:36:2
  5. │ └─request_figma() %>% ... at Rigma/R/get_file_styles.R:21:2
  6. ├─Rigma:::req_figma_template(...)
  7. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
  8. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
  9. └─httr2::resp_body_json(.)
 10.   └─httr2:::check_response(resp)
 11.     └─httr2:::is_response(req)
────────────────────────────────────────────────────────────────────────────────
✖ | 2       0 | as_design_tibble                                                
────────────────────────────────────────────────────────────────────────────────
Error (test-as_design_tibble.R:4:3): as_design_tibble for file styles is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_file_styles(file_key = file_key) at test-as_design_tibble.R:4:2
 2. │ └─request_figma() %>% ... at Rigma/R/get_file_styles.R:21:2
 3. ├─Rigma:::req_figma_template(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)

Error (test-as_design_tibble.R:12:3): as_design_tibble for file styles is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_team_styles("1168610438838663284") at test-as_design_tibble.R:12:2
 2. │ └─... %>% ... at Rigma/R/get_team_styles.R:42:2
 3. ├─Rigma:::req_figma_query(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_query.R:11:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)
────────────────────────────────────────────────────────────────────────────────
✖ | 1       0 | delete_comment_reactions                                        
────────────────────────────────────────────────────────────────────────────────
Error (test-delete_comment_reactions.R:4:3): DELETE comment reactions is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::post_comment(...) at test-delete_comment_reactions.R:4:2
 2. │ └─... %>% req_figma_perform() at Rigma/R/post_comment.R:54:2
 3. ├─Rigma:::req_figma_perform(.)
 4. │ └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 5. └─httr2::resp_body_json(.)
 6.   └─httr2:::check_response(resp)
 7.     └─httr2:::is_response(req)
────────────────────────────────────────────────────────────────────────────────
✖ | 1       0 | delete_comment                                                  
────────────────────────────────────────────────────────────────────────────────
Error (test-delete_comment.R:4:3): DELETE comment is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::post_comment(...) at test-delete_comment.R:4:2
 2. │ └─... %>% req_figma_perform() at Rigma/R/post_comment.R:54:2
 3. ├─Rigma:::req_figma_perform(.)
 4. │ └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 5. └─httr2::resp_body_json(.)
 6.   └─httr2:::check_response(resp)
 7.     └─httr2:::is_response(req)
────────────────────────────────────────────────────────────────────────────────
✖ | 1       0 | extract_bslib_palette                                           
────────────────────────────────────────────────────────────────────────────────
Error (test-extract_bslib_palette.R:4:3): Extract bslib palette is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
     ▆
  1. ├─... %>% extract_bslib_palette() at test-extract_bslib_palette.R:4:2
  2. ├─Rigma::extract_bslib_palette(.)
  3. │ └─checkmate::assert_class(design_tibble, "design_tibble_style") at Rigma/R/extract_bslib_palette.R:37:2
  4. │   └─checkmate::checkClass(x, classes, ordered, null.ok)
  5. ├─Rigma::add_color(.)
  6. ├─Rigma::as_design_tibble(.) at Rigma/R/add_color.R:38:2
  7. ├─Rigma::get_file_styles(.) at Rigma/R/as_design_tibble.R:36:2
  8. │ └─request_figma() %>% ... at Rigma/R/get_file_styles.R:21:2
  9. ├─Rigma:::req_figma_template(...)
 10. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 11. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 12. └─httr2::resp_body_json(.)
 13.   └─httr2:::check_response(resp)
 14.     └─httr2:::is_response(req)
────────────────────────────────────────────────────────────────────────────────
✖ | 1       0 | get_comments_reactions                                          
────────────────────────────────────────────────────────────────────────────────
Error (test-get_comments_reactions.R:4:3): GET comments reactions client is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::post_comment(...) at test-get_comments_reactions.R:4:2
 2. │ └─... %>% req_figma_perform() at Rigma/R/post_comment.R:54:2
 3. ├─Rigma:::req_figma_perform(.)
 4. │ └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 5. └─httr2::resp_body_json(.)
 6.   └─httr2:::check_response(resp)
 7.     └─httr2:::is_response(req)
────────────────────────────────────────────────────────────────────────────────
✖ | 1       0 | get_comments                                                    
────────────────────────────────────────────────────────────────────────────────
Error (test-get_comments.R:4:3): GET comments client is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_comments(file_key) at test-get_comments.R:4:2
 2. │ └─request_figma() %>% ... at Rigma/R/get_comments.R:21:2
 3. ├─Rigma:::req_figma_template(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)
────────────────────────────────────────────────────────────────────────────────
✖ | 1       0 | get_file_component_sets                                         
────────────────────────────────────────────────────────────────────────────────
Error (test-get_file_component_sets.R:4:3): GET file component sets is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_file_component_sets(file_key = file_key) at test-get_file_component_sets.R:4:2
 2. │ └─request_figma() %>% ... at Rigma/R/get_file_component_sets.R:23:2
 3. ├─Rigma:::req_figma_template(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)
────────────────────────────────────────────────────────────────────────────────
✖ | 1       0 | get_file_components                                             
────────────────────────────────────────────────────────────────────────────────
Error (test-get_file_components.R:4:3): GET file components is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_file_components(file_key = file_key) at test-get_file_components.R:4:2
 2. │ └─request_figma() %>% ... at Rigma/R/get_file_components.R:23:2
 3. ├─Rigma:::req_figma_template(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)
────────────────────────────────────────────────────────────────────────────────
Maximum number of failures exceeded; quitting at end of file.
ℹ Increase this number with (e.g.) testthat::set_max_fails(Inf) 

══ Results ═════════════════════════════════════════════════════════════════════
Duration: 8.6 s

── Failed tests ────────────────────────────────────────────────────────────────
Error (test-add_color.R:4:3): Add color to style data
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
     ▆
  1. ├─... %>% add_color() at test-add_color.R:4:2
  2. ├─Rigma::add_color(.)
  3. ├─Rigma::as_design_tibble(., message = FALSE) at Rigma/R/add_color.R:38:2
  4. ├─Rigma::get_file_styles(file_key = file_key) at Rigma/R/as_design_tibble.R:36:2
  5. │ └─request_figma() %>% ... at Rigma/R/get_file_styles.R:21:2
  6. ├─Rigma:::req_figma_template(...)
  7. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
  8. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
  9. └─httr2::resp_body_json(.)
 10.   └─httr2:::check_response(resp)
 11.     └─httr2:::is_response(req)

Error (test-as_design_tibble.R:4:3): as_design_tibble for file styles is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_file_styles(file_key = file_key) at test-as_design_tibble.R:4:2
 2. │ └─request_figma() %>% ... at Rigma/R/get_file_styles.R:21:2
 3. ├─Rigma:::req_figma_template(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)

Error (test-as_design_tibble.R:12:3): as_design_tibble for file styles is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_team_styles("1168610438838663284") at test-as_design_tibble.R:12:2
 2. │ └─... %>% ... at Rigma/R/get_team_styles.R:42:2
 3. ├─Rigma:::req_figma_query(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_query.R:11:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)

Error (test-delete_comment_reactions.R:4:3): DELETE comment reactions is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::post_comment(...) at test-delete_comment_reactions.R:4:2
 2. │ └─... %>% req_figma_perform() at Rigma/R/post_comment.R:54:2
 3. ├─Rigma:::req_figma_perform(.)
 4. │ └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 5. └─httr2::resp_body_json(.)
 6.   └─httr2:::check_response(resp)
 7.     └─httr2:::is_response(req)

Error (test-delete_comment.R:4:3): DELETE comment is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::post_comment(...) at test-delete_comment.R:4:2
 2. │ └─... %>% req_figma_perform() at Rigma/R/post_comment.R:54:2
 3. ├─Rigma:::req_figma_perform(.)
 4. │ └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 5. └─httr2::resp_body_json(.)
 6.   └─httr2:::check_response(resp)
 7.     └─httr2:::is_response(req)

Error (test-extract_bslib_palette.R:4:3): Extract bslib palette is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
     ▆
  1. ├─... %>% extract_bslib_palette() at test-extract_bslib_palette.R:4:2
  2. ├─Rigma::extract_bslib_palette(.)
  3. │ └─checkmate::assert_class(design_tibble, "design_tibble_style") at Rigma/R/extract_bslib_palette.R:37:2
  4. │   └─checkmate::checkClass(x, classes, ordered, null.ok)
  5. ├─Rigma::add_color(.)
  6. ├─Rigma::as_design_tibble(.) at Rigma/R/add_color.R:38:2
  7. ├─Rigma::get_file_styles(.) at Rigma/R/as_design_tibble.R:36:2
  8. │ └─request_figma() %>% ... at Rigma/R/get_file_styles.R:21:2
  9. ├─Rigma:::req_figma_template(...)
 10. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 11. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 12. └─httr2::resp_body_json(.)
 13.   └─httr2:::check_response(resp)
 14.     └─httr2:::is_response(req)

Error (test-get_comments_reactions.R:4:3): GET comments reactions client is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::post_comment(...) at test-get_comments_reactions.R:4:2
 2. │ └─... %>% req_figma_perform() at Rigma/R/post_comment.R:54:2
 3. ├─Rigma:::req_figma_perform(.)
 4. │ └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 5. └─httr2::resp_body_json(.)
 6.   └─httr2:::check_response(resp)
 7.     └─httr2:::is_response(req)

Error (test-get_comments.R:4:3): GET comments client is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_comments(file_key) at test-get_comments.R:4:2
 2. │ └─request_figma() %>% ... at Rigma/R/get_comments.R:21:2
 3. ├─Rigma:::req_figma_template(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)

Error (test-get_file_component_sets.R:4:3): GET file component sets is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_file_component_sets(file_key = file_key) at test-get_file_component_sets.R:4:2
 2. │ └─request_figma() %>% ... at Rigma/R/get_file_component_sets.R:23:2
 3. ├─Rigma:::req_figma_template(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)

Error (test-get_file_components.R:4:3): GET file components is OK!
Error in `req_perform(., error_call = call)`: unused argument (error_call = call)
Backtrace:
    ▆
 1. ├─Rigma::get_file_components(file_key = file_key) at test-get_file_components.R:4:2
 2. │ └─request_figma() %>% ... at Rigma/R/get_file_components.R:23:2
 3. ├─Rigma:::req_figma_template(...)
 4. │ └─Rigma:::req_figma_perform(.req, call = call) at Rigma/R/req_figma_template.R:52:4
 5. │   └─req %>% req_perform(error_call = call) %>% resp_body_json() at Rigma/R/req_figma_query.R:22:2
 6. └─httr2::resp_body_json(.)
 7.   └─httr2:::check_response(resp)
 8.     └─httr2:::is_response(req)

[ FAIL 10 | WARN 0 | SKIP 0 | PASS 0 ]
══ Terminated early ════════════════════════════════════════════════════════════
elipousson commented 1 year ago

There may be other issues that I didn't catch on the develop branch but we can fix this one by updating the minimum version for httr2. The error_call parameter was added to {httr2} in version 0.2.3. This tripped me up in another package already so I should have remembered!

elipousson commented 1 year ago

The switch to Markdown formatting for the Roxygen documentation is already incorporated into the develop branch. The traditional Roxygen documentation tags still render as expected but I find that Markdown is easier to both read and write.

Exposing the token parameter is simply a way to let people use the functions without setting an environment variable. I don't expect most users would want to use this feature but it would be especially helpful if you are using multiple tokens to access multiple Figma accounts within a single script.

AleKoure commented 1 year ago

@elipousson I agree! Added you as a collaborator to the repo.

In order to work on this bug, you can checkout from develop to a new branch and create a pull request to return to develop.

After I get back from posit::conf(2023) in October, I'll have some free time, so we can fix this and move on to a CRAN release.