-
Notifications
You must be signed in to change notification settings - Fork 30
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
Proposed automerge guideline: Require at least X
lines of Julia code in /src
, test
, docs
/readme/docstrings
#351
Comments
I think we should do all 3 of:
Currently, I haven't found a source-code counter that works on Julia docstrings correctly, so I think we could omit the docs one to start. In terms of the numbers, on Slack @rmsrosa suggested In https://julialang.org/blog/2021/08/general-survey/ we did some of that but we don't have all the info we'd want there, and also the number of packages has grown a lot since then. But if we do go off of those numbers, only 84% of packages have at least 20 lines of tests, and 89% have at least 10 lines. We would have to look at some examples to see if those are "OK" or should be considered "non-compliant" with the intention of the new rules. I think also we should require this only for new packages (not new versions). Why?
IMO we could add new versions later, if we figure out an "overrides" system to persist an allowlist that a package is OK that it doesn't have enough lines of src/test/whatever. But to start with I think new packages is already something useful. |
Yeah, new packages are the most common place where we notice people registering essentially empty packages. |
In terms of implementation, I already started preparing for this when implementing the license check. In particular, during the AutoMerge process, we place a copy of the source code here: RegistryCI.jl/src/AutoMerge/types.jl Line 90 in 0c50828
We could implement it as follows:
|
X
lines of Julia code in /src
X
lines of Julia code in /src
, test
, docs
/readme/docstrings
I have a fork with a first cut at this here: The various thresholds are specified by environment variables to make them easy to control from the registration workflow. Does that seem reasonable? I wrote a unit test that works if I run it by hand. From Pkg.test though it gets a file system error. Even before I made any changes, Pkg.test fails in I'd like to try running the unit tests on GitHub, but I don't know which workflow to enable, or even if GitHub will let me enable them individually. |
So far we've mostly handled this via argumetns passed into the "public" functions: RegistryCI.jl/src/AutoMerge/public.jl Lines 12 to 38 in 2a2fe14
I think ENV variables are mostly reasonable since this is likely to be used from CI environments, but that we shouldn't have 2 ways of configuration, and since we already have configuration via arguments, we should continue to do so. That is, I think we shouldn't use ENV variables here.
The easiest way to have the tests run automatically (and the easiest way to get review feedback) is to open a pull request. That will cause this repositories CI to automatically run (except for integration tests, which a maintainer will need to trigger via Bors). Please open a pull request from your repository to this one. |
Before I make those changes, are the parameter names I picked ok? I'll lower case them if they're to be command line arguments.
From the doc string:
Make sure that various line counts meet or exceed specified thresholds.
Thresholds are controlled by these environment variables:
* SRC_MIN_LINES: Minimum number of lines of source code
* README_MIN_LINES: % Minimum number of lines in the README file
* TEST_MIN_LINES: % Minimum number of lines of code in the test directory
* DOC_MIN_LINES: # Minimum number of lines of documentation
Those marked with a % can be expressed as a count, or as a percentage
of the number of lines of source code. For TEST_MIN_LINES and
DOC_MIN_LINES, the denominatttor of the percentage also includes the
number of lines of test code or doc code respectively.
On Jan 17, 2023 10:34 AM, Eric Hanson ***@***.***> wrote:
The various thresholds are specified by environment variables to make them easy to control from the registration workflow. Does that seem reasonable?
So far we've mostly handled this via argumetns passed into the "public" functions: https://github.com/JuliaRegistries/RegistryCI.jl/blob/2a2fe14f60751694546ef1b9148b7be27b93ebec/src/AutoMerge/public.jl#L12-L38
I think ENV variables are mostly reasonable since this is likely to be used from CI environments, but that we shouldn't have 2 ways of configuration, and since we already have configuration via arguments, we should continue to do so. That is, I think we shouldn't use ENV variables here.
I wrote a unit test that works if I run it by hand. From Pkg.test though it gets a file system error.
Even before I made any changes, Pkg.test fails in futime on a directory. I don't know if this is because I'm running on MSWindows.
I'd like to try running the unit tests on GitHub, but I don't know which workflow to enable, or even if GitHub will let me enable them individually.
The easiest way to have the tests run automatically (and the easiest way to get review feedback) is to open a pull request<https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests>. That will cause this repositories CI to automatically run (except for integration tests, which a maintainer will need to trigger via Bors). Please open a pull request from your repository to this one.
—
Reply to this email directly, view it on GitHub<#351 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIBY3EZWNZSEX3S4L4TS2UTWS23WVANCNFSM4Y2DVBGQ>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Those names look reasonable to me |
Pull request: #492 |
I'm stuck. The pre-Julia 1.6 builds are failing because PackageAnalyzer is incopatible. Please suggest how I should work around that. Without thinking, I put a version test in the "applicability"" test for the new guideline, but the failure happens long before then, during cmpatibility checking. |
X=5
was suggested on Slack by @oxinabox.If anyone thinks we should not have such a check or would like to bikeshed the value of
X
, please comment here! (Would rather get that out of the way before implementing it...)Lyndon also suggested a nice error message:
The text was updated successfully, but these errors were encountered: