Skip to content

Conversation

@richfitz
Copy link
Member

@richfitz richfitz commented May 25, 2022

  • spec.md has been updated or doesn't need to updated

Branch pins should be removed after vimc/orderly1#318 is merged

@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #100 (3b36c3d) into master (1be035c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #100   +/-   ##
=======================================
  Coverage   99.35%   99.36%           
=======================================
  Files          12       12           
  Lines        1083     1095   +12     
=======================================
+ Hits         1076     1088   +12     
  Misses          7        7           
Impacted Files Coverage Δ
R/api.R 99.21% <100.00%> (+0.01%) ⬆️
R/git.R 100.00% <100.00%> (ø)
R/main.R 100.00% <100.00%> (ø)
R/runner.R 100.00% <100.00%> (ø)
R/server.R 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1be035c...3b36c3d. Read the comment docs.

Copy link
Contributor

@r-ash r-ash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, couple of small things I noticed but changes look good

api$handle(endpoint_git_commits(path))
api$handle(endpoint_available_reports(path))
api$handle(endpoint_report_parameters(path))
api$handle(endpoint_git_status(runner))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove path from build_api signature too now it is unused?

R/main.R Outdated
Options:
--port=PORT Port to run on [default: 8321]
--host=HOST IP address owned by this server [default: 0.0.0.0]
--no-ref Prevent git reference switching
Copy link
Contributor

@r-ash r-ash May 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove this from docs too now usage has gone?

Comment on lines +75 to +84
test_that("git_pull", {
path <- orderly_prepare_orderly_git_example()
runner <- mock_runner(root = path[["local"]])
endpoint <- endpoint_git_pull(runner)
res <- endpoint$run()
expect_equal(res$status_code, 200)
expect_equal(res$data, c("From upstream",
" 0fc0d08..0ec7621 master -> origin/master",
"Updating 0fc0d08..0ec7621",
"Fast-forward", " new | 1 +",
" 1 file changed, 1 insertion(+)",
" create mode 100644 new"))
mockery::expect_args(mock_pull, 1, "test_path")
expect_match(res$data, "Fast-forward", all = FALSE)
expect_equal(
git_ref_to_sha("HEAD", path[["local"]]),
git_ref_to_sha("HEAD", path[["origin"]]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks like a better test!

R/runner.R Outdated
Comment on lines 11 to 18
##' @param identity The name of the server identity, as listed in
##' orderly_config.yml's remote section
##'
##' Allow git to change branches/ref for run. If not
##' given, then we will look to see if the orderly configuration
##' disallows branch changes (based on the
##' \code{ORDERLY_API_SERVER_IDENTITY} environment variable and the
##' \code{master_only} setting of the relevant server block.
##' \code{default_branch_only} setting of the relevant server block.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little confusing, how about something like

@param identity The name of the server identity, as listed in orderly_config.yml's remote section. If not given, then we will fall back to using the \code{ORDERLY_API_SERVER_IDENTITY} environment variable. Used to set configuration specific to this server e.g. host, port, teams notification URL, default branch name

Or something similar

@richfitz richfitz marked this pull request as ready for review July 14, 2022 16:21
@richfitz richfitz requested a review from r-ash July 14, 2022 16:21
Copy link
Contributor

@r-ash r-ash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Generally though I am passing through path instead of the whole runner to some of the endpoints when those functions only need the path. I feel like passing the simplest thing through makes the functions interface simpler to understand. I think easier to look at endpoint with just a path and see what it is doing than taking a whole object. Also easier for testing because we don't have to create the object to run the test.

@r-ash r-ash merged commit 56f1af6 into master Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants