Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for externally scored packages #70

Merged
merged 31 commits into from
Aug 13, 2024
Merged

Add support for externally scored packages #70

merged 31 commits into from
Aug 13, 2024

Conversation

kyleam
Copy link
Collaborator

@kyleam kyleam commented Aug 5, 2024

This series teaches render_scorecard() how to render a scorecard from a set of files created by an external scorer (i.e. something other than score_pkg()). These files capture much of the same information as *.scorecard.json and the various RDS files.

Series overview

The main feature change comes with commit 22 of the series. The preceding commits are prep commits, as well as minor tweaks and fixes in the area. Most of these are internal facing. I'll highlight commits that change user-facing details or are otherwise worth special attention.

[01/25] DESCRIPTION: bump roxygen2 version
[02/25] test-format-report.R: simplify an assertion
[03/25] scorecard-template.Rmd: fix default parameter values
[04/25] render: allow omitting the dependency table
[05/25] render: don't assume coverage values are already rounded

Commit 5 tweaks how coverage values are rendered. In particular, there will now always be two decimal places (e.g., 100.00% where the old approach would have 100%). I think that consistency is an improvement.

[06/25] format_traceability_matrix: don't require test_dirs column
[07/25] aaa.R: assign *.scorecard.json keys to a variable
[08/25] score_pkg: rename 'covr' metric to 'coverage'
[09/25] format_appendix: rename 'R Script' column to 'Code File'

Commit 9 renames the coverage 'R Script' column to 'Code file', even for R packages. I think that works, but it may be worth sticking with 'R Script' for R packages to minimize the presentation changes.

[10/25] create_extra_notes: rename covr_results_df to cov_results_df
[11/25] format_appendix: rename variables to replace "covr" with "cov"
[12/25] map_answer: make including check score optional
[13/25] format_traceability_matrix: avoid formula for purrr function
[14/25] format_traceability_matrix: avoid range for column selection
[15/25] format_metadata: don't error if sys or env_vars is missing
[16/25] score_pkg: record scorecard_type
[17/25] score_pkg: add mpn_scorecard_format key to *.scorecard.json
[18/25] render_scorecard: fix a checkmate assertion
[19/25] render_scorecard: drop note about traceability matrix file
[20/25] render_scorecard: move preparation of params to dedicated function
[21/25] get_result_path: add extensions for externally scored packages
[22/25] render_scorecard: support externally scored packages
[23/25] external: make coverage optional

Commits 22 and 23 introduce the main feature.

[24/25] external: add some basic validation of inputs
[25/25] format_appendix: wrap file column in coverage table

This last commit is needed to prevent a couple of code files in the bbi repo from getting truncated in the coverage table. I'm choosing the wrap width by trial and error, but, if there's some systematic way to do that based on the page and column width values, please let me know. (That seems unlikely, especially because it's not a fixed-width font.)

Testing notes

You can use the new local_create_external_results() helper to create a directory of external results for testing.

> rdir <- local_create_external_results()
> render_scorecard(rdir)

I'll also send results for bbi and pkgr out of band.

@kyleam kyleam force-pushed the external branch 2 times, most recently from e80f0c0 to 2776da4 Compare August 6, 2024 04:14
kyleam added 20 commits August 6, 2024 16:38
The test of format_scores_for_render() constructs the set of expected
criteria from the object read from *.scorecard.json, tweaking for the
renames of the testing criteria.  This makes it difficult for a reader
to know what's expected.

Reduce the amount of code logic in the test by replacing this logic
with a hard-coded list of expected criteria.
The scorecard template uses values like "r NULL" and "`r NA`" for the
parameter defaults.  If these values aren't specified during the
rmarkdown::render(), they come through as strings (e.g., "r NULL" and
"`r NA`"), not the intended R objects.

At the moment, this doesn't matter because all the values are supplied
to the rmarkdown::render() call.  But that will change when support
for externally scored packages is added and dep_versions_df is left
unspecified.

Set the defaults to all these values to null, allowing downstream R
code to check whether the parameter is specified with is.null().
The dependency table, at least as coded, is very tied to R.  An
upcoming commit will add support for rendering a scorecard for non-R
packages.

Place the guard in format_dependency_versions() rather than the
scorecard-template.Rmd block for consistency with format_comments()
and format_traceability_matrix().
format_appendix() and format_scores_for_render() rely on the coverage
values coming in rounded.  An upcoming commit will allow rendering a
scorecard for non-R packages, with coverage values coming from an
external source.  In that case, we can't expect the values to come in
rounded, and, in any case, it makes sense for rendering code to be
responsible for the rendered format.

With this change, the values are always rendered to two decimal places
(e.g., "100.00%" instead of "100%").  That has the advantage of nicer
alignment in the table.
An upcoming commit will add support for externally scored packages,
and test_dirs won't provided for that input.
'covr' is tied to a particular package and language.  Instead choose a
name that is based on the result type.
An upcoming commit will add support for externally scored non-R
packages, in which case 'R Script' doesn't work for the column name.

We could switch from 'R script' to something else at runtime base on
the type of package being scored.  However, 'Code File' seems
appropriate enough for the coverage result of any type of package, so
go with that to avoid unnecessary branching in the code and divergence
in the report.
Use a key that can also work for the coverage data coming in from
externally scored non-R packages.
format_appendix() will also process coverage data from non-R packages,
so choose a name that reflects that.
The 'R CMD check' score factors in the numbers of
notes/warnings/errors in addition to whether the tests passed or
failed, so it's a score in the 0 to 1 range.  However, package types
other than R will likely only have a pass/fail, in which case it
doesn't make sense to display the specific score.
Formulas prevent 'R CMD check' from detecting issues like undefined
variables.  Use a standard anonymous function instead.
format_traceability_matrix() selects columns for text wrapping with a
range.  Instead use a vector, which makes it easier for the reader to
know which columns were intended and makes it less likely to behave
unexpectedly if the data frame structure changes.
If either sys or env_vars is missing, format_metadata() errors with

  Error in t.default(unlist(NULL)) : argument is not a matrix

To prepare for the upcoming introduction of the externally scored
input, rework format_metadata() to not require sys and env_vars and to
abort if date or executor isn't specified.
An upcoming commit will add support for non-R packages.  In practice,
we can detect an R package versus non-R package by looking at the
files in the results directory, but we might as well explicitly record
a type when dumping the scores for an R package.
Version the on-disk format.  If we need to do a major rework of the
format, this provides a mechanism to signal the change and to detect
older formats.
results_dir is fed directly to get_result_path(), so NULL is not okay:

  > get_result_path(NULL, "scorecard.pdf")
  Error in basename(out_dir) : a character vector argument expected
This note isn't relevant for the user.  The *.export_doc.rds file is
not something that they should ever write without the help of
make_traceability_matrix(), and we do not advertise the underlying
structure.

And with upcoming support for externally scored package, a
user-defined matrix can come in through a YAML file.
Externally scored packages are going to pass in different parameters.
Move the parameter preparation for "internally" scored packages
outside of render_scorecard() so that render_scorecard() can handle
both internally or externally scored packages by selecting which param
function to call.
@kyleam kyleam marked this pull request as ready for review August 6, 2024 21:49
@kyleam kyleam requested review from barrettk and seth127 August 6, 2024 21:49
@barrettk
Copy link
Collaborator

barrettk commented Aug 7, 2024

Not sure if this was discussed elsewhere, but was there any thought about adding support for externally scored packages to to summarize_package_results() and render_scorecard_summary()?

Comment on lines +44 to +47
scorecard_type <- params[["pkg_scores"]][["scorecard_type"]]
if (is.null(scorecard_type)) {
stop("pkg_scores unexpectedly does not have 'scorecard_type' field")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I took a look at the format_traceability_matrix() changes too; specifically noting how the report changes for R packages` versus the external ones ('command' vs 'exported function').

Was there any consideration about more clearly denoting the scorecard_type within the report?

Copy link
Collaborator Author

@kyleam kyleam Aug 7, 2024

Choose a reason for hiding this comment

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

Was there any consideration about more clearly denoting the scorecard_type within the report?

I'm open to suggestions. I personally don't see the value/need to show that at the report level.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm open to suggestions

I was thinking of maybe modifying one of the first few sentences to just more explicitly state the software type, but I think @seth127 would be better suited to chime in here. Was mostly wondering if it might be desirable for QA folks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

modifying one of the first few sentences to just more explicitly state the software type

Somewhat related to that: I did look through the PDF for parts that seemed too tied to the R context, but I didn't spot anything. Please let me know if you do.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is an interesting question. At this point, I don't see a clear right-or-wrong answer, but I'll continue to mull it over.

In absence of a reason to add it, I would say to leave it as is.

@kyleam
Copy link
Collaborator Author

kyleam commented Aug 7, 2024

was there any thought about adding support for externally scored packages to to summarize_package_results() and render_scorecard_summary()?

Only to the extent of "I don't think we need to deal with that now". We don't have a use case at the moment (whereas for R packages, there's MPN). My preference would be to leave it be unless we think something here seems like a step in the wrong direction if we later want to add support.

But it's a good point, and I should at least 1) document that it's not supported and 2) make sure the error is reasonable if those are called with an external results directory.

R/external.R Outdated Show resolved Hide resolved
Copy link
Collaborator

@barrettk barrettk left a comment

Choose a reason for hiding this comment

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

This is looking good (sorry for the disorganized review). Left a couple comments but the technical changes look good to me.

Though exporting local_create_external_results might be overkill, it would be nice to provide more support for setting this up, especially given the required file naming conventions.

  • If it were me, and I was testing this package out from outside Metrum (not setting up a pipeline), I would want to start with a template and manually adjust the scores & names to get the report im looking for. Would be nice to have some 'create external template' helper. Perhaps not worth worrying about, but just wanted to give me two cents.

Will re-review after the other documentation changes discussed above have been added.

Comment on lines +5 to +10
local_create_external_results <- function(pattern = "mpn-scorecard-tests-",
.local_envir = parent.frame(),
clean = TRUE) {
tdir <- withr::local_tempdir(
pattern = pattern, .local_envir = .local_envir, clean = clean
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could export local_create_external_results() (perhaps with different name), and reference in external_scores documentation to see an example. Just thinking out loud

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. My preference at this point would be to avoid adding something to the NAMESPACE that has unclear value. If that usefulness becomes clear later, it's easy to move/rename/export.

Though exporting local_create_external_results might be overkill, it would be nice to provide more support for setting this up, especially given the required file naming conventions.

I don't think these are files that anyone would want to set up by hand (with the exception of the traceability yaml). You'd always have tooling to generate these automatically.

tests/testthat/test-format-report-external.R Show resolved Hide resolved
@kyleam
Copy link
Collaborator Author

kyleam commented Aug 8, 2024

@barrettk Thanks for the review.

Pushed updates:

  • update summary functions to guard against internal scores (79113d7)

  • add pointer to readme (0014b15)

@kyleam kyleam requested a review from barrettk August 8, 2024 14:41
seth127
seth127 previously requested changes Aug 9, 2024
Copy link
Collaborator

@seth127 seth127 left a comment

Choose a reason for hiding this comment

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

I think this is looking great! I had a few small questions (and one docs typo), but once those are answered or addressed, I think this is ready to merge. Thanks @kyleam , and thanks @barrettk for the more technical code review.

R/external.R Outdated Show resolved Hide resolved
R/external.R Outdated Show resolved Hide resolved
wrap_text(.x, width = 24, indent = TRUE, strict = TRUE)),
dplyr::across(
all_of(c(entry_name, "code_file", "documentation")),
function(x) wrap_text(x, width = 24, indent = TRUE, strict = TRUE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is quite the right section of the code for this comment, but it seems close enough...

I noticed that, in the Traceability Matrix, the text-wrapping on the Documentation column looks nicer than in the Test Files column. Specifically, it attempts to split on separators and indents the wrapped lines. For example:

Screenshot 2024-08-09 at 5 12 37 PM

I'm assuming there's a reason for this, but if it's easy enough to fix, can we make the Test Files column have the nicer wrapping too?

This is a bit of a nit pick though, so if there's an implementation reason why this is difficult, it's really not necessary to spend much time on it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm assuming there's a reason for this, but if it's easy enough to fix, can we make the Test Files column have the nicer wrapping too?

I don't know what the original rationale was (hopefully @barrettk can chime in), but, when working on gh-69, I recall wondering a bit about it and then realizing that indenting, as currently implemented by wrap_text, shouldn't be applied because that would lead to confusing indentation for the remaining files. (Basically, I think it's meant only for scalar values.)

Example with indent = TRUE and default wrap_sym characters:

diff --git a/R/format-report.R b/R/format-report.R
index 1b24d0a..7b248fb 100644
--- a/R/format-report.R
+++ b/R/format-report.R
@@ -730,7 +730,7 @@ format_traceability_matrix <- function(
           ),
           # Tests can be longer due to page width (pg_width) settings (we make it wider)
           test_files = purrr::map_chr(.data$test_files, function(tests){
-            wrap_text(tests, width = 40, strict = TRUE, wrap_sym = NULL)
+            wrap_text(tests, width = 40, indent = TRUE, strict = TRUE)
           })
         )
     }

20240809T182006

Still, I think it'd be an improvement to at least wrap on the default wrap_sym characters (at least in this example):

diff --git a/R/format-report.R b/R/format-report.R
index 1b24d0a..e6d120f 100644
--- a/R/format-report.R
+++ b/R/format-report.R
@@ -730,7 +730,7 @@ format_traceability_matrix <- function(
           ),
           # Tests can be longer due to page width (pg_width) settings (we make it wider)
           test_files = purrr::map_chr(.data$test_files, function(tests){
-            wrap_text(tests, width = 40, strict = TRUE, wrap_sym = NULL)
+            wrap_text(tests, width = 40, strict = TRUE)
           })
         )
     }

20240809T182207

Copy link
Collaborator Author

@kyleam kyleam Aug 12, 2024

Choose a reason for hiding this comment

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

I looked over the PR discussion and commit messages in the original wrap_text PR (gh-57), and I didn't spot any discussion of why test_files uses wrap_sym = NULL.

I'll add a commit here that drops wrap_sym = NULL.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe wrap_sym = NULL was set for test files to avoid the issue you highlighted above (caused too many new lines that made it harder to read). Indents were not meant to be made for additional elements in a vector (i.e. multiple test files), but rather only when a newline was introduced to due to the column width. Could be worth adjusting in the future but I think your second screenshot looks good

R/format-report.R Show resolved Hide resolved
kyleam added 7 commits August 12, 2024 07:55
With recent commits, all of the formatting functions have been
decoupled, at least conditionally, from the assumption that it is an R
package that's being scored.  Define a set of files that any type of
package can use to render a scorecard.

The structure of the results directory for external scores is similar
to that of the directory for "internal" scores.  check.txt replaces
check.rds, coverage.json replaces covr.rds, and matrix.yaml replaces
export_doc.rds.

For scorecard.json, an external _could_ write that file.  But doing so
is awkward because that file includes overall scores derived from
other scores in the file.  To compute those, the external scorer would
need to either duplicate the scoring logic or depend on mpn.scorecard.

So instead have the external scorer produce parts of scorecard.json,
and make mpn.scorecard responsible for stitching those parts together
at render time.

A notable limitation of the external input is that the check values
must be 0 or 1; 0 through 1, like is done for R packages, is not
supported.  There's a number of ways we could add support for this,
but punt on that given that all our initial non-R packages of interest
need only a pass/fail result.
For some externally scored packages, it is not be feasible to
calculate coverage.  Don't bother making coverage optional for
internally scored R packages, because in that case we'll try to
calculate coverage with covr and, at the very least, record the error.
For bbi, two code files exceed the column width, leading to them being
truncated and, for reasons I don't understand, the heading for the
next column ("Test Coverage") being split into two lines.

Based on trial and error, all of bbi's files fit in the column when
wrapped to a width of 45, including bbi's 45-character
"parsers/nmparser/parse_parameter_structure.go".
format_appendix() has a good amount of conditional handling.  Add a
test to make sure the covr failure arm isn't unintentionally made
unreachable by upstream changes.
External scorers are responsible for providing the *.coverage.json,
and that file can have an overall coverage score but not per file
scores.  If there are no rows in the coverage table, replace the table
with a note to make it clear that this is expected rather than a
rendering error.

Thanks to @seth127 for the suggestion.

Re: #70 (comment)
R/format-report.R Outdated Show resolved Hide resolved
kyleam added 3 commits August 12, 2024 08:41
When wrapping the entry point, code file, and documentation file,
format_traceability_matrix() uses wrap_text's default wrap_sym value
so that breaks are made at "/", "_", and "-" to get under the width.
If those splits fail to get the string under the width, then the file
is split at any character.

For tests files, `wrap_sym = NULL` is passed, so wrap_text() goes
straight for splitting at any character, leading to entries like

  .../foo/bar/baz_tes
  t.go

Switch to preferring splits at "/", "_", and "-" so that intra "word"
breaks are less likely.

  .../foo/bar/
  baz_test.go

Re: #70 (comment)
render_scorecard_summary() and summarize_package_results() have not
been reworked to support external scores.  We use these functions for
MPN.  For non-R packages, we don't yet have a need for these
functions.

Document that these functions don't accept external scores, and add a
custom guard so that a more informative error is given if any results
directory with external scores is passed.
@kyleam
Copy link
Collaborator Author

kyleam commented Aug 12, 2024

Updates:

  • add details about purpose of traceability matrix to external_scores documentation (diff)

  • if there is overall coverage but not per file coverage, replace empty table with a note (e17a7c9)

  • fix "no coverage" handling for external scores so that covr failing handling is still reachable (diff, 24bdf6a)

  • prefer breaks at /, _, and _ when wrapping tests files in traceability matrix (cc0b696)

  • typo fixes

range-diff
 1:  8e4e3d9 =  1:  8e4e3d9 DESCRIPTION: bump roxygen2 version
 2:  eeaa1b9 =  2:  eeaa1b9 test-format-report.R: simplify an assertion
 3:  bd85be5 =  3:  bd85be5 scorecard-template.Rmd: fix default parameter values
 4:  01ad5f7 =  4:  01ad5f7 render: allow omitting the dependency table
 5:  606fb49 =  5:  606fb49 render: don't assume coverage values are already rounded
 6:  7d809f6 =  6:  7d809f6 format_traceability_matrix: don't require test_dirs column
 7:  b6527fc =  7:  b6527fc aaa.R: assign *.scorecard.json keys to a variable
 8:  65b029f =  8:  65b029f score_pkg: rename 'covr' metric to 'coverage'
 9:  4602372 =  9:  4602372 format_appendix: rename 'R Script' column to 'Code File'
10:  8022da5 = 10:  8022da5 create_extra_notes: rename covr_results_df to cov_results_df
11:  af60b6d = 11:  af60b6d format_appendix: rename variables to replace "covr" with "cov"
12:  599394f = 12:  599394f map_answer: make including check score optional
13:  693d1c5 = 13:  693d1c5 format_traceability_matrix: avoid formula for purrr function
14:  dcd2ee2 = 14:  dcd2ee2 format_traceability_matrix: avoid range for column selection
15:  91f88b8 = 15:  91f88b8 format_metadata: don't error if sys or env_vars is missing
16:  f81aa48 = 16:  f81aa48 score_pkg: record scorecard_type
17:  6623618 = 17:  6623618 score_pkg: add mpn_scorecard_format key to *.scorecard.json
18:  7f3fe88 = 18:  7f3fe88 render_scorecard: fix a checkmate assertion
19:  7371fdd = 19:  7371fdd render_scorecard: drop note about traceability matrix file
20:  aa2cb8f = 20:  aa2cb8f render_scorecard: move preparation of params to dedicated function
21:  0ca7f5f ! 21:  66e0b02 get_result_path: add extensions for externally scored packages
    @@ R/util.R: check_exists_and_overwrite <- function(path, overwrite) {
     -      "summary.pdf", "export_doc.rds", "mitigation.txt"
     +      "scorecard.json", "scorecard.pdf", "comments.txt", "mitigation.txt",
     +      # Internally scored
    -+      "check.rds", "covr.rds",  "export_doc.rds", "summary.pdf",
    ++      "check.rds", "covr.rds", "export_doc.rds", "summary.pdf",
     +      # Externally scored
     +      "check.txt", "coverage.json", "matrix.yaml", "metadata.json", "pkg.json",
     +      "scores.json"
22:  51a0115 ! 22:  3f0a2f1 render_scorecard: support externally scored packages
    @@ R/external.R (new)
     +#'    ```
     +#'
     +#'  * `<package>_<version>.matrix.yaml`: A file defining entries to render as
    -+#'    the traceability matrix table. This file is optional if the
    -+#'    `add_traceability` argument of [render_scorecard()] is "auto" or `FALSE`.
    ++#'    the traceability matrix table. The traceability matrix table is meant to
    ++#'    map all user-facing entry points (e.g., exported functions or available
    ++#'    commands for a command-line executable) to the relevant documentation and
    ++#'    test files.
     +#'
     +#'    The file should consist of a sequence of entries with the following items:
     +#'
     +#'      * `entrypoint`: The name of the entry point.
     +#'
    -+#'      * `code`: The path to where the entry point is fined.
    ++#'      * `code`: The path to where the entry point is defined.
     +#'
     +#'      * `doc`: The path to the entry point's main documentation.
     +#'
    @@ R/external.R (new)
     +#'    For "cli", the column name is "Command" and, for "R", it is
     +#'    "Exported Function". For all other types, it is "Entry Point".
     +#'
    ++#'    This file is optional if the `add_traceability` argument of
    ++#'    [render_scorecard()] is "auto" or `FALSE`.
    ++#'
     +#'    Example:
     +#'
     +#'    ```
    @@ man/external_scores.Rd (new)
     +\}
     +}\if{html}{\out{</div>}}
     +\item \verb{<package>_<version>.matrix.yaml}: A file defining entries to render as
    -+the traceability matrix table. This file is optional if the
    -+\code{add_traceability} argument of \code{\link[=render_scorecard]{render_scorecard()}} is "auto" or \code{FALSE}.
    ++the traceability matrix table. The traceability matrix table is meant to
    ++map all user-facing entry points (e.g., exported functions or available
    ++commands for a command-line executable) to the relevant documentation and
    ++test files.
     +
     +The file should consist of a sequence of entries with the following items:
     +\itemize{
     +\item \code{entrypoint}: The name of the entry point.
    -+\item \code{code}: The path to where the entry point is fined.
    ++\item \code{code}: The path to where the entry point is defined.
     +\item \code{doc}: The path to the entry point's main documentation.
     +\item \code{tests}: A list of paths where the entry point is tested.
     +}
    @@ man/external_scores.Rd (new)
     +For "cli", the column name is "Command" and, for "R", it is
     +"Exported Function". For all other types, it is "Entry Point".
     +
    ++This file is optional if the \code{add_traceability} argument of
    ++\code{\link[=render_scorecard]{render_scorecard()}} is "auto" or \code{FALSE}.
    ++
     +Example:
     +
     +\if{html}{\out{<div class="sourceCode">}}\preformatted{- entrypoint: foo
23:  67b000b ! 23:  2d5c2ec external: make coverage optional
    @@ R/format-report.R: format_appendix <- function(extra_notes_data, return_vals = F
          cat(sub_header_strs[1])
          cat_verbatim(check_output)
     +
    -+    if (is.null(cov_results_flex)) {
    ++    if (is.null(cov_results_df)) {
     +      # This is an externally scored package without coverage.
     +      return(invisible(NULL))
     +    }
24:  9972377 = 24:  fb70eeb external: add some basic validation of inputs
25:  a24d8bb = 25:  00231b9 format_appendix: wrap file column in coverage table
 -:  ------- > 26:  24bdf6a test-format-report.R: trigger covr failure case
 -:  ------- > 27:  e17a7c9 format_appendix: replace empty coverage table with note
 -:  ------- > 28:  cc0b696 format_traceability_matrix: wrap test files at default characters
26:  79113d7 = 29:  bc4ab1a summary: guard against external scores
27:  0014b15 = 30:  43d391e readme: add short section on external scores

For bbi, the "o" in parsers/nmparser/parse_parameter_comments.go (44
characters) is partially truncated.  Decrease the width by one to
prevent this case, and, given these aren't fixed-width fonts, by one
more to hopefully provide enough margin to avoid this in other cases.
Copy link
Collaborator

@seth127 seth127 left a comment

Choose a reason for hiding this comment

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

This is looking good to me. Thanks for the updates.

Copy link
Collaborator

@barrettk barrettk 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 from my end as well! Thanks for the changes

@kyleam
Copy link
Collaborator Author

kyleam commented Aug 13, 2024

@barrettk @seth127 Thanks for the reviews. In it goes.

@kyleam kyleam merged commit fb4dda3 into main Aug 13, 2024
5 checks passed
@kyleam kyleam deleted the external branch August 13, 2024 17:09
This was referenced Sep 10, 2024
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